Skip to content

Commit

Permalink
Fixing issue with runtime policy evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocav committed Feb 21, 2020
1 parent e74710a commit 999f47e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ private static bool IsMinorMatchOrLowerPolicyEvaluator(AssemblyName requestedAss
{
AssemblyName runtimeAssemblyName = AssemblyNameCache.GetName(runtimeAssembly);

return requestedAssembly.Version.Major == runtimeAssemblyName.Version.Major &&
requestedAssembly.Version.Minor <= runtimeAssemblyName.Version.Minor;
return requestedAssembly.Version == null || (requestedAssembly.Version.Major == runtimeAssemblyName.Version.Major &&
requestedAssembly.Version.Minor <= runtimeAssemblyName.Version.Minor);
}

private bool IsRuntimeAssembly(AssemblyName assemblyName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class FunctionAssemblyLoadContextTests
[InlineData("Microsoft.Azure.WebJobs.Script, Version=3.0.0.0")]
[InlineData("Microsoft.Azure.WebJobs.Script.Grpc, Version=3.0.0.0")]
[InlineData("Microsoft.Azure.WebJobs.Script.WebHost, Version=3.0.0.0")]
[InlineData("Microsoft.Azure.WebSites.DataProtection, Version=0.0.0.0")]
[InlineData("System.IO, Version=0.0.0.0")] // System.*
[InlineData("Microsoft.Azure.WebSites.DataProtection")]
[InlineData("System.IO")] // System.*
public void RuntimeAssemblies_AreLoadedInDefaultContext(string assemblyName)
{
var functionContext = new FunctionAssemblyLoadContext(AppContext.BaseDirectory);
Expand Down

0 comments on commit 999f47e

Please sign in to comment.