How to resolve NuGet.targets(128,5): error : Value cannot be null. (Parameter 'folderName')?

Gerald Ortiz Candela 1 Reputation point
2022-12-22T20:00:34.867+00:00

I am getting this error when it is running the command dotnet restore *.sln

INFO: Executing command: /bin/sh -c dotnet restore *.sln --configfile /home/jenkins/workspace/Genesis_dev/Backend/afn-genesis-dotnetbase/develop@tmp /artifactory/javatmpdir/artifactory.plugin.nuget.config11370555646779985990.tmp Dec 21, 2022 3:42:06 PM org.jfrog.build.extractor.packageManager.PackageManagerLogger error SEVERE: Determining projects to restore... /usr/share/dotnet/sdk/3.1.415/NuGet.targets(128,5): error : Value cannot be null. (Parameter 'folderName')

Is there something wrong with my csproj file or I need to set the folderName variable?

<Project Sdk="Microsoft.NET.Sdk">  
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">  
    <TargetFramework>netcoreapp3.1</TargetFramework>  
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>  
    <RootNamespace>com.tdp.afn</RootNamespace>  
    <PackageId>dotnetbase</PackageId>  
    <Version>0.1.1</Version>  
    <FunctionAppName>FN-genesis-dotnetbase</FunctionAppName>  
  </PropertyGroup>  
  <ItemGroup>  
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.7" />  
  </ItemGroup>  
  <ItemGroup>  
    <None Update="host.json">  
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>  
    </None>  
    <None Update="local.settings.json">  
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>  
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>  
    </None>  
  </ItemGroup>  
</Project>  

I have also applied the execution in my local environment. I am using :

dotnet Version: 3.1.101 (global.json)
NuGet Version: 3.3.0.212
VS2019

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,075 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,218 questions
0 comments No comments
{count} votes