fabric8-launcher / launcher-application

The fabric8-launcher application
https://developers.redhat.com/launch/
Apache License 2.0
18 stars 53 forks source link

[import] .NET MusicStore example doesn't work #837

Open quintesse opened 5 years ago

quintesse commented 5 years ago

Trying to import https://github.com/aspnet/musicstore results in this build error:

...
Installing runtime.osx-x64.Microsoft.NETCore.DotNetAppHost 3.0.0-preview1-26907-05.
Installing runtime.osx-x64.Microsoft.NETCore.DotNetHostResolver 3.0.0-preview1-26907-05.
Generating MSBuild file /opt/app-root/src/samples/MusicStore/obj/MusicStore.csproj.nuget.g.props.
Generating MSBuild file /opt/app-root/src/samples/MusicStore/obj/MusicStore.csproj.nuget.g.targets.
Restore completed in 2.54 min for /opt/app-root/src/samples/MusicStore/MusicStore.csproj.
---> Publishing application...
Microsoft (R) Build Engine version 15.9.20.63311 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

/opt/rh/rh-dotnet22/root/usr/lib64/dotnet/sdk/2.2.105/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): error NETSDK1005: Assets file '/opt/app-root/src/samples/MusicStore/obj/project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.2'. Ensure that restore has run and that you have included 'netcoreapp2.2' in the TargetFrameworks for your project. [/opt/app-root/src/samples/MusicStore/MusicStore.csproj]
Build failed
ERROR: An error occurred: non-zero (13) exit code from registry.access.redhat.com/dotnet/dotnet-22-rhel7

We should try to figure out if we can make it work.

It can be reproduced locally using this command:

s2i build -e DOTNET_STARTUP_PROJECT=samples/MusicStore/MusicStore.csproj https://github.com/aspnet/musicstore registry.access.redhat.com/dotnet/dotnet-22-rhel7 dotnet-sample-app
quintesse commented 5 years ago

@omajid is this something you can help out with perhaps?

gastaldi commented 5 years ago

@quintesse my guess is that the sample is targeted for .NET Core 3.0 (https://github.com/aspnet/MusicStore/blob/master/samples/MusicStore/MusicStore.csproj#L5) but since my .Net knowledge is near zero, I'll let @omajid answer that :wink:

omajid commented 5 years ago

@gastaldi is correct: the MusicStore sample targets 3.0.

@quintesse Can you try using the release/2.2 branch of MusicStore? that should support 2.2 (and 2.1 as well).