<tfoot id='lJ8na'></tfoot>
    <bdo id='lJ8na'></bdo><ul id='lJ8na'></ul>
    <i id='lJ8na'><tr id='lJ8na'><dt id='lJ8na'><q id='lJ8na'><span id='lJ8na'><b id='lJ8na'><form id='lJ8na'><ins id='lJ8na'></ins><ul id='lJ8na'></ul><sub id='lJ8na'></sub></form><legend id='lJ8na'></legend><bdo id='lJ8na'><pre id='lJ8na'><center id='lJ8na'></center></pre></bdo></b><th id='lJ8na'></th></span></q></dt></tr></i><div id='lJ8na'><tfoot id='lJ8na'></tfoot><dl id='lJ8na'><fieldset id='lJ8na'></fieldset></dl></div>
    1. <small id='lJ8na'></small><noframes id='lJ8na'>

    2. <legend id='lJ8na'><style id='lJ8na'><dir id='lJ8na'><q id='lJ8na'></q></dir></style></legend>

        C# 7.1 无法发布

        时间:2023-05-22

            <i id='YLT8K'><tr id='YLT8K'><dt id='YLT8K'><q id='YLT8K'><span id='YLT8K'><b id='YLT8K'><form id='YLT8K'><ins id='YLT8K'></ins><ul id='YLT8K'></ul><sub id='YLT8K'></sub></form><legend id='YLT8K'></legend><bdo id='YLT8K'><pre id='YLT8K'><center id='YLT8K'></center></pre></bdo></b><th id='YLT8K'></th></span></q></dt></tr></i><div id='YLT8K'><tfoot id='YLT8K'></tfoot><dl id='YLT8K'><fieldset id='YLT8K'></fieldset></dl></div>
              <tbody id='YLT8K'></tbody>
            <tfoot id='YLT8K'></tfoot>

            <small id='YLT8K'></small><noframes id='YLT8K'>

              • <legend id='YLT8K'><style id='YLT8K'><dir id='YLT8K'><q id='YLT8K'></q></dir></style></legend>
                  <bdo id='YLT8K'></bdo><ul id='YLT8K'></ul>
                • 本文介绍了C# 7.1 无法发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我有 ASP.NET Core C# Web 应用程序.我做了一些更改,现在使用 C# 7.1 功能.我更改了项目版本,所以它编译并运行良好.但是,当我尝试发布该项目时,我收到一个错误:

                  I have ASP.NET Core C# web application. I made some changes that now use C# 7.1 features. I changed project version, so it compiles and runs fine. However, when I try to publish the project, I am getting an error:

                  功能默认文字"在 C# 7.0 中不可用.请使用 7.1 或更高版本的语言.

                  Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.

                  我看到的编译命令是:

                  C:....nugetpackagesmicrosoft.net.compilers2.6.1	oolscsc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1705,1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE;RELEASE;NETCOREAPP2_0 /errorendlocation /preferreduilang:en-US /warnaserror+:NU1605`
                  

                  按照其他地方的建议,我安装了 Microsoft.Net.Compilers (v2.6.1),但没有任何区别.

                  As suggested elsewhere, I installed Microsoft.Net.Compilers (v2.6.1), but it didn't make any difference.

                  是否有专门影响发布的 Visual Studio 设置?

                  Is there a Visual Studio setting that affects publish specifically?

                  更新:看起来控制台应用程序没有这个问题.如果它构建成功,它也会成功发布.但是,Web 应用程序不会发布.是否有人成功发布了具有 C# 7.1 功能的 ASP.NET Core Web 应用程序?

                  UPDATE: Looks like a console application doesn't have this problem. If it builds successfully, it publishes successfully as well. However, the web application does not publish. Was anybody successful in publishing ASP.NET Core web application with C# 7.1 features?

                  推荐答案

                  <LangVersion>latest</LangVersion> 添加到您的 .pubxml 文件中,使 Visual Studio 2017 (15.5.2就我而言)发布.

                  Adding <LangVersion>latest</LangVersion> to your .pubxml file made it possible for Visual Studio 2017 (15.5.2 in my case) to publish.

                  来源:https://developercommunity.visualstudio.com/solutions/166543/view.html

                  这篇关于C# 7.1 无法发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:无法在 VS 2017 .NET Core 上启用 Entity Framework 迁移 下一篇:Visual Studio 2017 中缺少创建单元测试上下文菜单选项?

                  相关文章

                • <small id='POUYU'></small><noframes id='POUYU'>

                • <i id='POUYU'><tr id='POUYU'><dt id='POUYU'><q id='POUYU'><span id='POUYU'><b id='POUYU'><form id='POUYU'><ins id='POUYU'></ins><ul id='POUYU'></ul><sub id='POUYU'></sub></form><legend id='POUYU'></legend><bdo id='POUYU'><pre id='POUYU'><center id='POUYU'></center></pre></bdo></b><th id='POUYU'></th></span></q></dt></tr></i><div id='POUYU'><tfoot id='POUYU'></tfoot><dl id='POUYU'><fieldset id='POUYU'></fieldset></dl></div>

                  <tfoot id='POUYU'></tfoot>
                    <bdo id='POUYU'></bdo><ul id='POUYU'></ul>
                    1. <legend id='POUYU'><style id='POUYU'><dir id='POUYU'><q id='POUYU'></q></dir></style></legend>