question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

running error "The path must be absolute."

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:24 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
ProgrammerALcommented, Oct 21, 2021

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:

  • In VS 2022, create a new Blazor Server application (include Docker Support with Linux)
  • In VS, add Docker Orchestration Support for Docker Compose
  • Run the Docker Compose project in Debug mode

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:

.NET SDK (reflecting any global.json):
 Version:   6.0.100-rc.2.21505.57
 Commit:    ab39070116

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22000
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.100-rc.2.21505.57\

Host (useful for support):
  Version: 6.0.0-rc.2.21480.5
  Commit:  6b11d64e7e

.NET SDKs installed:
  3.1.414 [C:\Program Files\dotnet\sdk]
  6.0.100-rc.2.21505.57 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0-rc.2.21480.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0-rc.2.21501.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
1reaction
javiercncommented, Nov 8, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

System.ArgumentException: 'The path must be absolute. ...
One day after pulling commits from upstream and run the C# solution (projects) I got this error message in the title. The compilation...
Read more >
Error : The path must be absolute. (Parameter 'root') after ...
I tried to update HTML5 server from version Master 6973 to 1924 on IIS web server (no Docker), but now I got the...
Read more >
Help..notebook error Path must be absolute - Microsoft Q&A
hi, i have notebook in azure databricks. The source and destination paths are mounted with datalake. And when i run the notebook from...
Read more >
Mount path must be absolute : r/docker
I'm following this tutorial to get a media server up and running. Docker is running on headless Ubuntu server, and I'm using portainer...
Read more >
mount path must be absolute error (solved)
See 'docker run --help'. This is the command I'm running: docker run --rm -t -i --mount type=bind,source= ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found