Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

ConfigurationBuilder.GetBasePath() does not return an absolute path on Mono #336

Closed
muratg opened this issue Nov 12, 2015 · 9 comments
Closed
Assignees
Milestone

Comments

@muratg
Copy link

muratg commented Nov 12, 2015

OS X, Mono. builder.GetBasePath() returns .. Same code run on CoreCLR returns an absolute path.

This breaks builder.Build().ReloadOnChanged("appsettings.json") in the templates.

@Eilon
Copy link
Member

Eilon commented Nov 13, 2015

@pranavkm can you see if this is a Mono issue or a bug in our code?

@Eilon
Copy link
Member

Eilon commented Nov 13, 2015

And is there any relationship to #334 ?

@peterblazejewicz
Copy link

We have the same findings when updating generator-aspnet:
OmniSharp/generator-aspnet#466 (comment)
OmniSharp/generator-aspnet#465 (comment)
Thanks!

@aggieben
Copy link

@Eilon looks to me to be an exact duplicate of #334. It doesn't bother me at all if you want to close that one and deal with the problem here.

@Eilon
Copy link
Member

Eilon commented Nov 16, 2015

@aggieben looks like the other one was closed as a dup of this instead 😄

@Eilon
Copy link
Member

Eilon commented Nov 16, 2015

Oops just re-read that. Today is opposite day. Or maybe it isn't opposite day.. Hmm...

@pranavkm
Copy link
Contributor

@davidfowl, it looks like the issue is with the APP_CONTEXT_BASE_DIRECTORY that gets set:

APP_CONTEXT_BASE_DIRECTORY: .
AppDomain.BasePath: /home/prkrishn/.dnx/runtimes/dnx-mono.1.0.0-rc2-16249/bin/
Current Directory:/home/prkrishn/src/ConsoleApp2/src/ConsoleApp2

Would this property continue to exist with the CLI? If not, should we just use the AppDomain.BasePath \ Directory.GetCurrentDirectory() instead? If the property would continue to exist, we can simply expand it and that should suffice (or have DNX expand it when it populates it).

@divega
Copy link

divega commented Dec 14, 2015

Had a chat with @pranavkm. APP_CONTEXT_BASE_DIRECTORY is not DNX specific. We actually set it in DNX to make AppContext.BaseDirectory have the right value (see aspnet/dnx#2662), so it appears we would need to make sure it gets the right value on Mono.

@muratg
Copy link
Author

muratg commented Dec 14, 2015

So is the fix supposed to be in DNX? If that's the case, since DNX is being retired, perhaps we should test this with dotnet CLI, and file bug in dotnet/cli repo.

cc @anurse

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants