none
引用不了Dll RRS feed

  • 问题

  • 在vs2010中打开一个项目,需要引用一个dll,我把奋力从网上也下载了,在项目中也能引此dll,重新生成

    项目失败,提示信息

    错误 56 “ValidateXaml”任务意外失败。
    System.IO.FileLoadException: 未能加载文件或程序集“file:///C:\Users\hongfu\Desktop\SilverlightFileUploadSrc\FileUpload\FJ.Core.dll”或它的某一个依赖项。不支持操作。 (异常来自 HRESULT:0x80131515)
    文件名:“file:///C:\Users\hongfu\Desktop\SilverlightFileUploadSrc\FileUpload\FJ.Core.dll” ---> System.NotSupportedException: 尝试从一个网络位置加载程序集,在早期版本的 .NET Framework 中,这会导致对该程序集进行沙盒处理。此发行版的 .NET Framework 默认情况下不启用 CAS 策略,因此,此加载可能会很危险。如果此加载不是要对程序集进行沙盒处理,请启用 loadFromRemoteSources 开关。有关详细信息,请参见 http://go.microsoft.com/fwlink/?LinkId=155569

       在 System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       在 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       在 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       在 System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
       在 System.Reflection.Assembly.LoadFrom(String assemblyFile)
       在 Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
       在 Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
       在 Microsoft.Silverlight.Build.Tasks.ValidateXaml.Execute()
       在 Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       在 Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__1c.MoveNext()

     FileUpload


    windows live Id :hellohongfu@hotmail.com

    2012年4月2日 5:58

答案

全部回复