I've just recently started using a newly installed PC but am having trouble building a solution in Visual Studio 2022 that uses PostSharp (version 6.10.5). It works without problem to build the same solution on my old computer and strangely enough a colleague of mine who also recently installed a new computer has no problem building the solution.
Visual Studio throws a bunch of NU1101- and NU1102-errors such as these:
It also hints to the following information regarding PostSharp which I'm not sure how to fix?
The process "C:\Program Files\dotnet\dotnet.exe" failed with exit code 1.
Restore of compiler dependencies failed. To disable compiler dependencies restore use PostSharpDependencyRestoreDisabled=True MSBuild property.
Unable to start PostSharp due to previous error encountered while creating fallback package directory.
We're including PostSharp via a private Nuget package where we're referencing PostSharp like this after input in this thread: How to have PostSharp included in build process for ASP.NET WebApi project when installed using our own Nuget package?.
<PackageReference Include="PostSharp" Version="6.10.5" PrivateAssets="none" />
If I exclude everything related to PostSharp, the solution builds just fine but not with PostSharp included. Any help here would be very much appreciated.
/Martin