Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load type 'Orleans.CodeGeneration.KnownAssemblyAttribute' in Orleans 8.1.0 nuget packages #8956

Open
UladzimirVyaziginTR opened this issue Apr 22, 2024 · 2 comments
Assignees
Labels
Needs: investigation 🔍 Issue that needs investigation

Comments

@UladzimirVyaziginTR
Copy link

I am trying to test my code on .NET 8 via TestCluster using Microsoft.Orleans.TestingHost 8.1.0 nuget package according to the instructions from https://learn.microsoft.com/en-us/dotnet/orleans/implementation/testing. My Fixture, CollectionFixture and Exception are represented below.

public sealed class OrleansInMemoryClusterFixture : IDisposable
{
	public TestCluster Cluster { get; } = new TestClusterBuilder().Build();

	public OrleansInMemoryClusterFixture() => Cluster.Deploy();

	public void Dispose() => Cluster.StopAllSilos();
}
[CollectionDefinition(nameof(OrleansInMemoryClusterCollection))]
public class OrleansInMemoryClusterCollection : ICollectionFixture<OrleansInMemoryClusterFixture>;
System.AggregateException : One or more errors occurred. (Could not load type 'Orleans.CodeGeneration.KnownAssemblyAttribute' from assembly 'Orleans.Core.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null'.) (The following constructor parameters did not have matching fixture data: OrleansInMemoryClusterFixture orleansInMemoryClusterFixture)
---- System.TypeLoadException : Could not load type 'Orleans.CodeGeneration.KnownAssemblyAttribute' from assembly 'Orleans.Core.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null'.
---- The following constructor parameters did not have matching fixture data: OrleansInMemoryClusterFixture orleansInMemoryClusterFixture

  Stack Trace: 
----- Inner Stack Trace #1 (System.TypeLoadException) -----
ModuleHandle.ResolveType(QCallModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
CustomAttribute.FilterCustomAttributeRecord(MetadataToken caCtorToken, MetadataImport& scope, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1& derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctorWithParameters, Boolean& isVarArg)
CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable)
CustomAttribute.IsDefined(RuntimeAssembly assembly, RuntimeType caType)
ReferencedAssemblyProvider.AddFromAssemblyLoadContext(HashSet`1 parts, Assembly assembly) line 82
ReferencedAssemblyProvider.GetRelevantAssemblies() line 23
ServiceCollectionExtensions.AddSerializer(IServiceCollection services, Action`1 configure) line 40
<10 more frames...>
TestCluster.DefaultCreateSiloAsync(String siloName, IConfiguration configuration) line 661
TestCluster.StartSiloAsync(Int32 instanceNumber, TestClusterOptions clusterOptions, IReadOnlyList`1 configurationOverrides, Boolean startSiloOnNewPort) line 724
TestCluster.InitializeAsync() line 636
TestCluster.DeployAsync() line 167
TestCluster.DeployAsync() line 202
TestCluster.Deploy() line 151
OrleansInMemoryClusterFixture.ctor() line 10
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
@UladzimirVyaziginTR UladzimirVyaziginTR changed the title Could not load type 'Orleans.CodeGeneration.KnownAssemblyAttribute' Could not load type 'Orleans.CodeGeneration.KnownAssemblyAttribute' in Orleans 8.1.0 nuget packages Apr 22, 2024
@ReubenBond
Copy link
Member

This looks like an assembly version mismatch. Are you sure that all packages have been upgraded to v8.1.0?

@ReubenBond ReubenBond self-assigned this Apr 29, 2024
@ReubenBond ReubenBond added the Needs: investigation 🔍 Issue that needs investigation label Apr 29, 2024
@UladzimirVyaziginTR
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: investigation 🔍 Issue that needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants