Closed Allon-Guralnek closed 8 years ago
@Allon-Guralnek - Could you try too see if PR #911 helps address this problem?
Still would need to fix the Orleans.Runtime.nuspec file to capture the missing dependencies, but the above PR should help soften the assembly references to just use short assembly name for matching.
@jthelin - This would only affect the build process, not the runtime binding which fails. It would produce the exact same assembly and the same exceptions. The requirement in .NET is that signed assemblies only reference other signed assemblies. Since the OrleansRuntime assembly is signed, it's not possible to reference Microsoft.Framework.DependencyInjection, which is unsigned. So a signed version is created in the build process, before compilation, so you end up referencing aa signed version. There's nothing you can change in the project files to fix this. From what I understand, there are only three options:
I think https://github.com/dotnet/orleans/pull/910 is the actual solution for this. Redistributing somebody else's binaries with altered identities seem like a very bad idea to me.
When is Microsoft.Framework.DependencyInjection.* due to move from beta to released? At that point it would be signed (I assume). Seems like all of this "goes away" by using a DI package that is signed? Is there a strict need to use Microsoft.Framework.DependencyInjection, especially being that its in pre-release?
@amccool Being one of the people in favor in the original DI discussion (I don't recall the discussion thread now, @attilah and others may correct me), the discussion was that should we roll our own to Orleans or take advantange of what coming to the .NET framework at large. The idea here is of "least friction", pit of success, familiarity, taking advantange of work elsewhere etc. between parts of .NET. It looks like happens so we are early with this on Orleans and this signing hassle was a bit unanticipated.
In general it looks signing is a hassle and there a recent change to CoreCLR too, more at https://github.com/aspnet/Announcements/issues/86 (https://github.com/aspnet/dnx/issues/2157 and some others too, I see).
Looks like this issue was solved by #910, right?
Yep, solved.
Pull request #827 added to
OrleansRuntime.dll
the following two assembly references:These are required for staring a silo. If they can't be found, the following exception is thrown:
Unfortunately, these two dependencies haven't been added to the appropriate .nuspec file, so they aren't installed automatically. But the real issue is, installing those NuGet packages manually doesn't solve the problem. After they're installed, you get the following exception when starting a silo:
This is caused by
OrleanRuntime.dll
referencing a private version of theMicrosoft.Framework.DependencyInjection.Abstractions
assembly that is signed during build (this is done using a pre-build event, at OrleanRuntime.csproj:238). This private version is not available outside the Orleans build process. Using the publicly available assembly that you get from installing theMicrosoft.Framework.DependencyInjection
NuGet package doesn't satisfy the assembly reference, since the public key token is different. Therefore, any silo that uses the OrleansRuntime NuGet package built from a version of Orleans after pull request #827 fails to start with the above exceptions.