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

Using "..\" in a Layout path doesn't work #6020

Closed
sebastienros opened this issue Mar 23, 2017 · 4 comments
Closed

Using "..\" in a Layout path doesn't work #6020

sebastienros opened this issue Mar 23, 2017 · 4 comments
Assignees
Labels

Comments

@sebastienros
Copy link
Member

Repro:
Create a Layout in the parent folder of the view and reference it like this:
Layout = "..\\MyLayout.cshtml";

NB: In Orchard so might affect the behavior.

@Eilon
Copy link
Member

Eilon commented Apr 11, 2017

Does it work with forward slashes?

BTW what exactly "doesn't work"? Bad file path exception thrown? View not found? Where did it look?

@pranavkm pranavkm self-assigned this Jul 14, 2017
@pranavkm pranavkm modified the milestone: 2.1.0 Jul 14, 2017
@pranavkm
Copy link
Contributor

I tried this out and seems to works fine. We did fix a bug in preview2 (#6448) where paths returned by ViewLocationExpanders that contain back slashes wouldn't have worked. Perhaps you were hitting this? Let me know if you're still seeing this in preview2 \ RTM bits.

@Eilon Eilon added this to the 2.1.0 milestone Jul 17, 2017
@jtkech
Copy link

jtkech commented Aug 1, 2017

Just tried with @sebastienros with a <AspNetCoreVersion>2.0.0-*</AspNetCoreVersion>.
We can confirm that Layout = "../_Layout.cshtml;" works.

@pranavkm
Copy link
Contributor

pranavkm commented Aug 1, 2017

Thanks @jtkech

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

No branches or pull requests

5 participants