web.config 注释包含在行错误中?
web.config comments included in line error?
我正在对一个应用进行故障排除,但我遇到了这个错误:
Exception message: Could not load file or assembly 'This.File,
Version=1, Culture=neutral, PublicKeyToken=[sometoken]' or one of its
dependencies. Access is denied. (C:\Program Files[file
location]\web.config line 205
现在 - 完全 web.config 文件的第 205 行,或者第 205 行 if 所有评论web.config 中的空行是否被删除?
我已经尝试研究这个但发现它非常棘手!
谢谢!
此错误表示 web.config 中引用了编译器无法定位的程序集。有解决此问题的策略。首先,如果您有 DLL,请确保它被您的项目引用。
如果它是位于测试机器上某个位置的库,您可以使用 .NET Framework SDK 中的此工具 - Assembly Binding Log Viewer https://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx。此工具将告诉您 .NET 在尝试查找您的程序集时正在查找的位置。
如果您想在 运行 时间动态加载程序集,您可以通过处理当前 AppDomain
上的 AssemblyResolve 事件在代码中捕获此错误]: https://msdn.microsoft.com/en-us/library/system.appdomain.assemblyresolve(v=vs.110).aspx
我正在对一个应用进行故障排除,但我遇到了这个错误:
Exception message: Could not load file or assembly 'This.File, Version=1, Culture=neutral, PublicKeyToken=[sometoken]' or one of its dependencies. Access is denied. (C:\Program Files[file location]\web.config line 205
现在 - 完全 web.config 文件的第 205 行,或者第 205 行 if 所有评论web.config 中的空行是否被删除?
我已经尝试研究这个但发现它非常棘手!
谢谢!
此错误表示 web.config 中引用了编译器无法定位的程序集。有解决此问题的策略。首先,如果您有 DLL,请确保它被您的项目引用。
如果它是位于测试机器上某个位置的库,您可以使用 .NET Framework SDK 中的此工具 - Assembly Binding Log Viewer https://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx。此工具将告诉您 .NET 在尝试查找您的程序集时正在查找的位置。
如果您想在 运行 时间动态加载程序集,您可以通过处理当前 AppDomain
上的 AssemblyResolve 事件在代码中捕获此错误]: https://msdn.microsoft.com/en-us/library/system.appdomain.assemblyresolve(v=vs.110).aspx