Skip to content

Any codegen command fails with ExpectedTypeMissingException: Could not load expected pre-built types #3647

Open
@amid0

Description

I have a custom document store

public interface ICustomStore : IDocumentStore { }

And startup for it

services.AddMartenStore<ICustomStore>(sp =>
            {
                var options = new StoreOptions();
                options.DatabaseSchemaName = "custom";
                options.Schema.For<MyEntity>();

                return options;
            })

Both this thing is placed in the common assembly
It's used in two different services
MySolution.Api and MySolution.BackgroundWorker
The idea is that one of the projects writing to the separate storage and the second is reading.

The problem appears when I'm trying to pre-build code in the main project.
using

dotnet run -- codegen write

builds the project and then throws an error

info: Wolverine.Configuration.HandlerDiscovery[0]
      Searching assembly MySolution.Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null for Wolverine message handlers
[red]ERROR:[/]JasperFx.RuntimeCompiler.ExpectedTypeMissingException: Could not load expected pre-built types for code file ICustomStoreImplementation1112837882 
(Marten.Internal.SecondaryStoreConfig`1[MySolution.Common.MartenStorage.ICustomStore]) from assembly MySolution.Api, Version=1.0.0.0,   
Culture=neutral, PublicKeyToken=null. You may want to verify that this is the correct assembly for pre-generated types.

Suppose that it does not look to the referenced assemblies and the is no options to specify additional assemblies to look for.

Is there any workaround on that?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions