返回首页
当前位置: 主页 > 编程语言 > C#教程 >

Could not write to output file c未能写入输出文件

时间:2017-12-11 22:49来源:电脑教程学习网 www.etwiki.cn 编辑:admin

一般来说,配置网站服务器权限后,.net 容易出现“CS0016: Could not write to output file c未能写入输出文件 拒绝访问”这样的错误,错误提示'c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\App_Web_index.aspx.29631bad.galqkak3.dll' -- '拒绝访问。',这很容易误导人,以为没有访问 App_Web_index.aspx.29631bad.galqkak3.dll 文件的权限,或者对路径的某个文件夹没有修改权限,其实与它们没有任何什么关系,在后续的解决方法中会说明。

 

  打开网页是时,错误的详细信息如下:

Server Error in '/' Application. --------------------------------------------------------------------------------

Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0016: Could not write to output file 'c:\windows\Microsoft.NET\Framework\v4.0.30319\TemporaryASP.NET Files\root\9218c35c\1d16c6e1\App_Web_index.aspx.29631bad.galqkak3.dll' -- '拒绝访问。 '

Source Error:

[No relevant source lines]

Source File: Line: 0

Show Detailed Compiler Output:

c:\windows\system32\inetsrv> "c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\csc.exe" /t:library /utf8output /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Entity\v4.0_4.0.0.0__b77a5c561934e089\System.Web.Entity.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\App_Web_0jjkjmza.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization

\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework

\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\assembly\dl3\f2beb448\2c3ef87b_e786cf01\LS.BLL.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll"/R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll"

/R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"c:\WINDOWS

\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\assembly\dl3\67b9a1d4\1c3bcb6a_9bc0c901\AjaxPro.2.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core

\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\assembly\dl3\d9cbb93b\18c98e91_e786cf01\LS.IDAL.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework

\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\assembly\dl3\6bcd136a\be28daea_89decd01\LS.Config.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\assembly\dl3\8485848d\742437eb_89decd01\LS.Security.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\assembly\dl3\95328fc3\60b7e24f_4cedcd01\LS.Upload.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\TemporaryASP.NET Files\root\9218c35c\1d16c6e1\assembly\dl3\8ce6408c\da9062d9_9c0ecf01\RL.WebUtility.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\assembly\dl3\d5633e77\f69d1e4f_4cedcd01\LS.Model.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\assembly\dl3\0dde29c3\c0aec784_e786cf01\LS.SQLServer.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\assembly\dl3\4cb66e2c\542973b4_4fedcd01\LS.DALFactory.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\assembly\dl3\49a3cbe2\c6968ec0_c5e9cd01\LS.DBUtility.dll"

/R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll" /R:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\assembly\dl3\80e9a907\566abe0d_998bcf01\lisiya.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /out:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\App_Web_index.aspx.29631bad.galqkak3.dll" /debug- /optimize+ /win32res:"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\2rks2zkn.res" /w:4/nowarn:1659;1699;1701 /warnaserror- "c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\App_Web_index.aspx.29631bad.galqkak3.0.cs" "c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\App_Web_index.aspx.29631bad.galqkak3.1.cs"

 

Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1

Copyright (C) Microsoft Corporation. All rights reserved.

error CS0016: Could not write to output file 'c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\9218c35c\1d16c6e1\App_Web_index.aspx.29631bad.galqkak3.dll' -- '拒绝访问。 '

-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1022

 

  解决办法:

  1、错误原因:Users 用户对 C:\Windows 目录下的 temp 文件夹没有修改,当 .net 需要向 temp 文件夹写临时文件时,因无权限写入而产生异常。

  2、解决办法:

  只需向 C:\Windows 目录下的 temp 文件夹添加 Users 用户并分配“修改”权限;如果 temp 文件夹已经有 Users 用户,勾选“修改”权限即可。方法如下:      A、右键 temp 文件夹,选择“属性” → “安全”选项卡 → 编辑,如图1所示:

CS0016: Could not write to output file c未能写入输出文件 拒绝访问

图1

  Windows Server 2003 选择“属性” → “安全”选项卡就行了。

 

  B、选中 Users 用户,勾选“修改”,单击“确定”即可。

  C、如果 Users 用户不在“组或用户名”中,单击“添加” → 高级 → 立即查找 → 双击“搜索结果”中的 Users 用户 → 确定。
 

------分隔线----------------------------
标签(Tag):c#
------分隔线----------------------------
推荐内容
猜你感兴趣