Fyter的博客

技术资讯 源码共享

VS编译共享目录中的项目

有时我们需要在一台电脑打开项目共享,在另一台电脑打开项目编译,但是编译时VS2010(Visual Studio 2010)/VSE(Visual Studio Express)会产生这样一条错误:

Error Could not load the assembly file://\\****.dll. This assembly may have been downloaded from the Web.  If an assembly has been downloaded from the Web, it is flagged by Windows as being a Web file, even if it resides on the local computer. This may prevent it from being used in your project. You can change this designation by changing the file properties. Only unblock assemblies that you trust. See http://go.microsoft.com/fwlink/?LinkId=179545 for more information.

解决办法是:在VS的IDE安装目录中找到devenv.exe.config,与VPDExpress.exe.config(如果安装Express版),用xml编辑工具打开(包括记事本),在其中找到<runtime>节点,添加如下子节点(编辑工具需要有管理员权限):

        <loadFromRemoteSources enabled="true"/>

添加后类似这样:

image

再启动VS/VSE就可以像本地项目一样进行工作了。

Loading