Getting an error Cannot resolve dependency to assembly System.Web

青春壹個敷衍的年華 提交于 2020-01-30 08:12:05

问题


I had to have my primary HD replaced. Yesterday my HD was replaced by our IT tech staff. So today, after installing VS 2015, I started working on a WPF app we've been working on. I got into the project, did a Get Latest from TFS and did a build. I failed with the following error:

Cannot resolve dependency to assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.

First of all, I've no idea why we even need System.Web. Secondly, it isn't in the references of any project in the solution. I know, I've looked, but in VS 2015 AND opening the .csproj files directly. So, what is trying to use it? What needs it? At this point I'm about ready to add it for no other reason then just to make it build.


回答1:


why we even need System.Web. Secondly, it isn't in the references of any project in the solution. I know, I've looked, but in VS 2015 AND opening the .csproj files directly. So, what is trying to use it? What needs it?

System.Web.Dll is old library responsible for whole http-protocol working. requests sending and creation. And you can find the system.web is member of system:

Besides, we can find the detail build log in the Visual studio Output, the system should be loaded, so if that assembly is missing or it is with a different version compared with the other referenced binaries, the assembly could not be loaded.

To resolve this issue, you could add it or create a new project with Visual Studio 2015 and copy the source files into this project. Then rebuild it, check if it works.

Hope those can help you.



来源:https://stackoverflow.com/questions/42681599/getting-an-error-cannot-resolve-dependency-to-assembly-system-web

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!