Home > Software design >  What does this error mean? 'Error: Unable to find a project reference for project configuration
What does this error mean? 'Error: Unable to find a project reference for project configuration

Time:04-26

I am new to Blazor and .NET and I am trying to follow a CRUD tutorial. I am trying to generate a API controller scaffold in Blazor. I name it SuperHeroController.cs and click build. It returns with:

/usr/local/share/dotnet/sdk/6.0.202/Sdks/Microsoft.NET.Sdk.Razor/targets/Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(5,5): Error: Unable to find a project reference for project configuration item '/Users/myname/Projects/BlazorFullStackCrud/BlazorFullstackCrud/Client/BlazorFullstackCrud.Client.csproj' (BlazorFullstackCrud.Server)

I check the file in question: Microsoft.NET.Sdk.Razor.StaticWebAssets.targets

And this is the problematic line of code although I don't understand why.

<MergeConfigurationProperties
  CandidateConfigurations="@(_ReferencedProjectsConfiguration)"
  ProjectReferences="@(_StaticWebAssetProjectReference)">

Can anyone explain why it is returning this error?

CodePudding user response:

So the solution to solve this question is to add

<ProjectReference Include="..\Client\BlazorFullstackCrud.Client.csproj" />

into .Client.csproj.

  • Related