aspnetcore: running error "The path must be absolute."
error on bare template
Describe the bug
ran the template in docker and got an error when running on windows everything is fine
To Reproduce
create .net core web application with docker (linux)
Exceptions (if any)
Exception thrown: 'System.ArgumentException' in Microsoft.Extensions.FileProviders.Physical.dll
An unhandled exception of type 'System.ArgumentException' occurred in Microsoft.Extensions.FileProviders.Physical.dll: 'The path must be absolute.'
Stack trace:
> at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters)
> at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root)
> at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.<>c.<UseStaticWebAssetsCore>b__2_1(String contentRoot)
> at Microsoft.AspNetCore.Hosting.StaticWebAssets.ManifestStaticWebAssetFileProvider..ctor(StaticWebAssetManifest manifest, Func`2 fileProviderFactory)
> at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest, Boolean isJson)
> at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssets(IWebHostEnvironment environment, IConfiguration configuration)
> at Microsoft.AspNetCore.Hosting.BootstrapHostBuilder.RunConfigurationCallbacks()
> at Microsoft.AspNetCore.Builder.WebApplicationBuilder..ctor(Assembly callingAssembly, String[] args)
> at Microsoft.AspNetCore.Builder.WebApplication.CreateBuilder(String[] args)
> at <Program>$.<Main>$(String[] args) in C:\PROJECTS\Others\Uztelecom\Uztelecom.Web\Program.cs:line 2
Further technical details
- ASP.NET Core 6 preview 7 ,
- Include the output of
dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.7.21379.14
Commit: 22d70b47bc
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\
Host (useful for support):
Version: 6.0.0-preview.7.21377.19
Commit: 91ba01788d
.NET SDKs installed:
6.0.100-preview.4.21255.9 [C:\Program Files\dotnet\sdk]
6.0.100-preview.6.21355.2 [C:\Program Files\dotnet\sdk]
6.0.100-preview.7.21379.14 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-preview.6.21355.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-preview.7.21378.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0-preview.5.21301.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.6.21352.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.7.21377.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.5.21301.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.6.21353.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.7.21378.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
- visual studio 2022 preview 3
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 24 (7 by maintainers)
Hi, not sure if this is the right place to put this or if I should make a new issue. But I’m seeing this same issue with .NET 6 RC 2 when running a new application through Docker Compose.
Repro Steps:
I’m running Visual Studio 17.0.0 RC2 and .NET 6.0.0-rc.2.21480.5.
I assume it an issue in other project types too, but I only checked Blazor Server.
Here’s my output from
dotnet --info
:For folks using docker-compose, there’s a separate docker-compose issue that we are fixing in VS. See https://github.com/dotnet/aspnetcore/issues/37876 for details on how to deal with it.
For other folks, if your issue is not about docker compose, please file a separate issue so that we can track the issue properly.
I have the same problem testing directly on a linux host.
Host (useful for support): Version: 5.0.9 Commit: 208e377a53
.NET SDKs installed: No SDKs were found.
.NET runtimes installed: Microsoft.AspNetCore.App 5.0.9 [/home/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.9 [/home/dotnet/shared/Microsoft.NETCore.App]
UPDATE: Same on Ubuntu and Alpine