Open agross opened 1 year ago
Someone else reported the *.cs.cs problem. I honestly don't know if it's an issue or not TBH, but I also don't know how to reproduce that
Found it! The duplicate file extension is unrelated to the types not loading. It's the Application Assembly.
Wolverine (0.9.12) handles the Application Assembly differently from Marten. Marten docs:
Just like ASP.Net MVC, Marten uses the IHostEnvironment.ApplicationName property to determine the main application assembly. If that value is missing, Marten falls back to the Assembly.GetEntryAssembly() value.
Wolverine 0.9.12 uses the assembly that runs UseWolverine()
by default and no "detection magic" beyond that. Since in my solution UseWolverine()
placed in a class library and not the main "web" assembly codegen writes the *.cs.cs
files to, the generated code cannot be found.
That makes sense. That’s not a permutation I’d anticipated, but other folks have had completely different project structures. I think I’m the end it’s going to require a lot more docs about this, and maybe a unified codegen, resource config model between marten and wolverine. I started a GH discussion about that just yesterday. I’m on a family vacation starting today, so I’ll be out until mid next week. I’ll try to catch up fast when I’m backSent from my iPhoneOn Mar 9, 2023, at 1:37 AM, Alexander Groß @.***> wrote: Found it! The duplicate file extension is unrelated to the types not loading. It's the Application Assembly. Wolverine (0.9.12) handles the Application Assembly differently from Marten. Marten docs:
Just like ASP.Net MVC, Marten uses the IHostEnvironment.ApplicationName property to determine the main application assembly. If that value is missing, Marten falls back to the Assembly.GetEntryAssembly() value.
Wolverine 0.9.12 uses the assembly that runs UseWolverine() by default and no "detection magic" beyond that. Since in my solution UseWolverine() placed in a class library and not the main "web" assembly codegen writes the *.cs.cs files to, the generated code cannot be found.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
I've seen both the GH discussion and that you are on vacation. Please enjoy your time off!
I'm not touching this other than documentation until after 1.0. I think it'd be worthy to consider any changes as part of https://github.com/JasperFx/marten/discussions/2522
This will be done as part of Wolverine 4.0 and Marten 8.0 later this year
I was attempting to pregenerate the code for the handlers and found that it did not work while enforcing static loading only (Marten's code is fine and works with static type loading). Is the additional
.cs
file extension is an issue?With
options.CodeGeneration.TypeLoadMode = TypeLoadMode.Static
this is logged as soon as a handler is invoked: