Closed maccamlc closed 3 years ago
hi @maccamlc
you can simply reproduce by running command dotnet build
failure reason is because the gradle plugin unzip C# sources into build/tmp/dotnet for parsing the project, but csproj in root folder search */.cs by default in .net core
to fix the issue, please create a dir to place the proto and the csproj, and update the sln accordingly, then you should able to build it by the plugin
btw, 1.8.0 should works on .net 3.1, .net 5 and .net 6
Thanks. I'll refactor and see how it goes.
For 1.8.0, when running I'm seeing
* What went wrong:
Could not determine the dependencies of task ':dotnetBuild'.
> Failed to calculate the value of task ':dotnetBuild' property 'sources'.
> Failed to parse project, output: C:\Program Files\dotnet\sdk\5.0.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 6.0. Either target .NET Core 5.0 or lower, or use a version of the .NET SDK that supports .NET Core 6.0. [C:\dev\gradle-csharp\build\tmp\dotnet\ProjectFileParser.csproj]
, error:
The build failed. Fix the build errors and run again.
Yep, that worked π I knew it had to be something simple (and stupid) on my part. πΈ
I'm using 1.7.2 though, as bumping to 1.8.0 still has the above error on my system.
indeed I could reproduce now, seems dotnet core changed the behavior a bit, or because .net 6 is still in preview
Hi. I'm new to C#, and trying to integrate this great looking plugin into my gradle build, to produce a gRPC client library in C#.
Using
./gradlew dotnetBuild --stacktrace --info
with gradle 7.1.1 and version 1.7.2 of this plugin. Project is set to targetnetcoreapp3.1
.NB: I tried bumping the plugin version to 1.8.0, but failed as I don't have 6.0. Also tried with gradle 6.9.
But when trying to build, I get errors that seem related to the Project Parsing.
I've scaled down a small repo to the bare-bones of what triggers this problem for me.
I'm hoping someone might be able to point me in the right direction, as I'm very likely missing something obvious π€¦ π
FYI The information section of the output I am getting is: