Asp.net mvc Visual Studio 2015新MVC项目-Microsoft.Aspnet中不存在MVC
我在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中不存在类型或命名空间名称“Mvc” 命名空间“Microsoft.AspNet”(是否缺少程序集引用?) 及 当前上下文中不存在名称“布局” **我已经尝试过的事情:**Asp.net mvc Visual Studio 2015新MVC项目-Microsoft.Aspnet中不存在MVC,asp.net-mvc,asp.net-mvc-5,visual-studio-2015,Asp.net Mvc,Asp.net Mvc 5,Visual Studio 2015,我在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中不存在类型或命名空间名称“
Visual Studio 2015也有同样的问题,每次打开ASP.NET 5.0项目时都会出现该错误,但当我再次打开应用程序时,错误就会消失
顺便说一下,问题似乎与正确的版本控制有关,例如,如果您使用的是ASP.NET 5.0的Beta 7.0,可能有些软件包仍然使用以前的版本,如Beta 5.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. ---> System.ArgumentException: Item has already been added. Key in dictionary: 'RazorSupportedRuntimeVersion' Key being added: 'RazorSupportedRuntimeVersion'
 at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
 at System.Collections.Hashtable.Add(Object key, Object value)
 at System.Collections.Specialized.HybridDictionary.Add(Object key, Object value)
 at Microsoft.VisualStudio.Utilities.PropertyCollection.AddProperty(Object key, Object property)
 at Microsoft.VisualStudio.Html.Package.Razor.RazorVersionDetector.Microsoft.Html.Editor.ContainedLanguage.Razor.Def.IRazorVersionDetector.GetVersion(ITextBuffer textBuffer)
 at Microsoft.Html.Editor.ContainedLanguage.Razor.RazorUtility.TryGetRazorVersion(ITextBuffer textBuffer, Version& razorVersion)
 at Microsoft.Html.Editor.ContainedLanguage.Razor.RazorErrorTagger..ctor(ITextBuffer textBuffer)

错误
编辑器或编辑器扩展
System.Reflection.TargetInvocationException:调用的目标已引发异常。--System.ArgumentException:已添加项。输入字典:&apos;RazorSupportedRuntimeVersion&apos;正在添加的密钥:&apos;RazorSupportedRuntimeVersion&apos
;在System.Collections.Hashtable.Insert(对象键、对象nvalue、布尔加法)和#x000D
;在System.Collections.Hashtable.Add(对象键、对象值)和#x000D
;在System.Collections.Specialized.HybridDictionary.Add(对象键、对象值)和#x000D
;在Microsoft.VisualStudio.Utilities.PropertyCollection.AddProperty(对象键,对象属性)和#x000D
;在Microsoft.VisualStudio.Html.Package.Razor.RazorVersionDetector.Microsoft.Html.Editor.ContainedLanguage.Razor.Def.IRazorVersionDetector.GetVersion(ITextBuffer textBuffer)和#x000D
;在Microsoft.Html.Editor.ContainedLanguage.Razor.RazorUtility.TryGetRazorVersion(ITextBuffer textBuffer,Version&;razorVersion)和#x000D
;在Microsoft.Html.Editor.ContainedLanguage.Razor.RazorErrorTagger..ctor(ITextBuffer textBuffer)和x000D
;
我运行了C:\“ProgramFiles(x86)”\“MicrosoftVisualStudio14.0”\Common7\IDE\devenv.exe/resetuserdata,它被修复了
取自我遵循这些步骤,以便完全重新安装解决了问题的Visual Studio 2015。修理不起作用
我遇到了这个错误,通过对web.config的
运行时/assemblyBinding
部分进行编辑,可以解决它,如下所示:
<!-- Original //-->
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<!-- Changed to... //-->
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
这可能在主web.config
文件和/或视图目录中
希望这有帮助 重新打开项目解决了您的问题。我尝试过重新打开、卸载和加载项目,但仍然收到错误。我尝试过重新打开、卸载和加载项目,但仍然收到错误。在我的应用程序中可能会有这样的情况,软件包使用其他版本,但在我默认的新visual studio 2015项目中也会出现同样的问题。到目前为止,所有建议的解决方案都不起作用。任何其他suggestions@BrilBroeder您是否尝试过重新安装我发布的解决方案visual studio?@ShanKhan re-install成功了。谢谢。但是VS2015在Win10上仍然非常慢。但这是另一个我有时间时必须研究的问题:-)@BrilBroeder您是否尝试过重置用户数据?这可能会有帮助。有时,扩展会造成意外的行为。是的,我没有完成这项工作。