Prevent .NET from writing to C:\Windows\Temp

后端 未结 5 740
伪装坚强ぢ
伪装坚强ぢ 2021-01-19 01:28

I\'ve got a C# application that I\'m trying to push out to a distributed network. The application works fine locally (as always), but when I push it out to the network, it

相关标签:
5条回答
  • 2021-01-19 01:50

    Josh,

    My guess would be that the call you are making is trying to kick off a debugging session on the target PC. It is trying to pull up the source file, after having an exception.

    The root cause is likely an exception in the web service call.

    To mitigate the write to the temp folder, you might be able to disable just-in-time debugging on the target machines: something like <system.windows.forms jitDebugging="false"/> in app config

    I did some digging. It looks like the issue may be on the server, not the client machines. If you add read/write permissions to the temp folder for the user hosting the webservice, it may be OK. Sorry for the crazy advice above...

    0 讨论(0)
  • 2021-01-19 01:53

    The problem you have here is that you are using some function which auto-generates temporary code. It needs a location to do this. So yes, while you can prevent it from writing code to that specific location, the only way to prevent it from generating code (that must be stored somewhere) is to not use a function that generates temporary classes.

    0 讨论(0)
  • 2021-01-19 02:02

    Searched so many forums and finally fixed it..This worked for me..here you go!!

    1. right click c:\windows\temp folder

    2. under security tab, add the iisuser account to the list of users and give read/write/execute access (or) full rights

    3. restart the website

    Thats it !!!...check you application which consumes the deployed web service

    This should do..

    0 讨论(0)
  • 2021-01-19 02:05

    the process that runs this code (IIS related NT account?) should have an appropriate permission set read more http://www.google.com/search?q=asp.net+writing+files+permissions

    0 讨论(0)
  • 2021-01-19 02:07

    It seems that webservices require read/write permission to %SystemRoot%\Temp (MSDN).

    From here:

    If you're running ASP.NET 2.0 or above, you can assign the required permissions with the command:

    aspnet_regiis -GA MachineName\Account
    

    This blog post contains instructions on how to change the location of the SystemRoot\Temp folder used for this (as well as instructions on how to use reflector to determine the setting in web.config to set for a situation like this)

    0 讨论(0)
提交回复
热议问题