我已经从某个路径,像这样加载程序集的一些C#代码:如何解决在Visual Studio CA 1009警告
assembly = System.Reflection.Assembly.LoadFrom(assemblyPath);
当我编译时,Visual Studio代码分析抛出这个warning:
warning : CA2001 : Microsoft.Reliability : Remove the call to Assembly.LoadFrom ...
我正在寻找解决此警告(而不是压制它)的方法。是否有替代LoadFrom
这样做对我来说(我知道LoadFile
isn't it)?
[MSDN](http://msdn.microsoft.com/en-us/library/x4cw969y.aspx)说:“不要使用''AssemblyName'只有'CodeBase'属性集。“如果你想避免这个警告,你应该明确地用'[SuppressMessage]'来禁止它,而不是围绕FxCop工作。 –