Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find the root folder on disk of the project hosting R4MVC #5

Closed
kevinkuszyk opened this issue Feb 6, 2015 · 2 comments
Closed

Find the root folder on disk of the project hosting R4MVC #5

kevinkuszyk opened this issue Feb 6, 2015 · 2 comments

Comments

@kevinkuszyk
Copy link
Member

We need to find where on disk the project.json file is for the project hosting R4MVC, so we write out our generated .cs files.

At the moment it is hard coded here.

@wwwlicious
Copy link
Contributor

Unfortunately the project object isn't on the interface for IBeforeCompileContext but is does exist via some casting against the Concrete type

CompileContext context = ((CompileContext)context);
var rootFolder = Path.GetDirectoryName(context?.Project.ProjectFilePath)

Example here

An alternative might be get the FilePath from a syntax tree and work it out using that

@artiomchi
Copy link
Member

That issue seems to be obsolete/unnecessary at this point, since writing generated.cs files is now working.

If getting the root path for the project is necessary in other scenarios, it can easily be picked up from the Workspace's Project properties

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

No branches or pull requests

3 participants