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?
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?