Impersonate second session require restart of IIS

From: Curt Mc Gee (curt.mc.gee@lee.net)
Date: 07/14/02


From: "Curt Mc Gee" <curt.mc.gee@lee.net>
Date: Sun, 14 Jul 2002 05:04:35 -0700


 have written an asp.net application for each of out 32
enterprises (running under IIS5.0, .NET framework + sp1,
2000 Server with latest security pacx and service pacs)
that accesses a shared folder on the users PC (i.e.
10.1.1.10\mySharedFolder). I'm impersonating a profile
(i.e. myUser) that is setup on both the 2000 Server and
the users PC, with permissions to read, write, execute
etc. The myUser profile has been given full permission to
the files in WINNT\Microsoft.NET\Framwork\v1.0.3705\*.* .
In the Web.Config file I have the impersonate statement:
<system.web>
 <identity impersonate="true" />
</system.web>
When I check for the
System.Security.Principal.WindowsIdentity.GetCurrent
().Name the correct myUser id is being processed.
On the first attempt to access the app I get the following
error:

Cannot execute a program. The command being executed
was "c:\winnt\microsoft.net\framework\v1.0.3705\vbc.exe"
@"C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary
ASP.NET Files\upload\4361bd69\e68dfd45\5vbc3jzp.cmdline".
Description: An unhandled exception occurred during
compilation using the
CodeDomProvider 'Microsoft.VisualBasic.VBCodeProvider'.
Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details:
System.Runtime.InteropServices.ExternalException: Cannot
execute a program. The command being executed
was "c:\winnt\microsoft.net\framework\v1.0.3705\vbc.exe"
@"C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary
ASP.NET Files\upload\4361bd69\e68dfd45\5vbc3jzp.cmdline".

Source Error:

An unhandled exception was generated during the execution
of the current web request. Information regarding the
origin and location of the exception can be identified
using the exception stack trace below.

Stack Trace:

[ExternalException (0x10b): Cannot execute a program. The
command being executed
was "c:\winnt\microsoft.net\framework\v1.0.3705\vbc.exe"
@"C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary
ASP.NET Files\upload\4361bd69\e68dfd45\5vbc3jzp.cmdline".]
   System.CodeDom.Compiler.Executor.ExecWaitWithCapture
(IntPtr userToken, String cmd, String currentDir,
TempFileCollection tempFiles, String& outputName, String&
errorName, String trueCmdLine) +1594
   System.CodeDom.Compiler.CodeCompiler.Compile
(CompilerParameters options, String compilerDirectory,
String compilerExe, String arguments, String& outputFile,
Int32& nativeReturnValue, String trueArgs) +383
   System.CodeDom.Compiler.CodeCompiler.FromFileBatch
(CompilerParameters options, String[] fileNames) +461
   System.CodeDom.Compiler.CodeCompiler.FromDomBatch
(CompilerParameters options, CodeCompileUnit[] ea) +429
   System.CodeDom.Compiler.CodeCompiler.FromDom
(CompilerParameters options, CodeCompileUnit e) +90
   
System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compile
r.ICodeCompiler.CompileAssemblyFromDom(CompilerParameters
options, CodeCompileUnit e) +37
   System.Web.Compilation.BaseCompiler.GetCompiledType()
+249

 

If I restart the IIS server the application runs like it
should, access is granted and the user can view files in
the shared folder and upload them t{w{}\dC-
o the server. Any other
asp.net page that is accessed under the same app the error
occurs again. Restarting IIS server the page compiles as
expected.

I have also tried to hard code the impersonation using the
code found at http://support.microsoft.com/default.aspx?
scid=



Relevant Pages

  • Help: OWSADM hangs when executing from C# web service
    ... admin user and providing the login credentials through the ... string output = process.StandardOutput.ReadToEnd; ... For some reason when I execute the Startmethod then the OWSADM hangs ... The machine is running Windows Server 2003 Enterprise edition. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: DirectoryEntry.Invoke("SetPassword") slow
    ... It could be related to an SSL problem on the server. ... > or two to execute: ... > public void AddUser(string userName, string domain, string firstName, ...
    (microsoft.public.dotnet.framework)
  • Re: gute Beschreibung zu DdeClientTransaction()
    ... DDE- Server aus dem Client heraus starte. ... Server noch keine "execute" Anfragen akzeptieren ... Wo soll den die Länge vom String angegeben werden? ... HDDEDATA hData = DdeCreateDataHandleszCommand, ...
    (microsoft.public.de.vc)
  • Dynamic compilation errors
    ... Timed out waiting for a program to execute. ... userToken, String cmd, String currentDir, TempFileCollection tempFiles, ... String cmd, String currentDir, TempFileCollection tempFiles, String& ... people suggest it involves IISLockdown which we have on our server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • SQL Connection Problem
    ... An error has occurred while establishing a connection to the server. ... database location within the applications App_Data directory. ... Boolean& failoverDemandDone, String host, String failoverPartner, String ... user, String password, Boolean trusted, String connectionString) +68 ...
    (microsoft.public.dotnet.framework.aspnet)