Merge generated projects into my Main project

Posts   
 
    
timbered
User
Posts: 45
Joined: 09-Feb-2020
# Posted on: 20-Nov-2021 01:34:09   

Hi!

Using version Llblgen 5.7.

Is there an easy way to merge my generated VS projects into my main code project, without having to manually change all the Using statements?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 20-Nov-2021 06:49:31   

Hi there,

I'm not sure I follow you. Please elaborate more on the desire result.

David Elizondo | LLBLGen Support Team
timbered
User
Posts: 45
Joined: 09-Feb-2020
# Posted on: 23-Nov-2021 05:24:44   

daelmo wrote:

Hi there,

I'm not sure I follow you. Please elaborate more on the desire result.

When Llblgen generates code, it generates a Visual Studio project for each given model. So, what I usually do is add that project to my solution, add a reference to that project, and use the Entities in my main application - the main application being a second project within the same solution.

The result of this is two files: An Llblgen DLL and my main application Exe.

My question is, is there a way to combine the Llblgen project (actually, really just the generated code project folders) into my main project - and end up with one Exe?

If I manually move the generated code into my main project, it seems that the generated code has to have all its Import/Using statements modified to reflect that its now within an outer namespace.

Instead of

Imports LlblgenName.HelperClasses

in the Llblgen generated code, it has to be changed to

Imports MyMainProjectName.LlblgenName.HelperClasses

What I don't want to do is have to change all those Imports statements in the generated code.

Will it work if I put my main project's Namespace in the Root Namespace of the Generate Code dialog? I.e., put "MyMainProjectName.LlblgenName" instead of just "LlblgenName"?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 23-Nov-2021 09:50:45   

VB.NET is notorious with its namespaces, so it's a bit of a struggle. It's the easiest to just keep the assembly separated. If you want to distribute only one exe file tho, you can merge the compiled assemblies into one exe using Costura Fody: https://github.com/Fody/Costura It is a simple set and forget solution which merges everything at compile time or distribute time. But honestly, I wouldn't worry about it, everything is distributed with a couple of dll's nowadays.

Frans Bouma | Lead developer LLBLGen Pro
timbered
User
Posts: 45
Joined: 09-Feb-2020
# Posted on: 23-Nov-2021 19:38:14   

Yea, it's not a big deal, just wondering if there was an easy way to do it.

I'll take a look at Costura Fody - thanks for the info!