OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

Building latest 1.10.x from command line #8758

Closed dmhiggins23 closed 6 months ago

dmhiggins23 commented 7 months ago

I'm just updating my orchard application. It compiles in Visual Studio 2022, but does not compiled using the command line build.

It give a syntax error message "; expected" for the following line

https://github.com/OrchardCMS/Orchard/blob/90b104ed74234bdaaedf2b730166eddc66ad4d4c/src/Orchard.Web/Modules/Orchard.Email/Services/SmtpMessageChannel.cs#L157

I believe that there is a version conflict between the compiler that is being called from the command line and the version of the compiler required to handle the c# language constructs used in SmtpMessageChannel.cs (version 8, I believe). I believe that ClickToBuild.cmd determines which version of msbuild to use, and in my case it is using a version that does not support the more advanced language feature.

Any suggestions on whether this is due to version issues on my computer or if the ClickToBuild.cmd file can be updated to resolve the issue?

Thank you!

sebastienros commented 7 months ago

Looks like we need to update this line https://github.com/OrchardCMS/Orchard/blob/dev/ClickToBuild.cmd#L6 to search within 19.0 too. And the lines after to take the result into account. Can you try it and make a PR if that works?

dmhiggins23 commented 7 months ago

I've create a pull request. Since VS2017 (MSBuild v15) and earlier can no longer compile the newer c# language features used in SmtpMessageChannel.cs, I removed these as build alternatives. I also made a change to the file SmtpSettingsPart.cs so that VS2019 (MSBuild v16) could still compile orchard. In the process, I noticed that the version of nuget.exe no longer worked, so I updated it to the latest from https://www.nuget.org/downloads (v 6.9.1).

BenedekFarkas commented 6 months ago

Fixed by #8764