fullstackhero / blazor-starter-kit

Clean Architecture Template for Blazor WebAssembly Built with MudBlazor Components.
MIT License
3.48k stars 730 forks source link

Cannot build the solution after generating the project from template: error CS0006: Metadata file .dll missing #353

Closed toza-mimoza closed 2 years ago

toza-mimoza commented 2 years ago

Describe the issue After following installation instructions on the landing page of Blazor Hero, I still cannot run the project.

To Reproduce Steps to reproduce the behavior:

  1. Install .NET 5.0
  2. Run dotnet tool install --global dotnet-ef
  3. Install project template dotnet new --install BlazorHero.CleanArchitecture
  4. Generate the project using dotnet new BlazorHero.CleanArchitecture -n KonstrukteurApp
  5. Install either Visual Studio 2019 or 2022 (happens on both versions).
  6. Build the solution.

Build output

Rebuild started...
Restored C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Domain\Domain.csproj (in 1 ms).
Restored C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Shared\Shared.csproj (in 42 ms).
Restored C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Application.csproj (in 94 ms).
Restored C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Infrastructure.Shared\Infrastructure.Shared.csproj (in 105 ms).
Restored C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Client.Infrastructure\Client.Infrastructure.csproj (in 109 ms).
Restored C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Client\Client.csproj (in 194 ms).
1>------ Rebuild All started: Project: Domain, Configuration: Debug Any CPU ------
2>------ Rebuild All started: Project: Shared (Source\Shared\Shared), Configuration: Debug Any CPU ------
3>------ Rebuild All started: Project: docker-compose, Configuration: Debug Any CPU ------
Restored C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Infrastructure\Infrastructure.csproj (in 295 ms).
Restored C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Server\Server.csproj (in 311 ms).
1>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Domain\Contracts\AuditableEntityExtendedAttribute.cs(12,26,12,34): warning CS8618: Non-nullable property 'EntityId' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
1>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Domain\Contracts\AuditableEntityExtendedAttribute.cs(17,32,17,38): warning CS8618: Non-nullable property 'Entity' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
1>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Domain\Contracts\AuditableEntityExtendedAttribute.cs(23,23,23,26): warning CS8618: Non-nullable property 'Key' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
1>Domain -> C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Domain\bin\Debug\net5.0\KonstrukteurApp.Domain.dll
1>Done building project "Domain.csproj".
2>Shared -> C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Shared\bin\Debug\net5.0\KonstrukteurApp.Shared.dll
4>------ Rebuild All started: Project: Application, Configuration: Debug Any CPU ------
3>docker-compose  -f "C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\docker-compose.yml" -p dockercompose7904209051298909769 --ansi never config
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetById\GetExtendedAttributeByIdResponse.cs(10,20,10,22): warning CS8618: Non-nullable property 'Id' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetById\GetExtendedAttributeByIdResponse.cs(11,26,11,34): warning CS8618: Non-nullable property 'EntityId' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetById\GetExtendedAttributeByIdResponse.cs(13,23,13,26): warning CS8618: Non-nullable property 'Key' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetById\GetExtendedAttributeByIdResponse.cs(22,23,22,32): warning CS8618: Non-nullable property 'CreatedBy' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetById\GetExtendedAttributeByIdResponse.cs(24,23,24,37): warning CS8618: Non-nullable property 'LastModifiedBy' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Commands\AddEdit\AddEditExtendedAttributeCommand.cs(30,20,30,22): warning CS8618: Non-nullable property 'Id' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Commands\AddEdit\AddEditExtendedAttributeCommand.cs(31,26,31,34): warning CS8618: Non-nullable property 'EntityId' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Commands\AddEdit\AddEditExtendedAttributeCommand.cs(34,23,34,26): warning CS8618: Non-nullable property 'Key' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetAll\GetAllExtendedAttributesResponse.cs(10,20,10,22): warning CS8618: Non-nullable property 'Id' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetAll\GetAllExtendedAttributesResponse.cs(11,26,11,34): warning CS8618: Non-nullable property 'EntityId' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetAll\GetAllExtendedAttributesResponse.cs(13,23,13,26): warning CS8618: Non-nullable property 'Key' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetAll\GetAllExtendedAttributesResponse.cs(22,23,22,32): warning CS8618: Non-nullable property 'CreatedBy' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetAll\GetAllExtendedAttributesResponse.cs(24,23,24,37): warning CS8618: Non-nullable property 'LastModifiedBy' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetAllByEntityId\GetAllExtendedAttributesByEntityIdResponse.cs(10,20,10,22): warning CS8618: Non-nullable property 'Id' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetAllByEntityId\GetAllExtendedAttributesByEntityIdResponse.cs(11,26,11,34): warning CS8618: Non-nullable property 'EntityId' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetAllByEntityId\GetAllExtendedAttributesByEntityIdResponse.cs(13,23,13,26): warning CS8618: Non-nullable property 'Key' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetAllByEntityId\GetAllExtendedAttributesByEntityIdResponse.cs(22,23,22,32): warning CS8618: Non-nullable property 'CreatedBy' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Queries\GetAllByEntityId\GetAllExtendedAttributesByEntityIdResponse.cs(24,23,24,37): warning CS8618: Non-nullable property 'LastModifiedBy' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
4>C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\Features\ExtendedAttributes\Commands\AddEdit\AddEditExtendedAttributeCommand.cs(67,116,67,126): warning CS8602: Dereference of a possibly null reference.
4>ALINK : fatal error AL1065: File name 'obj\Debug\net5.0\KonstrukteurApp.Application.Resources.Validators.Features.ExtendedAttributes.Commands.AddEdit.AddEditExtendedAttributeCommandValidatorLocalization.en.resources' is too long or invalid
4>Done building project "Application.csproj" -- FAILED.
5>------ Rebuild All started: Project: Client.Infrastructure, Configuration: Debug Any CPU ------
6>------ Rebuild All started: Project: Infrastructure (Source\Infrastructure\Infrastructure), Configuration: Debug Any CPU ------
7>------ Rebuild All started: Project: Infrastructure.Shared, Configuration: Debug Any CPU ------
3>services:
3>  blazorhero:
3>    build:
3>      context: .
3>      dockerfile: src/Server/Dockerfile
3>    container_name: blazorhero
3>    depends_on:
3>      db:
3>        condition: service_started
3>    environment:
3>      ASPNETCORE_Kestrel__Certificates__Default__Password: securePassword123
3>      ASPNETCORE_Kestrel__Certificates__Default__Path: /https/aspnetapp.pfx
3>      ConnectionStrings__DefaultConnection: Server=db;Database=BlazorHero;User=sa;Password=Your_password123;MultipleActiveResultSets=true
3>    image: blazorhero
3>    networks:
3>      default: null
3>    ports:
3>    - mode: ingress
3>      target: 5005
3>      published: 5005
3>      protocol: tcp
3>    - mode: ingress
3>      target: 5006
3>      published: 5006
3>      protocol: tcp
3>    restart: on-failure
3>    volumes:
3>    - type: bind
3>      source: ~/.aspnet/https
3>      target: /https
3>      read_only: true
3>      bind:
3>        create_host_path: true
3>  db:
3>    container_name: mssql
3>    environment:
3>      ACCEPT_EULA: "Y"
3>      SA_PASSWORD: Your_password123
3>    image: mcr.microsoft.com/mssql/server
7>CSC : error CS0006: Metadata file 'C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\bin\Debug\net5.0\ref\KonstrukteurApp.Application.dll' could not be found
7>Done building project "Infrastructure.Shared.csproj" -- FAILED.
3>    networks:
3>      default: null
3>networks:
3>  default:
3>    name: dockercompose7904209051298909769_default
5>CSC : error CS0006: Metadata file 'C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\bin\Debug\net5.0\ref\KonstrukteurApp.Application.dll' could not be found
5>Done building project "Client.Infrastructure.csproj" -- FAILED.
8>------ Rebuild All started: Project: Client (Source\Web\Client\Client), Configuration: Debug Any CPU ------
3>docker-compose  -f "C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\docker-compose.yml" -f "C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\obj\Docker\docker-compose.vs.release.partial.g.yml" -p dockercompose7904209051298909769 --ansi never kill
6>CSC : error CS0006: Metadata file 'C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\bin\Debug\net5.0\ref\KonstrukteurApp.Application.dll' could not be found
6>Done building project "Infrastructure.csproj" -- FAILED.
3>error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json?all=1&filters=%7B%22label%22%3A%7B%22com.docker.compose.project%3Ddockercompose7904209051298909769%22%3Atrue%7D%7D&limit=0": open //./pipe/docker_engine: The system cannot find the file specified.
3>docker images --filter dangling=true --format {{.ID}}
8>C:\Program Files\dotnet\sdk\5.0.402\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.MvcApplicationPartsDiscovery.targets(54,5): warning RAZORSDK1007: Reference assembly C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\bin\Debug\net5.0\KonstrukteurApp.Application.dll could not be found. This is typically caused by build errors in referenced projects.
8>CSC : error CS0006: Metadata file 'C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\bin\Debug\net5.0\ref\KonstrukteurApp.Application.dll' could not be found
8>CSC : error CS0006: Metadata file 'C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Client.Infrastructure\bin\Debug\net5.0\ref\KonstrukteurApp.Client.Infrastructure.dll' could not be found
8>Done building project "Client.csproj" -- FAILED.
9>------ Rebuild All started: Project: Server (Source\Web\Server\Server), Configuration: Debug Any CPU ------
3>error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/images/json?filters=%7B%22dangling%22%3A%7B%22true%22%3Atrue%7D%7D": open //./pipe/docker_engine: The system cannot find the file specified.
3>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4679,5): error MSB3030: Could not copy the file "C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Server\bin\Debug\net5.0\KonstrukteurApp.Server.dll" because it was not found.
3>Done building project "docker-compose.dcproj" -- FAILED.
9>C:\Program Files\dotnet\sdk\5.0.402\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.MvcApplicationPartsDiscovery.targets(54,5): warning RAZORSDK1007: Reference assembly C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\bin\Debug\net5.0\KonstrukteurApp.Application.dll could not be found. This is typically caused by build errors in referenced projects.
9>CSC : error CS0006: Metadata file 'C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Application\bin\Debug\net5.0\ref\KonstrukteurApp.Application.dll' could not be found
9>CSC : error CS0006: Metadata file 'C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Client\bin\Debug\net5.0\ref\KonstrukteurApp.Client.dll' could not be found
9>CSC : error CS0006: Metadata file 'C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Client.Infrastructure\bin\Debug\net5.0\ref\KonstrukteurApp.Client.Infrastructure.dll' could not be found
9>CSC : error CS0006: Metadata file 'C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Infrastructure\bin\Debug\net5.0\ref\KonstrukteurApp.Infrastructure.dll' could not be found
9>CSC : error CS0006: Metadata file 'C:\Users\sveto\Documents\code\github\KonstrukteurApp\KonstrukteurApp\src\Infrastructure.Shared\bin\Debug\net5.0\ref\KonstrukteurApp.Infrastructure.Shared.dll' could not be found
9>Done building project "Server.csproj" -- FAILED.
========== Rebuild All: 2 succeeded, 7 failed, 0 skipped ==========

Screenshot of the Configuration tab in Properties image

I have tried multiple times to tick every checkbox on and off then hit 'Apply' every time, but to no avail.

Screenshot of the Visual Studio Installer image

Expected behavior A successful project build.

Desktop (please complete the following information):

Any help is appreciated.

MomboMan commented 2 years ago

Try dotnet restore

iammukeshm commented 2 years ago

can you disable docker-compose from build and retry?

toza-mimoza commented 2 years ago

@iammukeshm Tried that, one less error for docker only. @MomboMan That command executed just fine but the issue persists.

toza-mimoza commented 2 years ago

I have executed dotnet build .\KonstrukteurApp and with some 35 warnings built the whole project just fine. Now it runs. It's the IDE issue. Closing this. dotnet build output.txt