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

Use Net Core App 3.0 #205

Closed
wants to merge 1 commit into from
Closed

Conversation

kant2002
Copy link
Contributor

When building in the CI environment, using .NET Core 3.0 Preview 2, the netcoreapp2.0 target is not available, so it is failed to run when running using dotnet reportgenerator tool.

When building in the CI environment, using .NET Core 3.0 Preview 2, the netcoreapp2.0 target is not available, so it is failed to run when running using `dotnet reportgenerator` tool.
@danielpalme danielpalme mentioned this pull request Jan 31, 2019
@danielpalme
Copy link
Owner

danielpalme commented Jan 31, 2019

I installed the latest SDK (3.0.100-preview-010184).
But I'm not able to compile with your changes?
Do I need VS 2019 for that?

@kant2002
Copy link
Contributor Author

kant2002 commented Feb 1, 2019

I believe not. But I was not able to compile locally your project to verify that. build.bat does not work for me in the plain CLI, but I did not try inside Developer Command Line. If you give me rough steps how to build, I could try build form master locally, so I reduce frictions on your side.

@danielpalme
Copy link
Owner

You should be able to compile the project if you open it in Visual Studio 2017.
build.bat basically does the same, and also executes tests and creates Nuget packages.

@kant2002
Copy link
Contributor Author

kant2002 commented Feb 6, 2019

Indeed there issue with build in VS2017 and .NET Core 2.2 SDK. Looks like it is not so trivial like I initially thought.

  • For building these libraries there need for have .NET Core 3.0 Preview 2 installed
  • VS 2017 does not pickup .NET Core 3.0 Preview 2 SDK but
  • dotnet build does not work for your solution, since you have src\Testprojects\FSharp\Project\Test_FSharp.fsproj and src\ReportGenerator.Console\ReportGenerator.Console.Net.csproj which use more verbose version of MSBuild

I honestly do not see right now smooth path to make build support both VS2017 and VS2019 without some MSBuild trickery. I could create control build to build .NET Core 2.0 only, or .NET Core 2.0 + 3.0 depends on the MSBuild property, but still this require split solution on half probably which is not practical for you as I understand. So better to discuss that.

@danielpalme
Copy link
Owner

I also did some experiments. There is no easy way to fix this at the moment.

In the meantime you can also use the global tool.

@martincostello
Copy link
Contributor

+1 to this PR - I'm testing applications where we install the relevant SDK version only into the CI machines to compile the application, which at present breaks our .NET Core 3.0.0 branch using preview 2. For now we've just had to comment-out use of ReportGenerator.

@danielpalme
Copy link
Owner

danielpalme commented Feb 9, 2019

Since the build is currently failing within VS 2017, I did some manual setup to create the Nuget package.

Please try this release and let me know if it works for you:
https://www.nuget.org/packages/dotnet-reportgenerator-cli/4.0.11-netcore3-p2-01

My changes are tracked in this branch:
https://github.com/danielpalme/ReportGenerator/tree/netcoreapp30

@martincostello
Copy link
Contributor

Great, thanks! I’ll try it out on Monday.

@martincostello
Copy link
Contributor

Unfortunately it doesn't work.

The dependency tree specifies Microsoft.NETCore.App (>= 3.0.0), and as 3.0 hasn't shipped yet, that doesn't exist. The package need to specify a preview version of 3.0 as the minimum version somehow.

@martincostello
Copy link
Contributor

I guess it's this that needs tweaking while it's still in preview:

<dependency id="Microsoft.NETCore.App" version="3.0.0" exclude="Build,Analyzers" />

@danielpalme
Copy link
Owner

Thanks for your feedback.
I updated the version of Microsoft.NETCore.App:

<dependency id="Microsoft.NETCore.App" version="3.0.0-preview-27324-5" exclude="Build,Analyzers" />

Please try again with this new package:
https://www.nuget.org/packages/dotnet-reportgenerator-cli/4.0.11-netcore3-p2-02

@martincostello
Copy link
Contributor

Thanks - I'll give the new one a try 👍

@martincostello
Copy link
Contributor

I've just tried this, but this doesn't quite fit with my scenario. I'm currently using ReportGenerator, finding the DLL in the NuGet package on disk, and then running it like an exe as the scripting for our build is (pseudocode) like the below:

DownloadOpenCoverToPath $openCover
& $openCover -target:dotnet -targetargs:test -output:$reportPath
& dotnet $whereReportGeneratorIsOnDisk -reports:$reportPath

Using dotnet-reportgenerator-cli isn't working because dotnet can't find it because it's not being run in the context of the build itself.

Either I'm doing something silly and this isn't how I should be doing this scenario and I need to change the approach, or I need a different package that supports 3.0.

The general approach is that I'm downloading the .NET Core SDK and putting it on the path at a local location and trying not to install anything globally as our CI build machines are not ephemeral and I don't want to pollute the image for other unrelated builds that might run later on the same agent.

An updated build of the global tool might work as I could install that at a custom location?

@danielpalme
Copy link
Owner

I think at the moment we just have to wait unit .NET Core 3 is released.

In #211 @Jsparham777 requested support for 2.2

I don't understand why every every release of .NET Core requires a special package targeting that version.
On my machine it just works with the package targeting .NETCoreApp2.0.

  • What's different in your environment?
  • Any useful documentation on CLI packages?

@danielpalme
Copy link
Owner

I just tried it myself on a machine with only "SDK 3.0.100-preview-010184" installed.

I added the following to my *.csproj file:

<ItemGroup>
<DotNetCliToolReference Include="dotnet-reportgenerator-cli" Version="4.0.11-netcore3-p2-02" />
</ItemGroup>

And it just worked.

@danielpalme
Copy link
Owner

DotNetCliTool seem to be no longer supported:
https://github.com/dotnet/cli/issues/11111#issuecomment-482274805
dotnet/announcements#107

I will add support for .NET Core 3.0 in the global tool.

@martincostello
Copy link
Contributor

I was just pointed to this tweet from Nate McMaster. It might fix this problem ahead of 3.0 being released and unblock people using previews:

https://twitter.com/natemcmaster/status/1123281393377693696?s=21

@danielpalme
Copy link
Owner

I added support for .NET Core 3.0 in the following packages:
https://www.nuget.org/packages/ReportGenerator/4.3.0-rc3
https://www.nuget.org/packages/dotnet-reportgenerator-globaltool/4.3.0-rc3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants