我遇到了VS2010的一个奇怪问题.我们使用TFS来构建我们的API dll,我们曾经在我们的项目中引用它们,使用一个完全可信的映射网络驱动器.我们一直在这样工作至少两年,一切都很完美.
今天,我将一个webapp转换为vs2010,当我在Release中编译它时,它给了我:
SGEN:错误:无法加载文件或程序集'file:/// L:\ Api\Release API_20100521.1\Release\CS.API.Exceptions.dll'或其依赖项之一.不支持操作.(HRESULT异常:0x80131515)
奇怪的是,当它在Debug配置文件下时它正在工作......
我试过添加
<runtime>
<loadFromRemoteSources enabled="true" />
</runtime>
Run Code Online (Sandbox Code Playgroud)
进入app.config但仍然没有运气(参见http://social.msdn.microsoft.com/Forums/en/msbuild/thread/d12f6301-85bf-4b9e-8e34-a06398a60df0和http://msdn.microsoft.com/ en-us/library/dd409252(VS.100).aspx)
我很确定这个问题来自visual studio或msbuild,因为我们的代码在prod时不会从网络共享运行,因为所有引用的dll都被复制到bin文件夹中.
如果有人有解决方案(或只是搜索路径的想法),请告诉我!
编辑:事实证明它在调试模式下工作,因为生成的序列化程序集已关闭.正如标题所说,它确实是一个SGEN问题,因为正是这个实用程序说路径不可信...
我使用visual studio 2010和.N ET 4.0创建了一个非常简单的窗口服务.
除了添加了安装程序之外,此服务没有从默认的Windows服务项目添加任何功能.
如果我在我的开发箱或我们域中的其他Windows 2008 R2计算机上运行"installutil.exe appName.exe",则Windows服务安装没有问题.
当我尝试在我们的客户站点上执行相同的操作时,它无法安装,并出现以下错误.
Microsoft (R) .NET Framework Installation utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Exception occurred while initializing the installation:
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\TestService\WindowsService1.exe' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515).
Run Code Online (Sandbox Code Playgroud)
此解决方案只有一个项目,并且没有添加依赖项.
我在我们环境中的多台机器上尝试过,在客户中尝试过两台.这些机器都是windows 2008 R2,都是全新安装.一台机器只有.net 2.0和.net 4.0.另一个.net 2,3,3.5和4.
我是每台机器上的本地管理员.
我也尝试了64位安装程序,但得到以下错误,所以我认为32位的是一个使用的.
System.BadImageFormatException
任何指导将不胜感激.谢谢.
我正在尝试在我的Visual Studio Web Express 2012中启用Code First.从我到目前为止所读到的内容,我必须使用Package Manager控制台和命令Enable-Migrations.当我这样做时,我得到以下错误.
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///E:\Working\wingtoysdl\C#\packages\EntityFramework.5
.0.0\tools\EntityFramework.PowerShell.Utility.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"
At E:\Working\wingtoysdl\C#\packages\EntityFramework.5.0.0\tools\EntityFramework.psm1:398 char:62
+ $utilityAssembly = [System.Reflection.Assembly]::LoadFrom <<<< ((Join-Path $toolsPath EntityFramework.PowerShell.Utility.dll))
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
You cannot call a method on a null-valued expression.
At E:\Working\wingtoysdl\C#\packages\EntityFramework.5.0.0\tools\EntityFramework.psm1:399 char:50
+ $dispatcher = $utilityAssembly.CreateInstance <<<< (
+ CategoryInfo : InvalidOperation: (CreateInstance:String) [], …Run Code Online (Sandbox Code Playgroud) 我正在尝试编辑devenv.exe.config来实现此处提供的解决方案.
因为我相信它将解决我在建立项目时遇到的问题.
但我不能编辑该文件,因为csrss.exe上有锁.重启没有帮助.这个exe是一个os级别的exe,我不能在没有删除操作系统的情况下杀死它.我不知道它对配置文件有什么锁定,因为没有vs工具正在运行.
我试图启动到安全模式,但一直无法启动.
任何帮助赞赏:)