Update .net 5 to 6: 'The path must be absolute'

See original GitHub issue

I am updating my project from .net 5 to .net 6 and have run into an issue. The project is running VS 2022 using docker-compose and container tools on linux containers.
image

The problem comes from the .ConfigureAppConfiguration() where I am trying to pass in configuration to be shared across containers. image image

If I comment out the .ConfigureAppConfiguration() the error goes away (other than I don’t have my configuration anymore).

This worked fine previously and the only change is the upgrade to .net 6 (and corresponding nuget files) so it certainly appears to be some kind of regression. I see that a number of other issues were raised for a similar problem but appears to be different from this.

I have confirmed that “User Docker Compose V2” was not enabled.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:31 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
clintsingercommented, Dec 6, 2021

On my machine I have to manually modify the bin\Debug\net6.0\*.staticwebassets.runtime.DT.json file.

There is a ContentRoots that has my Windows absolute path but it should be the containers relative path. So in my case I change ContentRoots to look like the following (your relative path may be something else):

"ContentRoots": [
    "/app/wwwroot/"
],

As long as I don’t rebuild it stays like that.

1reaction
jkasperblcommented, Dec 6, 2021

Agreed, is there any workaround for this or information about when a fix will be available? I am experiencing the exact same issue after upgrading from .NET 5 to 6.

Read more comments on GitHub >

github_iconTop Results From Across the Web

System.ArgumentException: 'The path must be absolute. ...
In my case specifically I changed the project folder name and that was not updated in package-lock.json in directives "name":.
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 >
Path.GetFullPath Method (System.IO)
Returns an absolute path from a relative path and a fully qualified base path. GetFullPath(String). Returns the absolute path for the specified path...
Read more >
Uri.AbsolutePath Property (System)
The AbsolutePath property contains the path information that the server uses to resolve requests for information. Typically this is the path to the...
Read more >
blazor System.ArgumentException: The path must be ...
When publishing a blazor web assembly app and asp.net.core and the publishing with PublishSingleFile enabled the following occures on Linux- ...
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