views:

330

answers:

2

I am working on a composite control and this requires me to open multiple Visual studio IDEs and add the control on pages.

This causes Visual Studio to create multiple assemblies.

So every time this happens I close all IDEs, and delete ProjectAssemblies folder.

Can all this be avoided? It's very hard to work like that...

UPDATE:

The specific error is:

An unhandled exception has occured. [A]VerySimpleEditor.Toolbars cannot be cast to [B]VerySimpleEditor.ToolBars. Type A originates from 'VerySimpleEditor, Version=1.0.0.0, Culture=neutral,PublicToken=null' in the context 'LoadNeither' at location C:\Documents and Settings\Mark\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemlies\j-wxrc_j01\verysimpleeditor.dll. Type B originates from 'VerySimpleEditor, Version=1.0.0.0, Culture=neutral, PublicToken=null' in the context 'LoadNeither' at location C:\Documents and Settings\Mark\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemlies\bkqrbe-r01\VerySimpleEditor.dll.

When I try try to cast like this:

 using (System.IO.Stream textReader = typeof(TheEditor).Assembly.GetManifestResourceStream("VerySimpleEditor.Toolbar.xml"))
 {
         XmlSerializer deserializer = new XmlSerializer(typeof(ToolBars));
         ToolBars ob = (ToolBars)deserializer.Deserialize(textReader);

 }

The Control project (dll) and web site project are in one solution, i drag the control from toolbox to the webpage, after re-compiling control.
Any time I recompile control and add it to the page this error occurs, when I restart Visual studio and add the control, it works.

A: 

In order to make this work you'll need to put the control project and the test project in two different solutions. The problem is unique to issues where you have to debug another running instance of Visual Studio. You'll see this if you work on Visual Studio add-ins, too.

Travis Illig
thanks for your replay, I tried it also with 2 different solutions. same result!
markiz
Unfortunately, there's no formulaic solution to your problem. You need to try a few things. The first step is getting the control and the test project in two separate solutions. After that, if it doesn't work, it's going to be "look at the new exception you're getting and continue trying new things." For a VS add-in, it's Visual Studio doing the loading, not a solution/test project, so all you have to do is not load up the add-in solution. For other project types you may need to do a little more work. Try changing build output/reference locations on your test project.
Travis Illig
A: 

Maybe in the toolbox VS load the control's dll.when load the WebPage that include the control.VS Load the control's dll again. it add two times for the same dll. I Guess, it's crazy.too bad.

x16man