Home All Groups Group Topic Archive Search About

Strong-Name Assembly calling WebService

Author
27 Apr 2005 8:24 AM
C.Dimitrov
Hi,

I have the following scenario:
1. ASP application within the WEB share D:\WEBS\ASP calls
Server.CreateObject("A.A")
the server object A.A is .NET CCW with strong name assembly
registered with
regasm A.dll /codebase /tlb:A.tlb
2. Inside A initializing method another assembly A.B.dll is loaded
3. Inside A.B initializing part calling a Write to Eventlog and call a Web
Service
both A.dll and A.B.dll are located on D:\Install folder lets say and they
use a common A.config file.
4. The web service is generated by wsdl.exe and the class WebService is
added to the A.B assembly which is Strong named as well.

There are ASPNET/IUSR and IWAM permissions to D:\WINNT\Temp and the folder
Now it is able to write to the event log but when it reach the web service
call
WebService s = new WebService();
I got exception:
Cannot execute a program. The command being executed was
"d:\winnt\microsoft.net\framework\v1.1.4322\csc.exe" /noconfig
@"D:\WINNT\TEMP\yudj51u5.cmdline".

   at
System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(IntPtr
userToken, String cmd, String currentDir, TempFileCollection tempFiles,
String& outputName, String& errorName, String trueCmdLine)
   at System.CodeDom.Compiler.Executor.ExecWaitWithCapture(IntPtr userToken,
String cmd, String currentDir, TempFileCollection tempFiles, String&
outputName, String& errorName, String trueCmdLine)
   at System.CodeDom.Compiler.CodeCompiler.Compile(CompilerParameters
options, String compilerDirectory, String compilerExe, String arguments,
String& outputFile, Int32& nativeReturnValue, String trueArgs)
   at System.CodeDom.Compiler.CodeCompiler.FromFileBatch(CompilerParameters
options, String[] fileNames)
   at
System.CodeDom.Compiler.CodeCompiler.FromSourceBatch(CompilerParameters
options, String[] sources)
   at System.CodeDom.Compiler.CodeCompiler.FromSource(CompilerParameters
options, String source)
   at
System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSource(CompilerParameters options, String source)
   at System.Xml.Serialization.Compiler.Compile()
   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
mappings)
   at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
   at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
   at APIProxy.Service.Security.SecurityService..ctor() in
d:\work\.net\apiproxy\apiproxy.service\securityservice.cs:line 39
   at APIProxy.Service.Service.Login() in
d:\work\.net\apiproxy\apiproxy.service\service.cs:line 207

I tried with Asserts and these code in the assembly, but still no success:
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("..\\..\\Common.snk")]
[assembly: AssemblyKeyName("")]
//[assembly: AllowPartiallyTrustedCallers]
//[assembly: SecurityPermissionAttribute(SecurityAction.RequestMinimum,
Assertion=true)]
//[assembly:
EventLogPermissionAttribute(SecurityAction.RequestMinimum,PermissionAccess=EventLogPermissionAccess.Instrument)]
//[assembly:
FileIOPermissionAttribute(SecurityAction.RequestMinimum,Unrestricted=true)]

What I'm doing wrong? Any articles or recommendations I'm missing?

Thanks & Regards,
C.Dimitrov

Author
27 Apr 2005 11:51 AM
Nicole Calinoiu
Does http://support.microsoft.com/default.aspx?scid=kb;en-us;315904 seem
relevant?



Show quoteHide quote
"C.Dimitrov" <CDimit***@discussions.microsoft.com> wrote in message
news:0DF1158D-ACF7-4E5B-94F8-AAB62C44D967@microsoft.com...
> Hi,
>
> I have the following scenario:
> 1. ASP application within the WEB share D:\WEBS\ASP calls
> Server.CreateObject("A.A")
> the server object A.A is .NET CCW with strong name assembly
> registered with
> regasm A.dll /codebase /tlb:A.tlb
> 2. Inside A initializing method another assembly A.B.dll is loaded
> 3. Inside A.B initializing part calling a Write to Eventlog and call a Web
> Service
> both A.dll and A.B.dll are located on D:\Install folder lets say and they
> use a common A.config file.
> 4. The web service is generated by wsdl.exe and the class WebService is
> added to the A.B assembly which is Strong named as well.
>
> There are ASPNET/IUSR and IWAM permissions to D:\WINNT\Temp and the folder
> Now it is able to write to the event log but when it reach the web service
> call
> WebService s = new WebService();
> I got exception:
> Cannot execute a program. The command being executed was
> "d:\winnt\microsoft.net\framework\v1.1.4322\csc.exe" /noconfig
> @"D:\WINNT\TEMP\yudj51u5.cmdline".
>
>   at
> System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(IntPtr
> userToken, String cmd, String currentDir, TempFileCollection tempFiles,
> String& outputName, String& errorName, String trueCmdLine)
>   at System.CodeDom.Compiler.Executor.ExecWaitWithCapture(IntPtr
> userToken,
> String cmd, String currentDir, TempFileCollection tempFiles, String&
> outputName, String& errorName, String trueCmdLine)
>   at System.CodeDom.Compiler.CodeCompiler.Compile(CompilerParameters
> options, String compilerDirectory, String compilerExe, String arguments,
> String& outputFile, Int32& nativeReturnValue, String trueArgs)
>   at System.CodeDom.Compiler.CodeCompiler.FromFileBatch(CompilerParameters
> options, String[] fileNames)
>   at
> System.CodeDom.Compiler.CodeCompiler.FromSourceBatch(CompilerParameters
> options, String[] sources)
>   at System.CodeDom.Compiler.CodeCompiler.FromSource(CompilerParameters
> options, String source)
>   at
> System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSource(CompilerParameters
> options, String source)
>   at System.Xml.Serialization.Compiler.Compile()
>   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
>   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
> mappings)
>   at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
>   at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
>   at APIProxy.Service.Security.SecurityService..ctor() in
> d:\work\.net\apiproxy\apiproxy.service\securityservice.cs:line 39
>   at APIProxy.Service.Service.Login() in
> d:\work\.net\apiproxy\apiproxy.service\service.cs:line 207
>
> I tried with Asserts and these code in the assembly, but still no success:
> [assembly: AssemblyDelaySign(false)]
> [assembly: AssemblyKeyFile("..\\..\\Common.snk")]
> [assembly: AssemblyKeyName("")]
> //[assembly: AllowPartiallyTrustedCallers]
> //[assembly: SecurityPermissionAttribute(SecurityAction.RequestMinimum,
> Assertion=true)]
> //[assembly:
> EventLogPermissionAttribute(SecurityAction.RequestMinimum,PermissionAccess=EventLogPermissionAccess.Instrument)]
> //[assembly:
> FileIOPermissionAttribute(SecurityAction.RequestMinimum,Unrestricted=true)]
>
> What I'm doing wrong? Any articles or recommendations I'm missing?
>
> Thanks & Regards,
> C.Dimitrov
>
>
Author
27 Apr 2005 10:59 PM
C.Dimitrov
Hi, Nicole

Yes, that is the issue.
I have added on W2K the ASP application to High Isolated and change from
Component Services
the Identity to be another local account without impersonation works just
fine.
But on Windows 2003 Standard Server have no success even if configuring a
separate pool with different account.

Thanks,
C.Dimitrov

Show quoteHide quote
"Nicole Calinoiu" wrote:

> Does http://support.microsoft.com/default.aspx?scid=kb;en-us;315904 seem
> relevant?
>
>
>
> "C.Dimitrov" <CDimit***@discussions.microsoft.com> wrote in message
> news:0DF1158D-ACF7-4E5B-94F8-AAB62C44D967@microsoft.com...
> > Hi,
> >
> > I have the following scenario:
> > 1. ASP application within the WEB share D:\WEBS\ASP calls
> > Server.CreateObject("A.A")
> > the server object A.A is .NET CCW with strong name assembly
> > registered with
> > regasm A.dll /codebase /tlb:A.tlb
> > 2. Inside A initializing method another assembly A.B.dll is loaded
> > 3. Inside A.B initializing part calling a Write to Eventlog and call a Web
> > Service
> > both A.dll and A.B.dll are located on D:\Install folder lets say and they
> > use a common A.config file.
> > 4. The web service is generated by wsdl.exe and the class WebService is
> > added to the A.B assembly which is Strong named as well.
> >
> > There are ASPNET/IUSR and IWAM permissions to D:\WINNT\Temp and the folder
> > Now it is able to write to the event log but when it reach the web service
> > call
> > WebService s = new WebService();
> > I got exception:
> > Cannot execute a program. The command being executed was
> > "d:\winnt\microsoft.net\framework\v1.1.4322\csc.exe" /noconfig
> > @"D:\WINNT\TEMP\yudj51u5.cmdline".
> >
> >   at
> > System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(IntPtr
> > userToken, String cmd, String currentDir, TempFileCollection tempFiles,
> > String& outputName, String& errorName, String trueCmdLine)
> >   at System.CodeDom.Compiler.Executor.ExecWaitWithCapture(IntPtr
> > userToken,
> > String cmd, String currentDir, TempFileCollection tempFiles, String&
> > outputName, String& errorName, String trueCmdLine)
> >   at System.CodeDom.Compiler.CodeCompiler.Compile(CompilerParameters
> > options, String compilerDirectory, String compilerExe, String arguments,
> > String& outputFile, Int32& nativeReturnValue, String trueArgs)
> >   at System.CodeDom.Compiler.CodeCompiler.FromFileBatch(CompilerParameters
> > options, String[] fileNames)
> >   at
> > System.CodeDom.Compiler.CodeCompiler.FromSourceBatch(CompilerParameters
> > options, String[] sources)
> >   at System.CodeDom.Compiler.CodeCompiler.FromSource(CompilerParameters
> > options, String source)
> >   at
> > System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSource(CompilerParameters
> > options, String source)
> >   at System.Xml.Serialization.Compiler.Compile()
> >   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
> >   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
> > mappings)
> >   at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
> >   at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
> >   at APIProxy.Service.Security.SecurityService..ctor() in
> > d:\work\.net\apiproxy\apiproxy.service\securityservice.cs:line 39
> >   at APIProxy.Service.Service.Login() in
> > d:\work\.net\apiproxy\apiproxy.service\service.cs:line 207
> >
> > I tried with Asserts and these code in the assembly, but still no success:
> > [assembly: AssemblyDelaySign(false)]
> > [assembly: AssemblyKeyFile("..\\..\\Common.snk")]
> > [assembly: AssemblyKeyName("")]
> > //[assembly: AllowPartiallyTrustedCallers]
> > //[assembly: SecurityPermissionAttribute(SecurityAction.RequestMinimum,
> > Assertion=true)]
> > //[assembly:
> > EventLogPermissionAttribute(SecurityAction.RequestMinimum,PermissionAccess=EventLogPermissionAccess.Instrument)]
> > //[assembly:
> > FileIOPermissionAttribute(SecurityAction.RequestMinimum,Unrestricted=true)]
> >
> > What I'm doing wrong? Any articles or recommendations I'm missing?
> >
> > Thanks & Regards,
> > C.Dimitrov
> >
> >
>
>
>
Author
28 Apr 2005 12:20 PM
Nicole Calinoiu
"C.Dimitrov" <CDimit***@discussions.microsoft.com> wrote in message
news:326A7F29-3195-478B-A9AD-4926AB259568@microsoft.com...
> Hi, Nicole
>
> Yes, that is the issue.
> I have added on W2K the ASP application to High Isolated and change from
> Component Services
> the Identity to be another local account without impersonation works just
> fine.
> But on Windows 2003 Standard Server have no success even if configuring a
> separate pool with different account.

Are you sure this account has the necessary permissions to run csc.exe?


Show quoteHide quote
>
> Thanks,
> C.Dimitrov
>
> "Nicole Calinoiu" wrote:
>
>> Does http://support.microsoft.com/default.aspx?scid=kb;en-us;315904 seem
>> relevant?
>>
>>
>>
>> "C.Dimitrov" <CDimit***@discussions.microsoft.com> wrote in message
>> news:0DF1158D-ACF7-4E5B-94F8-AAB62C44D967@microsoft.com...
>> > Hi,
>> >
>> > I have the following scenario:
>> > 1. ASP application within the WEB share D:\WEBS\ASP calls
>> > Server.CreateObject("A.A")
>> > the server object A.A is .NET CCW with strong name assembly
>> > registered with
>> > regasm A.dll /codebase /tlb:A.tlb
>> > 2. Inside A initializing method another assembly A.B.dll is loaded
>> > 3. Inside A.B initializing part calling a Write to Eventlog and call a
>> > Web
>> > Service
>> > both A.dll and A.B.dll are located on D:\Install folder lets say and
>> > they
>> > use a common A.config file.
>> > 4. The web service is generated by wsdl.exe and the class WebService is
>> > added to the A.B assembly which is Strong named as well.
>> >
>> > There are ASPNET/IUSR and IWAM permissions to D:\WINNT\Temp and the
>> > folder
>> > Now it is able to write to the event log but when it reach the web
>> > service
>> > call
>> > WebService s = new WebService();
>> > I got exception:
>> > Cannot execute a program. The command being executed was
>> > "d:\winnt\microsoft.net\framework\v1.1.4322\csc.exe" /noconfig
>> > @"D:\WINNT\TEMP\yudj51u5.cmdline".
>> >
>> >   at
>> > System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(IntPtr
>> > userToken, String cmd, String currentDir, TempFileCollection tempFiles,
>> > String& outputName, String& errorName, String trueCmdLine)
>> >   at System.CodeDom.Compiler.Executor.ExecWaitWithCapture(IntPtr
>> > userToken,
>> > String cmd, String currentDir, TempFileCollection tempFiles, String&
>> > outputName, String& errorName, String trueCmdLine)
>> >   at System.CodeDom.Compiler.CodeCompiler.Compile(CompilerParameters
>> > options, String compilerDirectory, String compilerExe, String
>> > arguments,
>> > String& outputFile, Int32& nativeReturnValue, String trueArgs)
>> >   at
>> > System.CodeDom.Compiler.CodeCompiler.FromFileBatch(CompilerParameters
>> > options, String[] fileNames)
>> >   at
>> > System.CodeDom.Compiler.CodeCompiler.FromSourceBatch(CompilerParameters
>> > options, String[] sources)
>> >   at System.CodeDom.Compiler.CodeCompiler.FromSource(CompilerParameters
>> > options, String source)
>> >   at
>> > System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSource(CompilerParameters
>> > options, String source)
>> >   at System.Xml.Serialization.Compiler.Compile()
>> >   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[]
>> > xmlMappings)
>> >   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[]
>> > mappings)
>> >   at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
>> >   at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
>> >   at APIProxy.Service.Security.SecurityService..ctor() in
>> > d:\work\.net\apiproxy\apiproxy.service\securityservice.cs:line 39
>> >   at APIProxy.Service.Service.Login() in
>> > d:\work\.net\apiproxy\apiproxy.service\service.cs:line 207
>> >
>> > I tried with Asserts and these code in the assembly, but still no
>> > success:
>> > [assembly: AssemblyDelaySign(false)]
>> > [assembly: AssemblyKeyFile("..\\..\\Common.snk")]
>> > [assembly: AssemblyKeyName("")]
>> > //[assembly: AllowPartiallyTrustedCallers]
>> > //[assembly: SecurityPermissionAttribute(SecurityAction.RequestMinimum,
>> > Assertion=true)]
>> > //[assembly:
>> > EventLogPermissionAttribute(SecurityAction.RequestMinimum,PermissionAccess=EventLogPermissionAccess.Instrument)]
>> > //[assembly:
>> > FileIOPermissionAttribute(SecurityAction.RequestMinimum,Unrestricted=true)]
>> >
>> > What I'm doing wrong? Any articles or recommendations I'm missing?
>> >
>> > Thanks & Regards,
>> > C.Dimitrov
>> >
>> >
>>
>>
>>