gpt4 book ai didi

asp.net-mvc - Visual Studio 2015新建MVC项目-Microsoft.Aspnet中不存在mvc

转载 作者:行者123 更新时间:2023-12-04 04:04:35 25 4
gpt4 key购买 nike

我在Visual Studio 2015中遇到错误
我使用的是Windows 8.1和Visual Studio 2013,使用asp.net MVC 5的所有项目都可以正常工作,并且开发正常,没有任何错误。

自从我安装了Windows 10和Visual Studio 2015之后,我的整个ASP.NET MVC 5项目都无法正常运行。

我在Visual Studio 2015中创建了新的默认模板来检查它们。我在那些新项目上也遇到了同样的错误。

我收到如下错误:

CS0234 The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNet' (are you missing an assembly reference?)





The name "Layout" doesn't exist in current context.



**我已经尝试过的东西:**
  • 修复了VS2015。
  • 从Nuget卸载并安装了Install-Package Microsoft.AspNet.Mvc
  • 复制本地=真
  • System.web.MVC已被引用。
  • 所有地方的web.config版本5.2.3.0
  • 最佳答案

    我在%AppData%\Microsoft\VisualStudio\14.0\ActivityLog.xml中遇到此错误:

    <type>Error</type>
    <source>Editor or Editor Extension</source>
    <description>System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.ArgumentException: Item has already been added. Key in dictionary: &apos;RazorSupportedRuntimeVersion&apos; Key being added: &apos;RazorSupportedRuntimeVersion&apos;&#x000D;&#x000A; at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)&#x000D;&#x000A; at System.Collections.Hashtable.Add(Object key, Object value)&#x000D;&#x000A; at System.Collections.Specialized.HybridDictionary.Add(Object key, Object value)&#x000D;&#x000A; at Microsoft.VisualStudio.Utilities.PropertyCollection.AddProperty(Object key, Object property)&#x000D;&#x000A; at Microsoft.VisualStudio.Html.Package.Razor.RazorVersionDetector.Microsoft.Html.Editor.ContainedLanguage.Razor.Def.IRazorVersionDetector.GetVersion(ITextBuffer textBuffer)&#x000D;&#x000A; at Microsoft.Html.Editor.ContainedLanguage.Razor.RazorUtility.TryGetRazorVersion(ITextBuffer textBuffer, Version&amp; razorVersion)&#x000D;&#x000A; at Microsoft.Html.Editor.ContainedLanguage.Razor.RazorErrorTagger..ctor(ITextBuffer textBuffer)&#x000D;&#x000A;

    我运行了C:\“Program Files(x86)”\“Microsoft Visual Studio 14.0”\Common7\IDE\devenv.exe/resetuserdata,它已修复。

    取自 Exception when opening a cshtml file

    关于asp.net-mvc - Visual Studio 2015新建MVC项目-Microsoft.Aspnet中不存在mvc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32937222/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com