You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.
ChromelyBlazor.WebAssembly shouldn't know anything about ChromelyBlazor.WebAssemblyApp because ChromelyBlazor.WebAssemblyApp is using ChromelyBlazor.WebAssembly
If you add any NuGet that has its own wwwroot content to the ChromelyBlazor.WebAssembly and use it there like this: <link href="_content/Blazorise/blazorise.css" rel="stylesheet" />
or like this: <script src="_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js"></script>
then Solution 1 will not work, because _content directory will not be created in the app directory.
Solution 2:
you have to publish ChromelyBlazor.WebAssembly so that _content directory will be created (it is not created on build, only on publish)
create a folder publish profile named FolderProfile.pubxml in ChromelyBlazor.WebAssembly
Visual Studio will save it as ChromelyBlazor.WebAssembly\Properties\PublishProfiles\FolderProfile.pubxml
publish will automatically create a wwwroot folder inside ChromelyBlazor.WebAssemblyApp\bin\x64\Debug\net6.0\win-x64 so we have to rename app to wwwroot in our code
change config.StartUrl = "http://app/index.html"; to config.StartUrl = "http://wwwroot/index.html";
change new UrlScheme(DefaultSchemeName.LOCALREQUEST, "http", "app", string.Empty, UrlSchemeType.LocalResource, false)
to new UrlScheme(DefaultSchemeName.LOCALREQUEST, "http", "wwwroot", string.Empty, UrlSchemeType.LocalResource, false)
Problem 1:
xcopy
doesn't work on LinuxProblem 2:
ChromelyBlazor.WebAssembly
shouldn't know anything aboutChromelyBlazor.WebAssemblyApp
becauseChromelyBlazor.WebAssemblyApp
is usingChromelyBlazor.WebAssembly
Solution 1:
ChromelyBlazor.WebAssembly
:ChromelyBlazor.WebAssemblyApp
:Problem 3:
ChromelyBlazor.WebAssembly
and use it there like this:<link href="_content/Blazorise/blazorise.css" rel="stylesheet" />
or like this:
<script src="_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js"></script>
then
Solution 1
will not work, because_content
directory will not be created in theapp
directory.Solution 2:
ChromelyBlazor.WebAssembly
so that_content
directory will be created (it is not created on build, only on publish)FolderProfile.pubxml
inChromelyBlazor.WebAssembly
ChromelyBlazor.WebAssembly\Properties\PublishProfiles\FolderProfile.pubxml
ChromelyBlazor.WebAssemblyApp
:wwwroot
folder insideChromelyBlazor.WebAssemblyApp\bin\x64\Debug\net6.0\win-x64
so we have to renameapp
towwwroot
in our codeconfig.StartUrl = "http://app/index.html";
toconfig.StartUrl = "http://wwwroot/index.html";
new UrlScheme(DefaultSchemeName.LOCALREQUEST, "http", "app", string.Empty, UrlSchemeType.LocalResource, false)
to
new UrlScheme(DefaultSchemeName.LOCALREQUEST, "http", "wwwroot", string.Empty, UrlSchemeType.LocalResource, false)
You can see a working solution here: https://github.com/Jinjinov/Ididit/blob/main/Ididit.Wasm.Chromely/Ididit.Wasm.Chromely.csproj
The text was updated successfully, but these errors were encountered: