2008年3月11日

解决ASP.NET错误 Temporary ASP.NET Files\ dll ' -- '拒绝访问。 ' ..

Windows Server 2003
打开页面时总是报错:    error CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\...\xxxxxx.dll' -- '拒绝访问。 '

解决方案:
    
    1. 在 %Systemroot% 下创建一个目录, 命名为 Temp. (如果已经存在该目录, 此步可略过)
     譬如Windows2003安装在C:盘,则%Systemroot% 为C:\WINDOWS
    2. 将该目录的 aspnet 用户帐户(相对于 .NET Framework 1.0 来说) 或者是 NETWORK SERVICE 用户帐户(相对于 .NET Framework 1.1 以上版本)赋予完全许可权限.
    3. 将系统环境变量 TEMP 指向 %SystemRoot%\TEMP .
    4. 将系统环境变量 TMP 指向 %SystemRoot%\TEMP .
    5. 如果有必要, 在开始——〉RUN 中输入 iisreset 重置 Internet Information Services (IIS).
    6. 如果有必要, 重启计算机.

posted @ 2008-03-11 09:42 有鹏自远方来 阅读(644) 评论(0) 编辑

PRB: CS0013 or CS0016 Compilation Errors in ASP.NET Web Applications

When you view a Microsoft ASP.NET Application in a Web browser, you may receive the following error messages:

For the Microsoft .NET Framework version 1.1, the error message is the following:
CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\application1\c11b43f6\cf3ec03\rizcntet.dll' . The directory name is invalid.
For the .NET Framework 1.0, the error message is the following:
CS0013: Unexpected error writing metadata to file 'C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\Temporary ASP.NET Files\application2\3fc72f26\eb731247\ev2bslce.dll'. The directory name is invalid.


RESOLUTION

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.

posted @ 2008-03-11 09:35 有鹏自远方来 阅读(125) 评论(0) 编辑

解决ASP.NET错误 Failed to map the path '/App_GlobalResources/'

错误信息:Failed to map the path '/App_GlobalResources/'
环境:windows 2k Ad Server+SP4+IIS 5+asp.net2
分析解决:
利用FileMon工具检查,发现aspnet_wp.exe对C:\Documents and Settings\All Users\ Application Data\Microsoft\Crypto\RSA\MachineKeys目录下权限有问题.因配置服务器,此文件只有 administrators组及system有完全控权限,最后的权限设置如下解决此问题:
c:\ ASPNET R(只有此文件夹)
C:\Documents and Settings\All Users\Application Data\ ASPNET R(只有此文件夹)
C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\ RW(只有此文件夹)
(xcacls "C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto" /T /E /G ASPNET:EWD)
(操作系统不同,位置可能不一样)

posted @ 2008-03-11 09:28 有鹏自远方来 阅读(1158) 评论(0) 编辑

解决ASP.NET App-Domain could not be created. Error: 0x80131902

打开ASP.NET 网站时,如果发生错误,经查看Web服务器的「事件查看器」中之「应用程序」,如果错误是:

Failed to execute request because the App-Domain could not be created. Error: 0x80131902

基本上,这种情况最可能发生在第一次执行 .Net framework 2.0 ,原因不明,但下面的做法大致可以解決此问题:

1.首先打开「命令提示符」,切换目录到 %SystemRoot%\Microsoft.Net\Framework\ (%SystemRoot% 視你 Windows 安裝目录而定,一般是在 C:\Windows)

2.执行 "net stop w3svc" 停止 w3svc 服务
3.切换到下级目录 v2.0.50727
4.执行 "aspnet_regiis.exe -ua" 解除 .Net 安裝
5.重新安裝 .Net 到 IIS 中 "aspnet_regiis.exe -i"
6.重新启动 w3svc "net start w3svc".

posted @ 2008-03-11 09:18 有鹏自远方来 阅读(1358) 评论(0) 编辑

解决ASP.NET的0x80131902错误

ASP.net的0x80131902错误一般发生在第一次在IIS上运行aspx页面文件的时候。浏览器显示的错误为“App-Domain could not be created. Error: 0x80131902”,即“无法创建应用程序域”。错误原因不清楚。下面是一个解决方法:
     1)打开命令提示符(Command Prompt)
     2)执行“net stop w3svc”,停止IIS
     3)切换到目录“C:\Windows\Microsoft.NET\Framework\v2.0.50727”
     4)执行“aspnet_regiis.exe -ua”,卸载IIS上所有版本的ASP.net。
     5)执行“aspnet_regiis.exe -i”,重新安装ASP.net到IIS
     6)执行“net start w3svc”,启动IIS

posted @ 2008-03-11 09:17 有鹏自远方来 阅读(649) 评论(0) 编辑