System.TypeLoadException with multiple projects in solution

我们两清 提交于 2019-12-11 06:39:51

问题


I have created a VS2008 solution with 3 projects in it (Class Library, Windows Application, and Web Application). I am using objects that I define in the Class Library in both the Windows application and the web application. This works great for the Windows application, but when I go to create an object in the code behind of a web page, I get a System.TypeLoadException:

Could not load type 'Nutz.MusicMaster.Song' from assembly 'Nutz, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.TypeLoadException: Could not load type 'Nutz.MusicMaster.Song' from assembly 'Nutz, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

I added the class library to the references in both the windows app and the web app (Right click on References -> Add Reference -> Projects).

Any ideas on what is causing this would be greatly appreciated! Thanks! Nutzy


回答1:


I was able to solve this problem by creating a new solution and adding all of my existing classes, pages, and controls to it.



来源:https://stackoverflow.com/questions/1344297/system-typeloadexception-with-multiple-projects-in-solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!