Error: Unable to cast object of type 'System.Runtime.UnkownWrapper' to type 'Microsoft.VisualStudio.Shell.Interop.IVsHierarchy'

Topics: Service Factory Modeling Edition Forum
Mar 11, 2008 at 3:54 PM
Hi all, I'm struggling with the above mentioned error "Error: Unable to cast object of type 'System.Runtime.UnkownWrapper' to type 'Microsoft.VisualStudio.Shell.Interop.IVsHierarchy'" which occurs only in one of my projects when I try to add a primitive DataType to one of my Messages, to be more specific, the error occurs when I click on the "..." button to specify a other type than Sytem.String

Any theory's?

The only thing that is different from this project and the other projects that I have used with Service Factory, is that this project was stored in sourcesafe.....but I can't see how that could be a problem since i've got the whole thing checked out...?

Any help would be greatly appreciated

:-)

Thanx

ss
Developer
Mar 11, 2008 at 6:05 PM
Edited Mar 11, 2008 at 6:05 PM
Hi,
Let me ask you some questions to get more context;
  1. Is this a particular project type (I mean other that library, web or winform app) ?
  2. Are you running WSSF:ME 2005 or 2008?
  3. Do you have VS2005 and VS2008 installed on that machine?

Thanks,
CF
Mar 12, 2008 at 6:53 AM
Hi CF,

1. No, the project is a normal library
2. Well, the installation I used was "Service Factory - Binary Installer.zip runtime binary, 5523K, uploaded Nov 8 2007" or Web Service Software Factory: Modeling Edition – November 2007 for Visual Studio 2005
3. I guess this was answered in (2), but I'm using VS 2005 :P

any other info that can help, just ask :-)

this is already day 2 for me struggling with this problem

Thanx

ss


Mar 12, 2008 at 6:53 AM
Edited Mar 12, 2008 at 6:56 AM
(this post was removed because it was made by accident)
Mar 12, 2008 at 6:53 AM
Edited Mar 12, 2008 at 6:56 AM
(this post was removed because it was made by accident)
Developer
Mar 12, 2008 at 1:26 PM
Just to discard other things, did you try this scenario but with that project from outside source safe ? (unbinding). Becasuse we can't figure out what may have this project in particular other than the ss binding.
Mar 12, 2008 at 3:25 PM
Hi CF, yes, I have tried unbinding the project completely, but that didn't make any difference.

I have however found a way to work around the problem :

By creating a sub folder in the original project, and then creating a modeling project inside this folder that is completely independent from the project above, I built the whole model successfully in this new project.

Afterwards I simply added the "existing project" to the original project, and all the code could be generated from there.

When I try to edit the model from the original project, the same error occurs ONLY when I try to select a different primitive data type. BUT when I close the original project, and open the same model, but from the new project, the error seems to have disappeared.

This led me to believe that the problem must be with the project file itself, or the project mappings, somehow something got messed up.

Unfortunately too much work has already been done to start from scratch :-(

To give you more information, we are using WCL and Data Repository Factory as well, but I can't see how that could be related.

I don't think anymore that the problem lies with sourcesafe because the "new project" that I created to create the models is in sourcesafe as well now, and it is still working fine.


thanx

CF
Mar 12, 2008 at 3:25 PM
Edited Mar 12, 2008 at 3:27 PM
Hi CF, yes, I have tried unbinding the project completely, but that didn't make any difference.

I have however found a way to work around the problem :

By creating a sub folder in the original project, and then creating a modeling project inside this folder that is completely independent from the project above, I built the whole model successfully in this new project.

Afterwards I simply added the "existing project" to the original project, and all the code could be generated from there.

When I try to edit the model from the original project, the same error occurs ONLY when I try to select a different primitive data type. BUT when I close the original project, and open the same model, but from the new project's perspective, the error seems to have disappeared.

This led me to believe that the problem must be with the project file itself, or the project mappings, somehow something got messed up.

Unfortunately too much work has already been done to start from scratch :-(

To give you more information, we are using WCL and Data Repository Factory as well, but I can't see how that could be related.

I don't think anymore that the problem lies with sourcesafe because the "new project" that I created to create the models is in sourcesafe as well now, and it is still working fine.


thanx

ss
Developer
Mar 12, 2008 at 5:45 PM
I'm glad you could find a solution but there's still some details that confused me.
When you say "By creating a sub folder in the original project, and then creating a modeling project inside this folder that is completely independent from the project above" you are referring to a solution with a project inside and you added a new model project inside a solution folder?


Mar 13, 2008 at 8:30 AM
Well, not exactly, I created a completely new Solution, and recreated the model inside that solution. Afterwards I did a "add existing project" from my original solution to generate the code I needed. But as soon as I try and edit that same model again, but this time from the original solution's perspective, I get the same error again.....

ss
Developer
Mar 13, 2008 at 9:00 AM
Try checking in your solution that you dont' have a project other than libraries (dlls) and web apps or winform projects. Any other project type like a DB project may trigger this issue (already documented in the Known Issues document that will be updated soon).
Notice that tis issue was fioxed in the new version of WSSF:ME for VS2008.
Mar 13, 2008 at 12:28 PM
Ahhhh, I do have a report project that is also included in the solution....I'll check if that is the problem and note it back here in a while.
Mar 20, 2008 at 9:41 AM
Just to follow up, it turns out that you were right CF. The error stopped when I removed the reports-project from the solution, but notably I had to remove it from the project, a "unload" of the project caused a NotImplementedException to be thrown at the same place as the previous error.

Unfortunately we won't be migrating to VS2008 soon, so I'll just work around the problem.

Thanx again

ss