none
Could not load file or assembly Interop.SHDocVw

    Question

  • I get the below error when loading the windows form designer in Visual Studio 2005. It only happens on forms that include an undocked MS word preview section.

    It worked fine when I had the project in VS2003.

    Has anyone had this problem before? Does anyone know how to fix it

    Cheers

    Paul.

     

     

    Could not load file or assembly 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    Hide    

    at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
    at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
    at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
    at System.Reflection.Assembly.Load(String assemblyString)
    at Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.GetAssembly(AssemblyName name, Boolean throwOnError)
    at Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.GetAssembly(AssemblyName name)
    at Microsoft.VisualStudio.Design.VSDynamicTypeService.OnAssemblyResolve(Object sender, ResolveEventArgs e)
    at System.AppDomain.OnAssemblyResolveEvent(String assemblyFullName)
    at AxSHDocVw.AxWebBrowser.AttachInterfaces()
    at System.Windows.Forms.AxHost.GetOcxCreate()
    at System.Windows.Forms.AxHost.set_Site(ISite value)
    at System.ComponentModel.Container.Add(IComponent component, String name)
    at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)
    at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
    at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.ComponentCodeDomSerializer.DeserializeInstance(IDesignerSerializationManager manager, Type type, Object[] parameters, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
    at System.ComponentModel.Design.Serialization.CodeDomSerializer.DeserializeStatementToInstance(IDesignerSerializationManager manager, CodeStatement statement)
    at System.ComponentModel.Design.Serialization.CodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)
    at System.Windows.Forms.Design.ControlCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, Object codeObject)
    at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.DeserializeName(IDesignerSerializationManager manager, String name, CodeStatementCollection statements)

     

     

    Tuesday, January 24, 2006 11:22 PM

Answers

  • I found out what is causing the error.

    It is because there is a different wrapper around DLLs in VS2005, so what you need to do to fix it is remove all references from your project of AxInterop.ShDocVw.dll, and Interop.ShDocvw.dll. Then you need to go into your project's bin directory and delete the Interop.ShDocvw.dll and AxInterop.ShDocVw.dll.

    Then go into the windows/system32 directory and copy the ShDocVw.dll into your project's bin directory.

    Then, in your project, add a reference to this. It will put a new wrapper around it which is compatable with VS2005.

    Then close all forms you have open in your project, rebuild your project, and it should work fine.

    Friday, February 17, 2006 1:16 AM
  • Oh, and I forgot to say, you also need go go into your windows form designer generated code and replace a few lines of code to reference the correct classes of the new assemblies.

    They should all be shown as warnings, so just go through them all, delete the old line, and use the VS2005 intellisense (and error correction suggestions) to find the correct assembly class to use.

    Then, you should be able to say cool bananas.

    Friday, February 17, 2006 2:05 AM

All replies

  • I'm getting a similar error on the Interop.SHDocVw assembly - I'm using the band object project for the IE toolbar and this worked well in VS 2003.  After upgrade to VS 2005 I get the error.

    Tony

     

    • Proposed as answer by JonIFG Monday, June 17, 2013 8:10 PM
    Tuesday, February 07, 2006 4:48 AM
  • I found out what is causing the error.

    It is because there is a different wrapper around DLLs in VS2005, so what you need to do to fix it is remove all references from your project of AxInterop.ShDocVw.dll, and Interop.ShDocvw.dll. Then you need to go into your project's bin directory and delete the Interop.ShDocvw.dll and AxInterop.ShDocVw.dll.

    Then go into the windows/system32 directory and copy the ShDocVw.dll into your project's bin directory.

    Then, in your project, add a reference to this. It will put a new wrapper around it which is compatable with VS2005.

    Then close all forms you have open in your project, rebuild your project, and it should work fine.

    Friday, February 17, 2006 1:16 AM
  • Oh, and I forgot to say, you also need go go into your windows form designer generated code and replace a few lines of code to reference the correct classes of the new assemblies.

    They should all be shown as warnings, so just go through them all, delete the old line, and use the VS2005 intellisense (and error correction suggestions) to find the correct assembly class to use.

    Then, you should be able to say cool bananas.

    Friday, February 17, 2006 2:05 AM
  • hi,

    i did as you told.but i got the error "the dll donot have the strong name".then using tlbimp command i convert it into dotnet assembly.but still the view of the toolbar is not coming.but it is not showing error when i build the project.i pasted the error code also.

     

    Could not load file or assembly 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=e202f0c2eaf9625d' or one of its dependencies. The system cannot find the file specified.
    Hide    

    at System.Signature._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle)
    at System.Signature.GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, RuntimeFieldHandle fieldHandle, RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle)
    at System.Signature..ctor(RuntimeFieldHandle fieldHandle, RuntimeTypeHandle declaringTypeHandle)
    at System.Reflection.RtFieldInfo.get_FieldType()
    at System.ComponentModel.Design.InheritanceService.AddInheritedComponents(Type type, IComponent component, IContainer container)
    at System.Windows.Forms.Design.DocumentDesigner.Initialize(IComponent component)
    at System.ComponentModel.Design.DesignerHost.AddToContainerPostProcess(IComponent component, String name, IContainer containerToAddTo)
    at System.ComponentModel.Design.DesignerHost.Add(IComponent component, String name)
    at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.IDesignerHost.CreateComponent(Type componentType, String name)
    at System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.CreateInstance(Type type, ICollection arguments, String name, Boolean addToContainer)
    at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
    at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
    at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)

    Tuesday, March 14, 2006 6:25 AM
  • Thats just a "Could not find the file" error.

    You should check to make sure you copied the dll files into the correct directory, and that all the old references have been replaced by the new ones.

    It can be a bit of a tedious task, but you need to be meticulous and make sure that there are none of the references to the old DLLs left..

    Monday, March 20, 2006 9:11 PM
  • Above solutions did not worked for me. I found correct solution.

    Delete all shdocvw.dll references from your project. Instead of adding reference to shdocvw.dll, add control for Microsoft Web Browser control in toolbar of Visual Studio 2005. It can be found on COM Components tab of Choose Toolbox Items. After that create a temporary form and drag this control on that form. It will automatically add reference to AxWebBrowser.dll interop assembly. Remove temporary form for your project. Close all forms and rebuild your solution.

    • Proposed as answer by Jasper paul Wednesday, April 13, 2011 12:28 PM
    • Unproposed as answer by Jasper paul Wednesday, April 13, 2011 12:28 PM
    • Proposed as answer by MS Tech Live Saturday, August 06, 2011 7:40 PM
    Wednesday, April 05, 2006 2:15 PM
  • I fix this problem by replacing solution directory to another folder.
    Monday, April 10, 2006 11:00 AM
  • I was getting this error from a thrid party COM control I was using.  It appears that if I had the form containing the control open when I closed VS 2005, when I reopened the project it would have a problem finding the .DLL.

    I've avoided the problem by closing the "offending" form before I close VS 2005.  Opening it once VS 2005 has completed loading the project works just fine.

    Carl

    Thursday, December 21, 2006 8:58 PM
  • I don't fix because vs 2008 want to copy this file on current project directory
    Please help me!
    Friday, March 27, 2009 4:09 PM
  • @Shabdar: Perfect.. Thanks a lot. I am on the verge of converting a VB6 project to VB.net and was stuck in this part of converting the AxWebBrowser because VS 2008 does not convert into the AxWebBrowser rather converts into the .Net WebBrowser. Hence there were functionalities which I couldn't port into vb.net (specially the BeforeNavigate2 event, wonder why it is not supported in another form..). 
    Wednesday, April 13, 2011 12:05 PM
  • I got this exact same error when using ShareVis Designer and Microsoft InfoPath. I was trying to upload a specific form created in InfoPath to our SharePoint site using ShareVis Designer. I had just sucessfully uploaded the form a couple of hours ago, came back and promoted a field to be used as conditional routing and such... after the field was promoted, it caused this error when I then tried to upload the form. The problem came down to what the field was named. Apparently there is a "hot" list of words that CANNOT be used as names of fields if you want them to be promoted fields. Simple naming conflict.
    Thursday, March 15, 2012 8:07 PM
  • This was more than six years ago, but for those having this problem with VS2010, this solution still works. I had looked all over the place and was wracking my brain and this solved it.

    • Edited by Tyress Tuesday, September 18, 2012 6:26 AM
    Tuesday, September 18, 2012 6:25 AM