I am looking to apply my own custom nuget package url instead of default or offline package.
But whenever I tried the below, I am getting errors.
In my build.gradle,
dotnet {
restore {
noCache = true
force = true
beforeBuild = true
source = ['https://api.nuget.org/v3/index.json'] //This is just the default nuget package source. This will be changed once the source is working
}
}
I am receiving the below exception:
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:\Test\build\tmp\dotnet\ProjectFileParser.csproj : error NU1101: Unable to find package Microsoft.Build. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
C:\Test\build\tmp\dotnet\ProjectFileParser.csproj : error NU1101: Unable to find package Microsoft.Build.Locator. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
C:\Test\build\tmp\dotnet\ProjectFileParser.csproj : error NU1101: Unable to find package Microsoft.Win32.Registry. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
C:\Test\build\tmp\dotnet\ProjectFileParser.csproj : error NU1102: Unable to find package System.Security.Principal.Windows with version (>= 5.0.0)
C:\Test\build\tmp\dotnet\ProjectFileParser.csproj : error NU1102: - Found 1 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 4.7.0 ]
C:\Test\build\tmp\dotnet\ProjectFileParser.csproj : error NU1101: Unable to find package Microsoft.NETCore.App.Ref. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
C:\Test\build\tmp\dotnet\ProjectFileParser.csproj : error NU1101: Unable to find package Microsoft.WindowsDesktop.App.Ref. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
C:\Test\build\tmp\dotnet\ProjectFileParser.csproj : error NU1101: Unable to find package Microsoft.AspNetCore.App.Ref. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
, error:
The build failed. Fix the build errors and run again.
Also, When I tried to give the source as below,
source = List(...)
or
source = mutableListOf(...)
I am getting the below error.
What went wrong:
A problem occurred evaluating project ':...'.
No signature of method: build_bi97hkwj36lvocjqbdqdfar84.dotnet() is applicable for argument types: (build_bi97hkwj36lvocjqbdqdfar84$_run_closure1) values: [build_bi97hkwj36lvocjqbdqdfar84$_run_closure1@13fd2b6a]
Possible solutions: notify(), getOut(), collect(), delete([Ljava.lang.Object;), delete(org.gradle.api.Action), print(java.lang.Object)
As a newbie to gradle and also to your plugin, I am not sure what am I missing. So, please help me understand, how the restore source should be set.
I am not able to find any sample for passing the sources, even in your README.md. It would also be better, if you provide some working sample to make sure that it works fine.
Hi @ngyukman ,
I am looking to apply my own custom nuget package url instead of default or offline package. But whenever I tried the below, I am getting errors.
In my build.gradle,
I am receiving the below exception:
Also, When I tried to give the source as below,
source = List(...)
orsource = mutableListOf(...)
I am getting the below error.
As a newbie to gradle and also to your plugin, I am not sure what am I missing. So, please help me understand, how the restore source should be set. I am not able to find any sample for passing the sources, even in your README.md. It would also be better, if you provide some working sample to make sure that it works fine.
Thanks, Vinoth Karunanithy