5

我正在开发一个复合控件,这需要我打开多个 Visual Studio IDE 并在页面上添加控件。

这会导致 Visual Studio 创建多个程序集。

所以每次发生这种情况时,我都会关闭所有 IDE,并删除 ProjectAssemblies 文件夹。

这一切都可以避免吗?这样的工作太难了……

更新:

具体错误是:

发生了未处理的异常。[A]VerySimpleEditor.Toolbars 不能转换为 [B]VerySimpleEditor.ToolBars。类型 A 源自位置 C:\Documents and Settings\Mark\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ 上下文“LoadNeither”中的“VerySimpleEditor, Version=1.0.0.0, Culture=neutral,PublicToken=null” ProjectAssemlies\j-wxrc_j01\verysimpleeditor.dll。类型 B 源自位置 C:\Documents and Settings\Mark\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ 上下文 'LoadNeither' 中的 'VerySimpleEditor, Version=1.0.0.0, Culture=neutral, PublicToken=null' ProjectAssemlies\bkqrbe-r01\VerySimpleEditor.dll。

当我尝试像这样投射时:

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

 }

控件项目(dll)和网站项目在一个解决方案中,我将控件从工具箱拖到网页,重新编译控件后。
每当我重新编译控件并将其添加到页面时,都会发生此错误,当我重新启动 Visual Studio 并添加控件时,它就可以工作。

4

2 回答 2

2

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.

于 2009-12-04T16:26:51.990 回答
2

尝试删除两个文件夹:

C:\Documents and Settings\Mark\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemlies\j-wxrc_j01    
C:\Documents and Settings\Mark\Local Settings\Application Data\Microsoft\VisualStudio\9.0\ProjectAssemlies\bkqrbe-r01

...并让视觉工作室生成它需要的东西。

这对我有用。

于 2013-06-13T19:57:38.003 回答