1. | Create a temporary folder under %Systemroot% , and then name it Temp . |
2. | Grant full permissions on the Temp folder to the aspnet user account in .NET Framework 1.0 or to the NETWORK SERVICE user account in .NET Framework 1.1. |
3. | Right-click My Computer , and then click Properties . |
4. | On the Advanced tab, click Environment Variables . |
5. | Select the TEMP variable under System variables , and then click Edit . |
6. | Type %SystemRoot% \TEMP in the Variable Value box, and then click OK . |
7. | Repeat steps 5 and 6 to edit the TMP variable. Click OK two times. |
8. | Click Start , and then click Run . |
9. | To reset Internet Information Services (IIS), type iisreset on the command prompt. Note If the error message that is mentioned in the "Symptoms" section of this article persists, restart the computer. |
解决:1.在C:windows文件夹创建TEMP文件夹(如有就不用建了)2.如果.NET Framework 1.0的则对TEMP文件夹增加ASPNET用户,给予足够的权限,如果.NET Framework 1.1的则对TEMP文件夹增加NETWOR SERVICE用户,给予足够的权限. 3.在系统环境变量里面创建两个变量:TEMP,TMP都指向TEMP文件夹.
这是微软的解决方案.网上有的方法是对Temporary ASP.NET Files文件夹增加用户以及赋权限.实际上Temporary ASP.NET Files为临时文件夹是可以继承TEMP文件夹的权限的,所以设了TEMP文件夹就可以了.
windows / temp权限
然后确认network service的帐号权限
确认users的权限是否正确
经过这些设置后,您的.net程序在运行时基本不会有什么问题了.
以上权限配置TEMP目录的NETWORK SERVICE用户权限如果设为特殊的还不行,设为完全控制的权限就没问题了.
现在一般的ASP.net都升级了2.0的版本!那么可能会出现以下错误:
配置错误
说明:在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。
分析器错误信息:无法识别的属性“xmlns”。
源错误:
行1:<configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0 ">
行2:<appSettings/>
行3:<connectionStrings>
后来研究发现,是框架解析的问题,因为我开发用的是vs2005这个是在framework2.0下编译运行的,而公司虽然也装上了framework2.0,但是由于,是iis没有注册asp.net2.0而仍然是1。1的。
解决办法:
在DOS下C:\WINDOWS\Microsoft .NET\Framework\v2.0.50215目录中运行
aspnet_regiis.exe-i
也可以在iis中的属性设置,参照下面图
注意改成2.0之后又可能会出现权限不够的错误,将V2.0的Temporary ASP.NET Files文件夹增加NETWORK SERVICE用户并赋以足够权限就可以了.