呈现控件出错 - [A]不能转换为[B]在上下文LoadNeither [英] Error Rendering control - [A] cannot be cast to [B] in the context LoadNeither

查看:1170
本文介绍了呈现控件出错 - [A]不能转换为[B]在上下文LoadNeither的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的复合控制,这需要我打开多个Visual Studio的集成开发环境,并添加页面的控制。

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

这导致Visual Studio来创建多个组件。

This causes Visual Studio to create multiple assemblies.

所以每次出现这种情况我关闭所有IDE和删除文件夹ProjectAssemblies时间。

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...

更新:

特定的错误是:

未处理的异常已发生。
  [A] VerySimpleEditor.Toolbars不能
  转换为[B] VerySimpleEditor.ToolBars。
  类型从起源
  VerySimpleEditor,版本= 1.0.0.0,
  文化=中立,PublicToken = NULL'的
  在位置上下文LoadNeither
  C:\\ Documents和Settings \\马克\\本地
  设置\\应用
  数据\\微软\\ VisualStudio的\\ 9.0 \\ ProjectAssemlies \\ J-wxrc_j01 \\ verysimpleeditor.dll。
  B型从起源
  VerySimpleEditor,版本= 1.0.0.0,
  文化=中立,PublicToken = NULL'的
  在位置上下文LoadNeither
  C:\\ Documents和Settings \\马克\\本地
  设置\\应用
  数据\\微软\\ VisualStudio的\\ 9.0 \\ ProjectAssemlies \\ bkqrbe-R01 \\ VerySimpleEditor.dll。

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.

当我试试投这样的:

 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和添加控件的页面,它的工作原理。

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.

推荐答案

为了使这项工作,你需要把控制项目,并在两个不同的解决方案的测试项目。问题是独一无二的,你必须要调试的Visual Studio的另一个运行实例的问题。你会看到这个<一个href=\"http://www.paraesthesia.com/archive/2009/11/03/debugging-visual-studio-add-ins-and-xmlserialization-problems.aspx\"相对=nofollow>如果您在Visual Studio的插件工作了。

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.

这篇关于呈现控件出错 - [A]不能转换为[B]在上下文LoadNeither的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆