我有一个带有outputType库的ASP.NET项目,我需要运行该项目,但它没有运行。我应该使用什么outputType来运行我的项目?
答案 0 :(得分:3)
In order to fix the above error, right click the Solution name in Visual
Studio 2005/2008 and select Set as StartUp Project option from the popup menu.
来源:Fix: A project with an Output type of Class Library cannot be started directly
答案 1 :(得分:1)
尽管ASP.NET
项目具有Class Library
类型,但Visual Studio可以“运行”这些类型的项目(它将项目的输出部署到IIS或dev服务器并启动web-app)。
因此,要解决您的问题,您应该以某种方式告诉Visual Studio您的项目是ASP.NET项目。我明白了:
1-one one-fast,straighforward,dumb,但可靠 :在visual studio中创建新的“ASP.NET Web应用程序”项目并将所有源代码复制到它。
2-nd - 不确定它是否有效,但更加黑客和有趣:在文本编辑器中打开YourProject.csproj文件,将<ProjectTypeGuids ...>
部分替换为这样的部分,可以在ASP.NET项目的csproj文件中找到。
答案 2 :(得分:0)
无法运行类库项目,您可以调试它们。见Debugging DLL Projects
答案 3 :(得分:0)
无法直接启动输出类型为Library的项目。要调试此项目,请将可执行项目添加到此解决方案中,该项目引用库项目。将可执行项目设置为启动项目。意思是
In VS.Net - right click on the page you want to be the initial startup page and set it to be the startup page.