Inline variable declaration not compiling

Inline variable declaration not compiling

 error CS1525: Invalid expression term 'string'
error CS1003: Syntax error, ',' expected

 

In case the above answer doesn't work for you, as it didn't work for me do the following:

Open the csproj file and check if you have the following package referenced in the file after the upgrade, if yes, remove it.

<Import Project="packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props" Condition="Exists('packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props')" />

Next, check the "Project ToolsVersion". It has to be 15.0, it probably is 14.0 though so you have to change that.

<Project ToolsVersion="15.0" .../>

Then simply reload the SOLUTION and you're good to go. Be aware that if you select "Reload Project" it will give you an error and not load it. 

 

上一篇:【Android春招每日一练】(十九) LeetCode Hot 5题+操作系统基础


下一篇:《Android入门到精通》第六章学习笔记总结