Thursday, March 15, 2007

Could not load file or assembly 'stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

Could not load file or assembly 'stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

We developed windows application using FrameWork2.0. It was working fine in the development system. When we installed in the production system which does not have VS2005. We got the above mentioned error. We access com component for getting the image file from the webcamera. It was suprising the framework 2.0 was perfectly installed.

The issue was The stdole.dll is installed in GAC and is not bundled through application setup. When we access image through our application, the interop dll (stdole.dll) is required. Interesting thing is the stdole.dll is not installed along with the framework 2.0 and is not available in GAC of production system.

To resolve, we updated the setup project to have stdole.dll as private assembly. The file was referenced in the file section of setup project from

C:\Program Files\Microsoft.NET\Primary Interop Assemblies

To make sure that that stdole.dll has to be accessed from the current folder instead of GAC. Right click on the stdole.dll in the reference section of project and select local copy true. By default it will be false.

No comments: