Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
335 views
in Technique[技术] by (71.8m points)

asp.net mvc - Could not load file or assembly HRESULT: 0x80131515 (When adding controller to MVC project that has assembly references on network drive)

I've seen this: VSTS 2010 SGEN : error : Could not load file or assembly (Exception from HRESULT: 0x80131515) and none of the answers work. It also doesn't appear when I build or anything. I can run the project fine, it happens when I try to add an entity framework templated controller:

controller settings

Then I get this error:

error message

All project files are on my network share because that is where My Documents resides for our work. Here is what I tried:

1) Turning Generator Serialization Assembly in project settings to on, off, and auto.

2) Adding sgen.exe.config to C:Program FilesMicrosoft SDKsWindowsv7.0AinNETFX 4.0 Tools with the following code:

<configuration>
 <runtime>
   <loadFromRemoteSources enabled="true" />
 </runtime>
</configuration>

3) Tried to unblock the assemblies, but I had no unblock option in the properties tab. no unblock option

None of these solutions work. Does anyone have any idea how I can fix this??? This error occurs for any custom assembly from nuget or my own projects due to their location existing on the network space, but only when trying to add an EF templated controller. I can build and run the program fine.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I just needed to click "Unblock" in the file properties dialog in Windows Explorer.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...