> For the complete documentation index, see [llms.txt](https://docs.gapvelocity.ai/webmap-for-blazor-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gapvelocity.ai/webmap-for-blazor-documentation/blazor-ai-migrator/conversion-tool/solution-and-project-structure/solution-generator.md).

# Solution Generator

This document helps to understand the SolutionGeneration task, starting from the ProjectGeneration to the WFNetConversionTool call and settings to execute the Generation service.

First thing to understand is what ProjectGeneration does. ProjectGeneration contains the services and templates that generate the output files for a project, using some configurations. In this file, we will be focusing on the SolutionGeneration for Blazor.

We need to start talking about the Interfaces of the Abstractions. This interfaces define the properties and methods needed to execute the generation of the project.

We can find the interfaces in the Mobilize.ProjectGeneration.Abstraction project under the SolutionGenerator repository.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfFE2OzZLFyuv5ZTCXXBxoYtrynetnDVhaUIL16otwsZZS3l2ya8sq0Bm2imX8KNT70CKSC44FnWDQgVKs9f6N0Uom23Pcm9JNp8P9-qMYhHb5jYFR6ApfPmOE1LXsynzoJdv-GHucI0iSHZRG6jccZubUM?key=PBrxS4iFBj2xnpVF8M8BydlL" alt=""><figcaption></figcaption></figure>

Go to IProjectGenerator, we can find some properties. You can see this properties as parameters that the Generate task needs.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf44h3LYTvakHT7Zj7beDvxQGDk7Bf7V9DtwLcxir4f2aM8Gl4JFGSYtJiQ2Fh1zQGh87pjmN-T7HT04larIzK6RkbFozz-fa7Ib0Dtv4Hs9WwfW3y2RjtXrhWWyt3GaQzttHop3CRjrYD6BVNBaCEwhzSZ?key=PBrxS4iFBj2xnpVF8M8BydlL" alt=""><figcaption></figcaption></figure>

Pay special attention to this method definition, because this will be called inside the Task to call the generator you need.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdVnrKMTRJ_9UDSBhkbjForqaXzOEPiCprccpPC3bMUpp5-mWm39HvD8iz4oIO8lSA_9VW8tazGqIbHIip_V6ktEg27Y16D2sJB41Aupydnkpdg0RH9Rsw2FLUeqZ5sVscq-tNnnghEt3Rj9B3LCjUrFj_R?key=PBrxS4iFBj2xnpVF8M8BydlL" alt=""><figcaption></figcaption></figure>

Now that we see this Interface, we need to understand… Why is this needed? Well, let’s jump on it.

Under the same project, we have a class called ProjectGeneratorBase.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXds6rDwsIJ_8x4cZPCqtpDw0KnPwu4A1n3GgYRU3R1C5O9fw05HiyYLXiG5bRXcpuHa2fMNvj71zbN4zcGYXIBBjmCOSeIXwysZGuq3XqqeMTzDx22fnUR4mCdLx8dpFgC23xAI1F3l_NcLxyXQOk4WkGUR?key=PBrxS4iFBj2xnpVF8M8BydlL" alt=""><figcaption></figcaption></figure>

This class implements the IProjectGenerator interface. If you navigate a bit in this class, you will find the GenerateProject implementation.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdzxXu2NHBxoX9ZsKqmXaOBWaYlLruZq3ItbgUyVbxs8lqJCR9o2oU2wX76Bozldi9CjbAafpPa6syo34SxfwP_wYrO2K9FLm4UhtUmyjKdqH2kWP-6bFO4MLcoSM8D3-Rkb3v0_YjpiaqKK_Zd4fyrwhs?key=PBrxS4iFBj2xnpVF8M8BydlL" alt=""><figcaption></figcaption></figure>

Now, we need to use the template used by the respective GenerateProject. In this case, we should go into the SolutionTemplate.tt.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdI33TKCRP9ujx-MYa5EXKChBvjkUsaO53QHmEk2PON_Kaqp2M-cxFxf3wUXVmhV7IqR8Ft9AQMtKb-R1BzpXyZRUEAz2IoOQUHOz8I_Y1Lm0PLoGAG5N6rR5Qi148RWN1yLrdjJ-sgbKIG5vwF-hvhSSY?key=PBrxS4iFBj2xnpVF8M8BydlL" alt=""><figcaption></figcaption></figure>

**Avoid touching the SolutionTemplate.cs**

You can modify the template as we did here.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe9fvhiBFqctp8DXfTguN7qC1y_g1w6PbYSQLZt7vRpHCJPSrYEKzpUmEiggv-Ok1BSW5eBJhSbaspefVx5PeWnHYC_WDK-g8Vs0kFPb5oncTRNWmtxlIft2JPLiqGGnpxXtP-ir_MzasFpZZhGSbnRR2I?key=PBrxS4iFBj2xnpVF8M8BydlL" alt=""><figcaption></figcaption></figure>

And save the file. When you save, a popup is showing. Press Yes. This is to synchronize the tt with the cs(the cs is generated dynamically by handlebars).

### Pack the projects as a nupkg

To test the changes we can pack the projects locally, or, upload the changes to a branch and wait for the build to generate an alpha version.

To pack locally just run the next command under the build folder. Change the path for every csproj

{% code overflow="wrap" %}

```
nuget.exe pack 
S:\Repositories\EF\EF-TransformationCore\src\Mobilize.ProjectGeneration.Abstractions\Mobilize.ProjectGeneration.Abstractions.nuspec -version 22.33.11 -properties configuration=debug
```

{% endcode %}

### Test the changes

Once you pack the changes, you need to install the package in the WFNetConversionTool. If you pack it locally, add the build folder to the package sources in the Nuget Package Manager of Visual Studio.

Or install the alpha version if you commit the changes to a branch.

### Changes in the WFNetConversionTool

Now, is necessary to add the BlazorSolutionGenerationTask and the BlazorSolutionGenerator

Here we have our BlazorSolutionGenerator, that will set the params and config to call the GenerateProject from the ProjectGeneration.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdq97gAmTscKRNLwClz1sXiCW0WmTFnvD0RvTCfkSIWpFWOs_MmaJGyLa6otmHn2aPZ1pEadWZ7xa_EXnxpo7mJnh0AZQu1CrOe3jAt2FuTnxHDYs_xpviMApTBho6E44h_UtYZ5XjCODEzRQKIuSC0H-0?key=PBrxS4iFBj2xnpVF8M8BydlL" alt=""><figcaption></figcaption></figure>

Here in the Run method, we need to pass the config to the SolutionGenerationParams

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe7cQYQgeuGFH-0FdZLWXJFlW6DFiodlUZXzOjHgp19EA3vd9xdsJhFYKd6XeR21LIaJasBT9zPplygM1vNQ_rVEMUP4_JjHIy_ltET1IkEnyoMp--smQCAl7vaJDw1vpC_1Y8ULqWDe-VJxP0SekjBhGg?key=PBrxS4iFBj2xnpVF8M8BydlL" alt=""><figcaption></figcaption></figure>

And now, we can call the BlazorSolutionGenerator from the Task.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcji_9wopNPBbQTWVBmEb-0RTVdArQ1Anb7H15ToKuiQrzi-q3o-hFzJ7We7tTVbbbSTr_BxtJKtq35GUDJhZ7P3xoL8NKnjvKQ3bdi8qecklYfmt0PQtpimfVfNz5qs72x87zYr5k427Isk4r-jhE2XzeX?key=PBrxS4iFBj2xnpVF8M8BydlL" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gapvelocity.ai/webmap-for-blazor-documentation/blazor-ai-migrator/conversion-tool/solution-and-project-structure/solution-generator.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
