RegAsm failing for a .NET 4.0 assembly using Microsoft.Bcl.Async

后端 未结 1 1926
不知归路
不知归路 2020-12-19 16:55

RegAsm failing for a .NET 4.0 assembly using Microsoft.Bcl.Async with the following message:

RegAsm : error RA0000 : Could not load file or assembly          


        
1条回答
  •  悲哀的现实
    2020-12-19 17:34

    The solution I have come up with is a hack:

    • copied RegAsm.exe and RegAsm.exe.config from C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe to a local folder where MyAssembly.dll is;

    • edited RegAsm.exe.config to look like this:

    
    
        
            
            
        
    
      
        
          
            
            
          
          
            
            
          
          
            
            
          
        
      
    
    
    
    • now, running RegAsm.exe /codebase MyAssembly.dll works fine as expected.

    Interestingly, useLegacyV2RuntimeActivationPolicy="true" has already been there in the standard RegAsm.exe.config, but alone it did not help.

    I think this is the same bug reported here: https://connect.microsoft.com/VisualStudio/feedback/details/789318/asyncpack-system-io-fileloadexception-could-not-load-file-or-assembly-system-threading-tasks-version-1-5-11-0.

    0 讨论(0)
提交回复
热议问题