Why does this reqpro40.applicationclass creation instance fail?

I am trying to open a ReqPro project from C # class code. Next steps:

  • Add link to ReqPro.dll (COM extensibility DLL)
  • Create the type ReqPro40.Application and get an instance of ReqPro40.ApplicationClass, for example:

    ReqPro40.Application appReqPro = new ApplicationClass(); ReqPro40.Project prjReqPro; prjReqPro = appReqPro.OpenProject(@"D:\MyReqPro\MyReqPro.rqs", ReqPro40.enumOpenProjectOptions.eOpenProjOpt_RQSFile, "admin", "admin", ReqPro40.enumProjectFlags.eProjFlag_Normal, ReqPro40.enumRelatedProjectOptions.eRelatedProjOption_ConnectNone); 

The code compiles well, but when I run it (I wrote a simple Unit test), it doesn't say "Could not load file or assembly 'Interop.ReqPro40, Version=1.10.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.":"Interop.ReqPro40, Version=1.10.0.0, Culture=neutral, PublicKeyToken=null" .

Update1:

I tried it on my laptop and everything worked out fine. I have ReqPro installed on my laptop. But it does not work on the server (Windows 2008 Enterprise). I connect to the server using a remote connection. Any clue?

Reward Update

I will expect some working code with steps to recreate.

+4
source share
1 answer

Please check on the server that ReqPro.dll is located in the root folder, sometimes the referencing dll does not copy to the bin folder. You can also specify the "Probing" element in your app.config file to specify the subfolders that the CLR can search to find a reference assembly if it cannot find the assembly.

 <configuration> <runtime> <assemblyBinding xmlns="urn:schmas-AWorks-cam:asm.v1"> <probling privatePath="bin\Ordersbin;Extbin"/> </assemblyBinding> </runtime> </configuration> 

Update: If you no longer offer to use the installation project to install your project, this ensures that all third-party DLL files automatically copied to the root folder are installed.

+2
source

All Articles