Strange ASP.Net Error: .net 4.6.1, VS2015 - interpolated strings not supported?

六眼飞鱼酱① 提交于 2021-01-27 11:50:29

问题


Strange ASP.Net Error (WebForms): .net 4.6.1, VS2015

Error BC36716 Visual Basic 12.0 does not support interpolated strings.

No clue why i'm getting this. Why is it reporting VB 12.0 under VS2015?

  <system.web>
    <compilation debug="true" strict="true" explicit="true" targetFramework="4.6.1"/>
    <httpRuntime targetFramework="4.6.1"/>
  </system.web>

回答1:


Please look at the last answer at http://forums.asp.net/t/2061764.aspx?VS2015+claims+it+does+not+support+interpolated+strings

Found the answer here if anyone else has the same problem. It looks like the Roslyn compiler for Web Site project types is not icluded with VS2015 and must be downloaded separately. See: http://blogs.msdn.com/b/webdev/archive/2014/05/12/enabling-the-net-compiler-platform-roslyn-in-asp-net-applications.aspx

I hope it can help you.




回答2:


I tried everything! Until this worked. I removed two packages I had installed from NuGet. Both of them where from Microsoft, one was a Roslyn package and the other was a compiler. When I took those out of my project all my errors about interpolated strings went away. I am running Visual Studio 2017.

So look through your packages and remove ones you do not need (maybe leftover from an old setup like I had)...

I hope this helps someone.



来源:https://stackoverflow.com/questions/35127022/strange-asp-net-error-net-4-6-1-vs2015-interpolated-strings-not-supported

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!