M
Mathieu Cartoixa
Hi all,
We have developed a web application in ASP .NET (C#, .NET 2.0, IIS 6.0,
Windows Server 2003), with integrated Windows authentification, and
impersonation. I have tried to use memory streams, as opposed to
temporary files, as often as possible beacuse we want to spare our
client the pain of folder rights administration.
But our efforts proved worthless as we integrated Crystal Reports
(VS2005 edition) in our application : their framework relies on the
creation of such temporary files, in C:\WINDOWS\Temp and in
....\ASPNET\Local Settings\Temp (%TMP%, Crystal not always running under
impersonation).
To keep our goal, we managed to find what appears to be a good
solution, but about which we would like to get some feedback. In
Global.asax, we set :
void Application_Start(object sender, EventArgs e)
{
string tmpPath=HttpRuntime.CodegenDir;
WebUtilities.SetEnvironmentVariable("TMP", tmpPath);
WebUtilities.SetEnvironmentVariable("TEMP", tmpPath);
}
SetEnvironmentVariable is defined as :
public static class WebUtilities
{
[DllImport("kernel32.dll", EntryPoint="SetEnvironmentVariableW",
CharSet=CharSet.Unicode)]
public static extern bool SetEnvironmentVariable(string name,
string val);
}
Everything works fine, as far as we could test. Do you think we can
rely on this ?
Thanks in advance.
Mathieu CARTOIXA
We have developed a web application in ASP .NET (C#, .NET 2.0, IIS 6.0,
Windows Server 2003), with integrated Windows authentification, and
impersonation. I have tried to use memory streams, as opposed to
temporary files, as often as possible beacuse we want to spare our
client the pain of folder rights administration.
But our efforts proved worthless as we integrated Crystal Reports
(VS2005 edition) in our application : their framework relies on the
creation of such temporary files, in C:\WINDOWS\Temp and in
....\ASPNET\Local Settings\Temp (%TMP%, Crystal not always running under
impersonation).
To keep our goal, we managed to find what appears to be a good
solution, but about which we would like to get some feedback. In
Global.asax, we set :
void Application_Start(object sender, EventArgs e)
{
string tmpPath=HttpRuntime.CodegenDir;
WebUtilities.SetEnvironmentVariable("TMP", tmpPath);
WebUtilities.SetEnvironmentVariable("TEMP", tmpPath);
}
SetEnvironmentVariable is defined as :
public static class WebUtilities
{
[DllImport("kernel32.dll", EntryPoint="SetEnvironmentVariableW",
CharSet=CharSet.Unicode)]
public static extern bool SetEnvironmentVariable(string name,
string val);
}
Everything works fine, as far as we could test. Do you think we can
rely on this ?
Thanks in advance.
Mathieu CARTOIXA