RegAsm error RA0000 Could not load file or assembly on Network Drive

StackOverflow https://stackoverflow.com/questions/21199126

  •  29-09-2022
  •  | 
  •  

سؤال

I experience a problem using a batch file to call Regasm on framework 4 on a network drive. It works correctly when the dll is on a local drive.

The message is Could not load file or assembly filename.dll or one of its dependencies. Operation is not supported.

The problem is discussed here ad "Darrens Developer Diary"

however editing the config as described does not help

I also tried the advice here which differs in the line

<loadFromRemoteSources="true"/>   

with this I received a different error "The system cannot execute the specified program"

The DLL used to use Framework 2, but I unregistered it using Framework 2 Regasm.

Here is the regasm.exe.config

<?xml version ="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
    <requiredRuntime safemode="true" imageVersion="v4.0.30319" version="v4.0.30319"/>
    <supportedRuntime version="v4.0" sku="client" />
</startup>
<runtime> 
    <loadfromremotesources enabled="true"> </loadfromremotesources>
</runtime> 
</configuration>

Here is the command in my batch file

Z:
cd foldername
c:\WINDOWS\Microsoft.Net\Framework\v4.0.30319/regasm /verbose /codebase /tlb: .\SBD.CommBridge.tlb .\SBD.ComBridge.dll 
هل كانت مفيدة؟

المحلول

The correct line in regasm.exe.config is

 <loadFromRemoteSources enabled="true"/>

the case matters

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top