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
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?
The text was updated successfully, but these errors were encountered:
Also, you can specify the path to load pre-built binaries with: options.ApplicationAssembly = yourAssembly.
To give you my example, I have logic to check the environment at startup so that in production, I point the ApplicationAssembly to my prebuilt binary and use TypeLoadMode.Auto (as a graceful fallback in case I forget to pregenerate types) while in dev I use TypeLoadMode.Dynamic.
Edit: ok my mistake, hadn't seen the second error line, but the configuration options to check are the same for Marten anyway. Hope my answer is helpful to you somehow.
I have a custom document store
And startup for it
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
builds the project and then throws an error
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?
The text was updated successfully, but these errors were encountered: