vs2015的项目用2013打开后代码提示不正常

hastalavista 2016-10-26 10:06:40
我有一个MVC项目,一开始是用VS2015开发的,后来在使用过程中发现vs2015的bug不断,太添堵了,所以切换回vs2013 update5。能够直接打开,开发也没有问题,就是razor页面下代码提示出问题,@Html能出来,但一直划红线,linq表达式的代码提示出不来,System.Collection的引用好像也没有。还很奇怪的是Web.Config中根节点是画蓝线的,说没有声明。
有图为证


试过项目重新加载,重新生成,vs重启,删除vs缓存,都没有效果。大家帮忙看看,该如何修复。
...全文
343 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
hastalavista 2016-10-28
  • 打赏
  • 举报
回复
引用 6 楼 zbdzjx 的回复:
我是用的vs 2015 with update1,目前遇到两个小坑。不知有没有update 3的单独安装包,网上看到的都是vs 2015 with update3,好几个G。
msdn上好像有update3的安装器,但离线版本的独立安装包我也没找到过
hastalavista 2016-10-28
  • 打赏
  • 举报
回复
引用 5 楼 u014467089 的回复:
高版本改到低版本很容易出问题的,2015或许有一些新的dll更新,而在你的2013函数库里并没有的,然后就会出错。你试着重新生成一下,看报什么错误,在2015项目引用中找到对应的引用,右键-》属性,就可以查找到这个引用的路径了,把它复制出来,然后在2013项目中重新引用。 实在不行就新建个2013项目,把2015的逐个复制过来吧 其实2015挺好啊,我一直在用,难道有什么坑我没遇到的?
实际上重新生成没有任何错误,可以正常的调试、编译、发布,有问题的只是开发时的razor代码提示,其他类库什么都一切正常。 关键是我找不出出问题的地方,这就有点头疼了。
zbdzjx 2016-10-27
  • 打赏
  • 举报
回复
我是用的vs 2015 with update1,目前遇到两个小坑。不知有没有update 3的单独安装包,网上看到的都是vs 2015 with update3,好几个G。
Panda_Ling 2016-10-27
  • 打赏
  • 举报
回复
高版本改到低版本很容易出问题的,2015或许有一些新的dll更新,而在你的2013函数库里并没有的,然后就会出错。你试着重新生成一下,看报什么错误,在2015项目引用中找到对应的引用,右键-》属性,就可以查找到这个引用的路径了,把它复制出来,然后在2013项目中重新引用。 实在不行就新建个2013项目,把2015的逐个复制过来吧 其实2015挺好啊,我一直在用,难道有什么坑我没遇到的?
hastalavista 2016-10-26
  • 打赏
  • 举报
回复
引用 3 楼 LeiRobin 的回复:
这个还是修改配置文件吧,估计是有些东西还引用的2015的
以下是我config的内容,我感觉没有什么需要修改的内容。我怀疑是.sln或.csproj文件导致的问题,但对这两个文件结构不了解,不知如何去修改
<?xml version="1.0" encoding="utf-8"?>
<!--
  有关如何配置 ASP.NET 应用程序的详细信息,请访问
  http://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
    <add name="JWMSDb" connectionString="Server=.\SQL2012;Database=JWMS;Integrated Security=True;" providerName="System.Data.SqlClient" />
    <add name="JWMS_LogDb" connectionString="Server=.\SQL2012;Database=JWMS_Log;Integrated Security=True;" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    <add key="UploadFilePath" value="D:/" />
  </appSettings>
  <system.web>
    <authentication mode="None" />
    <compilation debug="true" targetFramework="4.6.1" />
    <httpRuntime targetFramework="4.6.1" maxRequestLength="20480" />
    <customErrors mode="RemoteOnly"></customErrors>
    <sessionState mode="InProc" timeout="30"></sessionState>
  </system.web>
  <system.webServer>
    <modules>
      <remove name="FormsAuthentication" />
    </modules>
    <staticContent>
      <remove fileExtension=".woff" />
      <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
      <remove fileExtension=".woff2" />
      <mimeMap fileExtension=".woff2" mimeType="application/font-woff" />
    </staticContent>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
      <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="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
    </compilers>
  </system.codedom>
</configuration>
姓小名白丶 2016-10-26
  • 打赏
  • 举报
回复
这个还是修改配置文件吧,估计是有些东西还引用的2015的
zhanglong_longlong 2016-10-26
  • 打赏
  • 举报
回复
config的版本的一些东西修改一下,因为这个版本还是2015的
1988525 2016-10-26
  • 打赏
  • 举报
回复
用2013新建项目和页面,把每个页的内容都复制过去,这样虽然慢,但是应该不会出现什么问题了

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧