samedi 9 mai 2015

ASP.NET MVC 5 and Visual Studio 2015RC CS0234 errors

There are similar Qs on SO but I could find none relating to my specifics

The ASP.NET MVC out of the box template (ie file new project etc) build and run ok but in the editor I have red squigglies all over the place with 17 CS0234 errors each reporting:

"the name xxxx does not exist in the current context"

Where xxxx is ViewBag, Scripts, RenderSection etc.

Observe same issue with opening existing projects from vs2013 in 2015.

I have tried deleting and reinstalling MVC (Microsoft.AspNet.Mvc) manually using nuget to no avail.

os: windows 8.1 pro

Maybe a known bug? Hope someone can throw some light on this.

Web Config (extract):

<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>

EDIT

thought I had fixed this (see below orig fix 1 below) but the c# code completion/intellisense was broken.

Decided to reinstall vs2015 and this has reverted to the original issue at the top of this question and the C# code completion / intellisense is not working.

fix 1 squigglies + cs0234 errors disappeared but no c# intellisense/code completion

  1. went to programs and features to modify the current vs settings to remove just the web tools
  2. almost immediately aborted the above - the installer aborted with no changes except maybe setting a restore point. Thought it was prudent to go back into vs and uninstall web essentials extension first!
  3. in vs uninstalled web essentials
  4. on restarting vs had an error relating to chutzpah extension ( error details below) which I uninstalled
  5. Opened vs again to check it still worked - newed up an asp.net mvc 5 project (so at this stage no changes have been made to the vs installed components) and everything was working no more errors in the editor all squigglies gone!
  6. reloaded above extensions and everything still works

error details (from %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>

Aucun commentaire:

Enregistrer un commentaire