0

I created a solution called NasaAPI and in this solution i installed some NuGet packages. When I copy the folder of my solution and paste it into the repository folder so that I can push it, the NuGet packages I installed disappear.

I tried to restore them but it throws this error MSB3202. Tried to install it again with the nuget package installer and also by installing it manually. The nuget packages don't show up. When I try to install them manually it either fails or it says that files are missing. But it's the exact copy of the previous solution, I don't understand what might be missing.

I checked the path of the .csproj since I moved it. I cannot modify it. But still, just reading it, it seems like it's the correct path.

All of this generated from this error:

Error NETSDK1004: assets file '/Users/noemipintaldi/Desktop/Nasa/Test Candidati.Noemi.Pintaldi.dev/NasaAPI/NasaAPI/obj/project.assets.json' not found. Run a NuGet package restore to generate this file.

I'll also include the .csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <UserSecretsId>aspnet-NasaAPI-code-db8d1e273a3c</UserSecretsId>
  </PropertyGroup>

  <ItemGroup>
    <None Include="NasaAPI.csproj" />
  </ItemGroup>
  <ItemGroup>
    <None Update="app.db" CopyToOutputDirectory="PreserveNewest" ExcludeFromSingleFile="true" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.15" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.15" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.15" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.15" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.15" />
    <PackageReference Include="Json.Net" Version="1.0.33" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
  </ItemGroup>

</Project>
Selene_jpg
  • 39
  • 5
  • 1
    `` looks wrong - as per [the docs](https://learn.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-items?view=vs-2022#none) _"[None] represents files that should have no role in the build process."_ – stuartd Mar 27 '23 at 12:48
  • Removed it. Still, if i try to restore them it tells me that cproj was not found – Selene_jpg Mar 27 '23 at 13:43
  • Ok this is weird. If I remove that line, i cannot access my solution. I don't know why it was autogenerated – Selene_jpg Mar 27 '23 at 14:10
  • https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1004 – bsod_ Mar 27 '23 at 15:47
  • have your tried a dotnet restore via nuget package manager? more info here - https://stackoverflow.com/questions/48440223/assets-file-project-assets-json-not-found-run-a-nuget-package-restore – bsod_ Mar 27 '23 at 15:48
  • Yes. It throws an exception – Selene_jpg Mar 27 '23 at 16:05
  • Also i already checked the page of the error and tried restoring with said command. it fails – Selene_jpg Mar 27 '23 at 16:06

0 Answers0