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

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.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 31 (4 by maintainers)

Most upvoted comments

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.

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.

@cdavernas the fix will ve available in a future VS 2022 update.