locked
Need help understanding whats going on RRS feed

  • Question

  • Sorry if this is clear as mud, but thats how it is in my mind right now.

    I have an sdk for an application that was written to be used with .NET2003. I only have that .Net studio on my laptop, so I loaded a template into c# 2003 and saved the project. Then I imported the priject into c# 2010 Express. Everything is working on my laptop. The I moved the 2010 project to my Desktop. The project is now broken. The reference com object did not get imported with the project and when I try to reference it I get a "Type or Namespace cannot be found" even though the com object is listed in the reference wizard listbox. I'm wondering if the interop is somehow messed up or maybe something with global cache. Please help if you have any ideas. I know just enough to be getting frustrated. Thanks!

    Tuesday, May 10, 2011 2:04 PM

Answers

  • Another clue. I gopgled the last error. And read this: http://blogs.msdn.com/b/mshneer/archive/2009/12/07/interop-type-xxx-cannot-be-embedded-use-the-applicable-interface-instead.aspx.

    I took off the class part, using the interface only, The application compiled but would not register with the host application. However, even though it would not register with the host applcation, the Host application recognized the guid evidently and linked to the project dll. Events are actually firing. I'm wondering what errors I'm going to get down the road as I develop the project and what kind of issues are going to be present at deployment=/ Still wanting all your thought! Thanks.

    • Marked as answer by progmgp Tuesday, May 10, 2011 9:12 PM
    Tuesday, May 10, 2011 3:34 PM

All replies

  • What Windows version is on the desktop? Is it Windows 7 or Vista x64, by any chance?

    If so, your problem could be that the VS 2010 project targets "Any CPU" on the 64 bit OS, and you need to change the target to x86.

     

    Tuesday, May 10, 2011 2:19 PM
  • Thanks for the response, Its XP pro on both the laptop and the desktop.
    Tuesday, May 10, 2011 2:50 PM
  • Oh, and neither are 64bit
    Tuesday, May 10, 2011 2:50 PM
  • One other note: When I look at the properties window of the referenced com object, the Path box is empty, even though I have also added the reference by browsing to it.
    Tuesday, May 10, 2011 2:55 PM
  • another clue, I just used tlbimp on the com object. The project now sees the com object but I get the following error.. "Interop type cannot be embedded, use the application interface". And the following warning.."Cannot find wrapper assembly for type library". However, I now have a path the the com object in its properties Path box and no yellow exclamation mark.
    Tuesday, May 10, 2011 3:19 PM
  • Another clue. I gopgled the last error. And read this: http://blogs.msdn.com/b/mshneer/archive/2009/12/07/interop-type-xxx-cannot-be-embedded-use-the-applicable-interface-instead.aspx.

    I took off the class part, using the interface only, The application compiled but would not register with the host application. However, even though it would not register with the host applcation, the Host application recognized the guid evidently and linked to the project dll. Events are actually firing. I'm wondering what errors I'm going to get down the road as I develop the project and what kind of issues are going to be present at deployment=/ Still wanting all your thought! Thanks.

    • Marked as answer by progmgp Tuesday, May 10, 2011 9:12 PM
    Tuesday, May 10, 2011 3:34 PM