\ WINDOWS \ TEMP:从编写到C prevent .NET [英] Prevent .NET from writing to C:\Windows\Temp

查看:150
本文介绍了\ WINDOWS \ TEMP:从编写到C prevent .NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个C#应用程序,我想推送到分布式网络。该应用程序正常工作本地(一如既往),但是当我推到网络上,这是行不通的,因为它不能写入到C:\ WINDOWS \ TEMP目录。我没有实际调用任何code写入到该目录,但我想这是我的电话,以一个web服务引起的,考虑到以下异常:

  

无法生成临时类(结果= 1)。   错误CS2001:源文件C:\ WINDOWS \ TEMP \ cyalinh1.0.cs不能   发现错误CS2008:没有输入指定的。请参阅的InnerException   了解更多详情。

有没有什么办法prevent .NET写入到Temp目录?它是在config文件的设置?

更新

可以SGEN用于prevent建立从Web服务的动态创建类的?

解决方案

看来,Web服务需要读/写权限为%SystemRoot%\温度( MSDN )。

这里

  

如果你正在运行ASP.NET 2.0   上面,你可以指定所需的   用命令的权限:

 为aspnet_regiis -GA计算机名\帐户
 

博客帖子包含如何改变SYSTEMROOT的\ Temp的位置指示用于此(以及如何使用反射来确定在web.config中的设置来进行这样的情况下设置指令)文件夹

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 doesn't work because it can't write to the C:\Windows\Temp directory. I'm not actually calling any code that writes to that directory, but I imagine it is caused by my calls to a webservice, given the following exception:

Unable to generate a temporary class (result=1). error CS2001: Source file 'C:\WINDOWS\TEMP\cyalinh1.0.cs' could not be found error CS2008: No inputs specified '. Please see InnerException for more details.

Is there any way to prevent .NET from writing to the Temp directory? Is it a setting in the .config file?

UPDATE

Can SGEN be used to prevent the creation of those dynamically created classes from the webservice?

解决方案

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)

这篇关于\ WINDOWS \ TEMP:从编写到C prevent .NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆