相关疑难解决方法(0)

无法加载文件或程序集HRESULT:0x80131515(将控制器添加到在网络驱动器上具有程序集引用的MVC项目时)

我已经看到了这个:VSTS 2010 SGEN:错误:无法加载文件或程序集(HRESULT的异常:0x80131515)并且没有任何答案有效.当我构建或任何东西时它也不会出现.我可以运行该项目,当我尝试添加一个实体框架模板控制器时会发生这种情况:

控制器设置

然后我收到这个错误:

错误信息

所有项目文件都在我的网络共享上,因为这是我的文档所在的工作所在.这是我尝试过的:

1)将项目设置中的发电机序列化装配转为开,关和自动.

2)使用以下代码将sgen.exe.config添加到C:\ Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0工具:

<configuration>
 <runtime>
   <loadFromRemoteSources enabled="true" />
 </runtime>
</configuration>
Run Code Online (Sandbox Code Playgroud)

3)尝试取消阻止程序集,但我在属性选项卡中没有取消阻止选项. 没有解锁选项

这些解决方案都不起作用.有谁知道如何解决这个问题??? 对于来自nuget或我自己的项目的任何自定义程序集,由于它们在网络空间中的位置而发生此错误,但仅在尝试添加EF模板控制器时发生.我可以构建并运行程序.

asp.net-mvc assemblies visual-studio-2010 .net-assembly

72
推荐指数
6
解决办法
9万
查看次数

ef添加迁移出错

我有几个类文件.但是现在我添加了新的模型类并尝试键入add-migration InitialCreate.但是我收到以下错误.

PM> add-migration InitialCreate
Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///C:\Users\user\Documents\Visual Studio 2013\Pro
jects\DigitalHealthWebPrev\packages\EntityFramework.6.1.3\tools\EntityFramework.PowerShell.Utility.dll' or one of its dependencies. Operati
on is not supported. (Exception from HRESULT: 0x80131515)"
At C:\Users\user\Documents\Visual Studio 2013\Projects\DigitalHealthWebPrev\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:780 c
har: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 C:\Users\user\Documents\Visual Studio 2013\Projects\DigitalHealthWebPrev\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:781 c
har:50
+     $dispatcher = $utilityAssembly.CreateInstance <<<< …
Run Code Online (Sandbox Code Playgroud)

entity-framework ef-migrations asp.net-mvc-5

14
推荐指数
3
解决办法
9873
查看次数