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 SettingsMarkLocal
SettingsApplication
DataMicrosoftVisualStudio9.0ProjectAssemliesj-wxrc_j01verysimpleeditor.dll.
Type B originates from
‘VerySimpleEditor, Version=1.0.0.0,
Culture=neutral, PublicToken=null’ in
the context ‘LoadNeither’ at location
C:Documents and SettingsMarkLocal
SettingsApplication
DataMicrosoftVisualStudio9.0ProjectAssemliesbkqrbe-r01VerySimpleEditor.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.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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.
Method 2
Try deleting both folders:
C:Documents and SettingsMarkLocal SettingsApplication DataMicrosoftVisualStudio9.0ProjectAssemliesj-wxrc_j01 C:Documents and SettingsMarkLocal SettingsApplication DataMicrosoftVisualStudio9.0ProjectAssemliesbkqrbe-r01
… and letting visual studio generates what it needs.
That worked for me.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0