开发者

Why this instance creation of reqpro40.applicationclass fails?

I am trying to open a ReqPro project from c# class code. The steps followed are:

  1. Add reference to ReqPro.dll (the extensibility COM dll)
  2. 开发者_JAVA技巧

    Create a type of ReqPro40.Application and have an instance of ReqPro40.ApplicationClass like:

    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 run (I wrote a simple Unit test), it fails saying "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 it worked 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 remote connection. Any clue?

Update for bounty

I shall expect some working code with steps to recreate.


Please check on the server that the ReqPro.dll is in the root folder, sometimes the referenced dll's dont copy to the bin folder. You can also specify a "Probing" element in your app.config file to specify subfolders that the CLR can search to locate a referenced 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 arn't already I would suggest you use a Setup Project to Install your Project, this will make sure any 3rd party dlls, automatically get copied to the root folder were the application is installed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜