You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/ExtensionsMetadataGenerator/src/ExtensionsMetadataGenerator.Console/ExtensionsMetadataGenerator.Console.csproj
// Don't log this as an error. This will almost always happen due to some publishing artifacts (i.e. Razor) existing in the
58
-
// functions bin folder without all of their dependencies present, or native package artifacts being copied to the bin folder
59
-
// These will almost never have Functions extensions, so we don't want to write out errors every time there is a build.
60
-
// This message can be seen with detailed logging enabled.
61
-
logger.LogMessage($"Could not evaluate '{Path.GetFileName(path)}' for extension metadata. If this assembly contains a Functions extension, ensure that all dependent assemblies exist in '{sourcePath}'. If this assembly does not contain any Functions extensions, this message can be ignored. Exception message: {ex.Message}");
62
-
}
63
56
catch(Exceptionex)
64
57
{
65
58
logger.LogError($"Could not evaluate '{Path.GetFileName(path)}' for extension metadata. Exception message: {ex.Message}");
@@ -82,44 +75,109 @@ public static string GenerateExtensionsJson(IEnumerable<ExtensionReference> exte
logger.LogMessage($"Could not determine whether the attribute type '{attributeTypeName}' used in the assembly '{fileName}' derives from '{WebJobsStartupAttributeType}' because the assembly defining its base type could not be found. Exception message: {ex.Message}");
Copy file name to clipboardExpand all lines: tools/ExtensionsMetadataGenerator/test/ExtensionsMetadataGeneratorTests/ExtensionsMetadataGeneratorTests.cs
@@ -42,17 +47,17 @@ public void Generator_DifferentTargetFrameworks()
42
47
// plus the two from the 2.1 and 2.2 test projects.
43
48
JTokenextensions=json["extensions"];
44
49
intstartups=extensions.Count();
45
-
Assert.Equal(4,startups);
50
+
Assert.Equal(6,startups);
46
51
47
52
Assert.Single(extensions, e =>e["name"].ToString()=="Foo"&&e["typeName"].ToString().StartsWith("ExtensionsMetadataGeneratorTests.FooWebJobsStartup, ExtensionsMetadataGeneratorTests"));
48
53
Assert.Single(extensions, e =>e["name"].ToString()=="BarExtension"&&e["typeName"].ToString().StartsWith("ExtensionsMetadataGeneratorTests.BarWebJobsStartup, ExtensionsMetadataGeneratorTests"));
54
+
Assert.Single(extensions, e =>e["name"].ToString()=="TestFunctionsStartup"&&e["typeName"].ToString().StartsWith("ExtensionsMetadataGeneratorTests.TestFunctionsStartup, ExtensionsMetadataGeneratorTests"));
49
55
Assert.Single(extensions, e =>e["name"].ToString()=="Startup"&&e["typeName"].ToString().StartsWith("TestProject_Core21.Startup"));
50
56
Assert.Single(extensions, e =>e["name"].ToString()=="Startup"&&e["typeName"].ToString().StartsWith("TestProject_Core22.Startup"));
57
+
Assert.Single(extensions, e =>e["name"].ToString()=="Startup"&&e["typeName"].ToString().StartsWith("TestProject_Razor.Startup"));
51
58
52
-
// We cannot read TestProject_Razor.dll because it has a dependency we cannot find. Make sure
53
-
// we log correctly even though we've skipped this assembly.
Assert.Contains("Could not evaluate 'TestProject_Razor.dll' for extension metadata. If this assembly contains a Functions extension, ensure that all dependent assemblies exist in ",log.ToString());
59
+
// We log a message here, but have successfully found the TestProject_Razor.Startup.
60
+
Assert.Contains("Could not determine whether the attribute type 'Microsoft.AspNetCore.Razor.Hosting.RazorExtensionAssemblyNameAttribute' used in the assembly 'TestProject_Razor.dll' derives from 'Microsoft.Azure.WebJobs.Hosting.WebJobsStartupAttribute'",log.ToString());
56
61
}
57
62
finally
58
63
{
@@ -63,42 +68,53 @@ public void Generator_DifferentTargetFrameworks()
Copy file name to clipboardExpand all lines: tools/ExtensionsMetadataGenerator/test/ExtensionsMetadataGeneratorTests/ExtensionsMetadataGeneratorTests.csproj
0 commit comments