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

Forward slashes in project.json paths don't work when trying to include files in a sibling folder #559

Closed
dsplaisted opened this issue Aug 21, 2014 · 2 comments
Assignees
Milestone

Comments

@dsplaisted
Copy link

I'm trying to include some source code in my project from another folder. The following works:

"code": "..\\Serilog.FullNetFx\\**\\*.cs",
"exclude": "..\\Serilog.FullNetFx\\**\\*-net40.cs"

However, if I use forward slashes, it doesn't include any of the source files:

"code": "../Serilog.FullNetFx/**/*.cs",
"exclude": "../Serilog.FullNetFx/**/*-net40.cs"

It seems like forward slashes do work when they are describing a path in the current directory (ie "**/*.cs"), but not with a path that begins by going up one level with "..".

@desdesdes
Copy link

I was also wondering what the proper path separator would be when you want to be able to open or build a project on both windows and linux. Should you always use / or \ or would both be converted to the platform path separator. Personally i would prefer always using the / as the only valid path separator because in linux / is just a valid character in a file or directory name, so this would prevent some problems. It might be a good idea to document this in the project.json and global.json documentation.

@davidfowl
Copy link
Member

I'll try it out but / is supposed to work (and did last time I tried). @desdesdes The correct way to work cross platform is to use / always, we're not going to automatically convert \ to / everywhere in the stack so best it's best if the right slashes are used for relative paths.

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

5 participants