Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 883 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Some files in "wwwroot" folder are not published in ASP.NET Core web deploy

#1
I am using ASP.NET Core 2.0 in Visual Studio 2017.

My site works fine when I hit debug in [IIS Express][1]. But when deploying the site to IIS server, not all the folders and files in wwwroot are deployed. I have looked at the .csproj file, but I don't know how to make sure it deploys all files and folders.

[1]:

[To see links please register here]


Reply

#2
I solved the issue. The solution is to edit the .csproj file.

Remove all the `ItemGroup` tags related to wwwroot and then add this one:

<ItemGroup>
<None Include="wwwroot\*" />
</ItemGroup>

The asterisk will include all the subfolders and files.


Reply

#3

```
<PropertyGroup>

<EnableDefaultContentItems>false</EnableDefaultContentItems>
</PropertyGroup>
```

```
<ItemGroup>
<Content Include="wwwroot\**\*">
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
</Content>
</ItemGroup>
```
Reply

#4
It's working for me
```
<ItemGroup>
<None Include="wwwroot\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
```
Reply

#5
Notice to myself:

when you stumble over this issue again (like it happened twice already), double check whether the `wwwroot` content is really committed to git, and the build agent *has* the files to publish, or if there is an exclusion of `wwwroot` in (any) `.gitignore`

:facepalm:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through