1

My project is split up in several smaller libraries each doing it's own part (one for the views, one for some logic, ...)

This all gets loaded and initialized in main-project.csproj.

When debugging, every screen is loaded correctly.

However when I publish the folder is not generated as expected. I'm using the following publish command:

dotnet publish ..\..\main-project.csproj -r win10-x64 -c Release -o publish\

Release folder main-project:

win10-x64/
├─ Properties/
│  ├─ launchSettings.json
├─ Views/
│  ├─ _ViewStart.cshtml
│  ├─ ...
├─ wwwroot/
│  ├─ favicon.ico
│  ├─ ...
├─ some.service.exe
├─ some.service.dll
├─ ...

Published folder

publish/

├─ wwwroot/
│  ├─ _content/
│  │  ├─ ClientService/
│  │  │  ├─ favicon.ico
│  │  │  ├─ ...
├─ some.service.dll
├─ some.service.exe
├─ ...

As you can see, the Views and Properties folders are missing, and my wwwroot folder has several subfolders generated.

I have no idea on how to resolve this. So any suggestions are more than welcome

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Kiwi
  • 2,713
  • 7
  • 44
  • 82
  • Can you help us understand what files you are missing in your published directory? `Views` contains source code, which is compiled into your dll. The `launchSettings.json` file is for development and not needed in the final built project. – omajid Jan 29 '21 at 19:41

1 Answers1

1

Problem was resolved by including the following in the library project:

<PropertyGroup>
    <StaticWebAssetBasePath Condition="$(StaticWebAssetBasePath) == ''">/</StaticWebAssetBasePath>
</PropertyGroup>

https://stackoverflow.com/a/59574845/1229158

Kiwi
  • 2,713
  • 7
  • 44
  • 82