Open vshandra opened 5 years ago
I have exactly the same issue. I am migrating from netframework/webjobs to net.core/Az-Functions and the code working on netframework is not working on netcore because of this error. Plz help. Thx
I guess this is the same problem as mine... here is the reason: CompilerServiceBase.cs
private string GetGeneratorResult(IEnumerable<string> namespaces, TypeContext context)
{
...
string path = null;
if (string.IsNullOrWhiteSpace(context.TemplateContent.TemplateFile))
{
path = Directory.GetCurrentDirectory();
}
else
{
path = Path.GetDirectoryName(context.TemplateContent.TemplateFile);
}
var razorProject = RazorProjectFileSystem.Create(path);
...
So, I think that for now TemplateFile has to contain at least "./" for path variable not to be empty
Exception is thrown from Razor .Net Core in Azure Functions v2 with custom Template manager that loads template content from DB: Value cannot be null or an empty string. Parameter name: rootDirectoryPath
Code:
Razor initialization:
Template is loaded from custom source:
Looks like the path is returned as empty string in CompilerServiceBase.cs:
Also here
StackTrace: