[英]ASP.NET MVC 5 and Visual Studio 2015RC CS0234 and CS0103 errors
There are similar Qs on SO but I could find none relating to my specifics 关于SO有类似的问题,但我找不到与我的细节有关的问题
The ASP.NET MVC file new project builds and runs ok but in the editor I have red squigglies all over the place with numerous CS0234: "the type or namespace 'MVC' does not exist" and CS0103: the name xxxx does not exist in the current context. ASP.NET MVC文件新项目将生成并正常运行,但是在编辑器中,我到处都是红色的弯弯曲曲,上面有许多CS0234:“类型或名称空间'MVC'不存在”和CS0103:名称xxxx在其中不存在当前上下文。 Where xxxx is ViewBag, Scripts, RenderSection etc.
其中xxxx是ViewBag,脚本,RenderSection等。
On adding a model and referencing items on that model using @Model then this too fails in the same way in the editor. 在添加模型并使用@Model引用该模型上的项目时,这同样会在编辑器中失败。 Opening existing projects from vs2013 in 2015 also behaves the same.
2015年从vs2013打开现有项目的行为也一样。 I can see local copies of System.Web.Helpers.dll and System.Web..Mvc.dll in the local bin directory but the editor cannot be referencing these.
我可以在本地bin目录中看到System.Web.Helpers.dll和System.Web..Mvc.dll的本地副本,但编辑器无法引用这些副本。
I have tried deleting and reinstalling MVC (Microsoft.AspNet.Mvc) manually using nuget to no avail. 我尝试使用nuget手动删除并重新安装MVC(Microsoft.AspNet.Mvc),但无济于事。
os: windows 8.1 pro 操作系统:Windows 8.1专业版
Maybe a known bug? 也许是已知的错误? Hope someone can throw some light on this.
希望有人可以对此有所启发。
Web Config (extract): Web配置(提取):
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
Packages (extract): 包装(提取):
<packages>
<package id="Microsoft.AspNet.Identity.Core" version="2.2.0" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.Identity.EntityFramework" version="2.2.0" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.Identity.Owin" version="2.2.0" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net452" userInstalled="true" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" userInstalled="true" />
</packages>
Thought I had fixed this (see below faux fix 1 below) but the c# code completion/intellisense was still broken. 以为我已经解决了这个问题(请参见下面的人造补丁1),但是C#代码完成/智能感知仍被破坏。 Reinstalling VS made no difference.
重新安装VS没什么区别。
faux fix 1 squigglies + cs0234 errors disappeared but no c# intellisense/code completion 人工修复1弯曲+ cs0234错误消失但没有c#智能感知/代码完成
error details (from %APPDATA%\\Microsoft\\VisualStudio\\10.0\\ActivityLog.xml) 错误详细信息(来自%APPDATA%\\ Microsoft \\ VisualStudio \\ 10.0 \\ ActivityLog.xml)
<entry>
<record>389</record>
<time>2015/05/06 19:45:05.396</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Begin package load [ChutzpahVS2012Package]</description>
<guid>{A523D775-1341-4F21-A950-8C716E5628C9}</guid>
</entry>
<entry>
<record>390</record>
<time>2015/05/06 19:45:05.396</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [ChutzpahVS2012Package]</description>
<guid>{A523D775-1341-4F21-A950-8C716E5628C9}</guid>
<hr>80070002</hr>
<errorinfo>Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.</errorinfo>
</entry>
end of faux fix 1 假修复1结束
More thorough uninstall followed by a manual clean up and finally a fresh install fixed the issue, steps I took were: 更彻底的卸载,然后进行手动清理,最后重新安装解决了该问题,我采取的步骤是:
This felt like a sledge hammer to crack a very small nut! 感觉就像是一把大锤子,可以敲碎一个很小的螺母!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.