Quantcast
Channel: RazorGenerator Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 525

Edited Unassigned: PrecompiledMvcEngine baseVirtualPath causing exception [124]

$
0
0
I have supplied a baseVirtualPath value of "Areas/Reporting" which throws the error:

The relative virtual path '~Views/home/Index.cshtml' is not allowed here.

I have traced it to IsPhysicalFileNewer Method:

```
private bool IsPhysicalFileNewer(string virtualPath)
{
if (virtualPath.StartsWith(_baseVirtualPath ?? String.Empty, StringComparison.OrdinalIgnoreCase))
{
// If a base virtual path is specified, we should remove it as a prefix. Everything that follows should map to a view file on disk.
if (!String.IsNullOrEmpty(_baseVirtualPath))
{
virtualPath = "~" + virtualPath.Substring(_baseVirtualPath.Length);
}
```

Attaching a "/" to the tilde creates a correct virtual path.

```
virtualPath = "~/" + virtualPath.Substring(_baseVirtualPath.Length);
```

Can this be verified?

Viewing all articles
Browse latest Browse all 525

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>