Project builds but can't publish

前端 未结 12 1807
萌比男神i
萌比男神i 2020-11-29 04:03

I have an MVC project that for an uknown reason refuses to publish to a local folder in the PC.

The log says the following:

3>------ Publish start         


        
12条回答
  •  悲哀的现实
    2020-11-29 04:52

    I had switched to C# 7.3 in Properties > Build > Advanced, but accidentally only did so for the Debug configuration. When publishing (using Release configuration) it was still using C# 7.0, which lacked some of the language features I had used.

    Errors weren't visible in the Error List pane, only in the Output pane.

    Setting the language version to C# 7.3 for "All Configurations" solved it for me.

    This was using current version of Visual Studio 2017, Microsoft.Net.Compilers package not included in project.

提交回复
热议问题