WebMap for Blazor
  • WebMap Blazor
    • Modernization
      • Overview
      • Modernization Challenges
      • Our solution
      • What is Blazor?
      • How does Blazor Work?
      • Windows Forms in Blazor
      • Deployment
      • Interfacing with hardware devices
    • Research for Blazor
      • Handling Reference Parameters in Async Methods with Ref<T>
      • Alternatives to Async Properties in C#
      • Issue with using "MessageBox.Show" in Blazor
    • Assessment Tool
    • Conversion Tool
      • Getting Started
      • Modals and Dialogs
      • Static Service Management
      • ImageListStreamer
      • Solution and Project Structure
        • Solution Generator
    • DCP: Desktop Compatibility Library
      • API Documentation
        • Blazor DCP: Gap.Blazor.Application Class Reference
      • Components Information
        • Button Component
        • Application Data Component
        • GroupBox Component
        • Label Component
    • Post Conversion
      • How To?
        • Create a new WebMap Window?
        • Create a new WebMap Component?
        • Create a native Blazor Window in a WebMap app?
        • Create a native Blazor Component in a WebMap Window?
        • Change the default WebMap visual layout?
    • WebMap: Angular vs Blazor
      • Footprint
      • Binaries size
      • Chatiness
      • Performance
      • Extensibility
      • Maintainability
      • Debugging
      • Project Structure
    • WebMap for Blazor Release Notes
      • Beta version
    • FAQ
    • Errors and Troubleshooting
    • License
Powered by GitBook
On this page
  • Pack the projects as a nupkg
  • Test the changes
  • Changes in the WFNetConversionTool
Export as PDF
  1. WebMap Blazor
  2. Conversion Tool
  3. Solution and Project Structure

Solution Generator

PreviousSolution and Project StructureNextDCP: Desktop Compatibility Library

Last updated 5 months ago

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.

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

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

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.

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

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

Avoid touching the SolutionTemplate.cs

You can modify the template as we did here.

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

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

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.

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

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