C# 打开旧的ASP.NET项目发现错误“/”应用程序中的服务器错误”后,原因是什么
在ASP.NET专用API上启动后,我看到如下错误:C# 打开旧的ASP.NET项目发现错误“/”应用程序中的服务器错误”后,原因是什么,c#,asp.net,visual-studio,C#,Asp.net,Visual Studio,在ASP.NET专用API上启动后,我看到如下错误: Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your sou
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0012: The type 'Dictionary<,>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Source Error:
Line 4: @{
Line 5: // Group the samples into a single tab if they are the same.
Line 6: Dictionary<string, object> samples = Model.GroupBy(pair => pair.Value).ToDictionary(
Line 7: pair => String.Join(", ", pair.Select(m => m.Key.ToString()).ToArray()),
Line 8: pair => pair.Key);
我在项目中没有错误,但我无法理解为什么我不能启动项目
我的web.config看起来像:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization"/>
<add namespace="System.Web.Routing" />
<add namespace="Private_API" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
<system.web>
<compilation>
<assemblies>
<add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
</system.web>
</configuration>
有谁能给我一步一步解决问题的确切说明吗?您必须添加对assembly'System.Collections的引用的消息似乎是最相关的错误。项目设置/bin文件夹中似乎缺少引用和/或DLL文件。在构建/运行应用程序之前,请检查是否已加载所有正确的包和引用。如何检查.dll文件是否过多。。我怎样才能找到失踪的人?应该是错误消息中提到的那个人。或者,在您的Visual Studio项目中,检查项目引用。我找不到此问题的解决方案。好的,但这并不能告诉我您尝试了什么,或者您的项目包含什么,或者您查找了什么,找到了什么/没有找到什么。只是告诉我你做不到,不允许我进一步帮助你。你明白我关于检查项目参考资料的意思吗?