Link to home
Start Free TrialLog in
Avatar of TelDig
TelDigFlag for Canada

asked on

C++ (VC6.0) C# .NET 1.1, Cannot create instance, class not registred (network drive)

Our c++ application start but when it create the instance of the .net assembly, We get the errors message:  "Cannot create instance / class not registred".

- This only append when the application is run from a network drive
- The application run fine if we run a copy from a local drive.  (on the same machine of course)
- We have created a simple dialog .net 1.1 application and it run fine from the share (.net security configured)
- The com object is not signed/strong key and not registred (assembly cache...)
- The application is a VC6 .exe and call a .net 1.1 dll  (COM)

Our Diagnostic:
1- We guess that it work on a local drive because if the com is'nt found as registered, the system seek in the exe path but when we run it from network drive the system doesn't look in the exe.path
2- Currently the only solution we have found that might work is to sign the .net assembly and add it to the gac but this solution will force us to create an installer or registery process that we would like to avoid.

The Question:
Is our diagnostic are good and is there another solution to fix the issue?
Is there a way to force checking in the network path to find the COM object
//Code that load the assembly from our c++ app:
HRESULT hRes = eventSystem.CreateInstance(EventSystemRemotingWrapper::CLSID_MyEventSystem);
   m_bInstanceCreated = true;
//.Net assembly
   public interface IMyEventSystem
      void InitializeWrapper(string remoteObjectURI, string applicationName);
      bool OpenApplication(string pathTo, string argument);
      void SendEvent(string eventId, string eventInfo, string destination);
      void RegisterEvent(string eventId);
      void UnRegisterAllEvents();
      void UnRegisterEvent(string eventId);
      void SetEventSink(IEventSystemSink eventSink);
      int GetRemotingPortUsed();
      string GetTemporaryFolder(bool generateUniqueFilename, string extension);
      string SendEvent(string eventId, string eventInfo, string destination, bool waitForReturn);
      bool OpenApplicationSilent(string pathToCMS, string argument);
   /// <summary>
   /// Summary description for CMSCommunication.
   /// </summary>
   public class TelDigEventSystem : ITelDigEventSystem

Open in new window

Avatar of PlatoConsultant
Flag of United States of America image

in my view .net security configuration problem

Since network shares by default only get LocalIntranet permissions, it's relatively common to want to use CasPol to fully trust some shares that you control and know are safe.  However, CasPol syntax being what it is, the command to do this isn't immediately obvious.  If I wanted to trust everything on the share \\ShawnFa-Srv\Tools, the command:
Avatar of nsanga

can you try registering the com object ( which is actually a .net dll) in the machine where you are running the application and try again.

Avatar of TelDig


PlatoConsultant: if we have a simple dialog app in the share, this app work fine and CasPol was previously runned on that share.

Nsanga: Currently this dll cannot be registred, and neither put in assembly cache, my coworker tryed to give him a strong name and put it in the assembly but didn't work either.
when a application is executed from a share, the required things are copied into local machine and it is executed.

And so if the application is trying to instantiate a COM object, it will try to get the COM object details from registry which it could not get them as the COM object is not registered in local machine.

I would suggest you to first register the COM object in and then try.
Avatar of TelDig


And how can we explain that it work if the content of the share is copied on the local drive? The COM object is not registred either!
We will try to modify the COM object to be registred on monday, but still found strange the current behavior.

Avatar of TelDig
Flag of Canada image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial