当我使用命令行构建C#/ .NET时,如何设置配置?

当我的程序试图访问网络驱动器中的DLL时,我收到此错误消息。

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'file:///Z:\smcho\works\tasks\2011\ni\ng_fpgabackend\myclass.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load maybe dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information. 

在链接之后 ,我得到了这个信息,我需要这个配置。

      

如何将此配置信息用于什么? 我使用Visual Studio 2010,但我没有使用Visual Studio IDE,只是有一个简单的批处理文件来构建C#代码。

添加

我发现这个站点使用App.config,我认为可能无法使用命令行构建方法。

鉴于您的输出文件是foo.exe。 创建foo.exe.config,将其复制到foo.exe旁边并将其放入其中:

      

你试过AllowPartiallyTrustedCallers吗?