未能加载文件或程序集“System.ServiceModel, Version=3.0.0.0

bink 2009-06-03 12:07:21
崩溃的。。

Windows Server 2008
IIS7
VS 2008


在其他机器上用 .Net 2.0 做的项目在我机器上就出现这个错误。





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

拒绝访问。 (异常来自 HRESULT:0x80070005 (E_ACCESSDENIED))
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: 拒绝访问。 (异常来自 HRESULT:0x80070005 (E_ACCESSDENIED))

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:


Line 244: this.SmpNavigator.CurrentNode = "<a href='tFieldManage.aspx?ModelType=" + BasePage.RequestInt32("ModelType").ToString() + "&ModelId=" + BasePage.RequestString("ModelId") + "&ModelName=" + base.Server.HtmlEncode(BasePage.RequestString("ModelName")) + "'>字段管理</a>";
Line 245: }
Line 246: this.EgvField.DataBind();
Line 247: }
Line 248: }


Source File: d:\wwwroot\Projects\web\Admin\CommonModel\tFieldManage.aspx.cs Line: 246

Stack Trace:


[UnauthorizedAccessException: 拒绝访问。 (异常来自 HRESULT:0x80070005 (E_ACCESSDENIED))]

[FileLoadException: 未能加载文件或程序集“System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。拒绝访问。]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46

[ConfigurationErrorsException: 未能加载文件或程序集“System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。拒绝访问。]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +57
System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +29
System.Web.Compilation.CompilationUtil.GetTypeFromAssemblies(AssemblyCollection assembliesCollection, String typeName, Boolean ignoreCase) +132
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +291
System.Web.UI.WebControls.ObjectDataSourceView.GetType(String typeName) +43
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1171
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
System.Web.UI.WebControls.GridView.DataBind() +4
Admin_CommonModel_tFieldManage.Page_Load(Object sender, EventArgs e) in d:\wwwroot\Projects\web\Admin\CommonModel\tFieldManage.aspx.cs:246
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6741
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
System.Web.UI.Page.ProcessRequest() +80
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.admin_commonmodel_tfieldmanage_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\672956cb\390e4fda\App_Web_jbpphqfj.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.50727.3074

...全文
6715 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
albert1203 2011-06-23
  • 打赏
  • 举报
回复
大家都有这个问题啊··
chendong9999 2011-02-22
  • 打赏
  • 举报
回复
上面的有句话错了 是安装了高版本的。net后有安装低版本而导致的错误。
chendong9999 2011-02-22
  • 打赏
  • 举报
回复
http://support.microsoft.com/kb/2015129
根据微软的提示发现可能是由于安装了高版本的.net framework 导致这种错误。这里面有解决的方法。
第一步:修改配置文件 %windir%\system32\inetsrv\config\applicationHost
<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler,runtimeVersionv2.0" />
第二步:打开位于下列地址的(%windir%\Microsoft.NET\Framework\v4.0.30319)aspnet_regiis.exe -iru 文件



lwh_2010 2010-10-28
  • 打赏
  • 举报
回复
1、把应用程序池的托管管道模式调成经典,
2、iis的根节点->右侧“isapi和cgi限制”->把禁止的dotnet版本项设置为允许

PS.如果还不行的话,就把当前Framework调成2.0的,默认是4.0的。
chiglish 2010-10-19
  • 打赏
  • 举报
回复
我也是啊,急求,我是装完.net 3.5 sp1之后出现的,我的项目是2.0的
qsir123 2010-09-13
  • 打赏
  • 举报
回复
我考,我的也出现这个问题了,怎么解决
nw1010 2010-06-09
  • 打赏
  • 举报
回复
问题一个接一个。
lucky_m_fish 2010-04-24
  • 打赏
  • 举报
回复
顶下。。。。。我也是这个问题?到现在还是没有解决。
bink 2009-06-03
  • 打赏
  • 举报
回复
everbody can help me?
bink 2009-06-03
  • 打赏
  • 举报
回复
用户代码未处理 System.Configuration.ConfigurationErrorsException
Message="未能加载文件或程序集“System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。拒绝访问。"
Source="System.Web"
BareMessage="未能加载文件或程序集“System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。拒绝访问。"
Line=0
StackTrace:
at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)
at System.Web.Configuration.AssemblyInfo.get_AssemblyInternal()
at System.Web.Compilation.CompilationUtil.GetTypeFromAssemblies(AssemblyCollection assembliesCollection, String typeName, Boolean ignoreCase)
at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
at System.Web.UI.WebControls.ObjectDataSourceView.GetType(String typeName)
at System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
at System.Web.UI.WebControls.GridView.DataBind()
at Admin_CommonModel_tFieldManage.Page_Load(Object sender, EventArgs e) in d:\wwwroot\Projects\web\web\Admin\CommonModel\tFieldManage.aspx.cs:line 246
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException: System.IO.FileLoadException
Message="未能加载文件或程序集“System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”或它的某一个依赖项。拒绝访问。"
Source="mscorlib"
FileName="System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
FusionLog=""
StackTrace:
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
InnerException: System.UnauthorizedAccessException
Message="拒绝访问。 (异常来自 HRESULT:0x80070005 (E_ACCESSDENIED))"
InnerException:
yan286093636 2009-06-03
  • 打赏
  • 举报
回复
顶。。。。
bink 2009-06-03
  • 打赏
  • 举报
回复
DLL 文件位置在 C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\System.ServiceModel.dll 版本:3.0.4056.2230
我怕没引用到,还把这个文件复制到网站的bin目录下面,但是也出现重复引用的错误。

权限的话,网站目录该给的权限我都给了,并且程序能够正常运行,只是在打开某个子页面时出现这个错误。是一个叫 this.EgvField.DataBind(); 的出的错误。
wuyq11 2009-06-03
  • 打赏
  • 举报
回复
dll文件是否引用
权限是否设置

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧