Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to build project with ToolsVersion="15.0" #2519

Closed
giusepanzuto opened this issue Apr 3, 2019 · 9 comments · Fixed by #2520

Comments

@giusepanzuto
Copy link

commented Apr 3, 2019

After the update of the dotnet framework sdk image my CI pipeline is no longer working.
Seams that the current cake version (0.33.0) still have the preview path for the msbuild:

'/Program86/Microsoft Visual Studio/2019/Preview/MSBuild/Current/Bin/MSBuild.exe'

microsoft/dotnet-framework-docker#256

Thanks
G.

@gep13

This comment has been minimized.

Copy link
Member

commented Apr 3, 2019

@giusepanzuto thanks for raising this issue. Looks like we might need to do a quick release to add 2019 support, now that it has been officially released.

@gep13

This comment has been minimized.

Copy link
Member

commented Apr 3, 2019

@giusepanzuto actually, can you provide a set of steps to reproduce the problem, so that we can test to see if things are resolved after changes?

@wuerzi2000

This comment has been minimized.

Copy link

commented Apr 3, 2019

Please have a look at cake/src/Cake.Common/Tools/MSBuild/MSBuildResolver.cs
in function "GetHighestAvailableMSBuildVersion" is still an comment, which disables MSBuild16:

var versions = new[]
{
// MSBuildVersion.MSBuild16, /Since it's still in preview, do not search unless specified. Uncomment after stable version released/
MSBuildVersion.MSBuild15,
MSBuildVersion.MSBuild14,

@gep13

This comment has been minimized.

Copy link
Member

commented Apr 3, 2019

@wuerzi2000 yes, I am aware of the code. That still doesn’t change the request for a valid test case to ensure everything is working as expected, before and after a change.

@Roemer

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2019

If you have VS2019 installed, you can use the following small sample project and just run the Build task.
CakeVS2019Test.zip

@Roemer

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2019

I can confirm that the change fixes the issue. I created a PR for it.

@wuerzi2000

This comment has been minimized.

Copy link

commented Apr 4, 2019

@Roemer i tested your sample with 2019 too. A little drawback for a testdriver is, that you only get an output that there is an automatic downgrade from ToolsVersion="15.0" to ToolsVersion="4.0" if msbuild16 was not found. I have no idea to check is it is realy msbuild16!

I little workaround is to use newer C# 7/8 language keywords, so you get a real exception. For example string interpolation:
Console.WriteLine($"Hello Today {DateTime.Today}");

So cake will cancel with:
Program.cs(9,31): error CS1056: unecpected character '$'.

@Roemer

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2019

@wuerzi2000 It would be even better to just use a C#8 feature like ranges to really make sure it works correctly. I am already working on a PR for the whole fix.

@devlead devlead added the Feature label Apr 15, 2019
@devlead devlead added this to the v0.34.0 milestone Apr 15, 2019
devlead added a commit that referenced this issue Apr 15, 2019
* Roemer-feature/GH-2519-VS2019_support:
  Changes for stable Visual Studio 2019 release * fixes #2519
@BggClr

This comment has been minimized.

Copy link

commented May 26, 2019

Is it possible to add fix for this earlier than 0.34 milestone is completed? e.g. to fix default toolpath with 0.33.1 for example?

devlead added a commit that referenced this issue Jul 16, 2019
* release/0.34.0: (27 commits)
  Updated version and release notes.
  add null checks
  Enhance the Teamcity Provider's PullRequest detection
  (GH-2572) Update build dependencies * Fixes #2572
  (GH-2161) Make NuGet.Config path absolute.
  Added Runtime to DotNetCoreTestSettings and test for it.
  added missing runtime property and adapted tests
  Implement the NoImplicitTarget property and extension method to enable opt-out of default target Build. Added tests for the relevant scenarios.
  (GH-2553) Address HttpClient issue on Mono
  Run integration tests on Travis CI
  Update SDK & Fix SDK root variable
  Added HttpClient integration test
  Added NuGet pack files unit test
  closes issue #2157.
  Rewrite in-proc NuGet and update to NuGet 5.0
  GH2536: Additional formatting options for XmlPoke
  Rename octo.exe to Octo.exe
  Added new nuspec properties to NuGetPackSettings and implemented related functions.
  Changes for stable Visual Studio 2019 release * fixes #2519
  (GH-2523) Fix Cake.Tool package description * fixes #2523
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.