Code generation

Also referred to as Codegen.

MDriven can generate C# code for projects in Visual Studio.

If you have several Packages, you probably need them to use code access package boundaries. Then, add the name of the other packages in the Property Inspector for the Package.

Why do you have to CodeGen and when to upload model to MDrivenServer

There are 3-4 places with a model - and they should be the same for things to work.

  1. Your model - this place is used when pressing play in the designer
  2. MDrivenServer - this is used for all PS calls coming to the server, and from the webui in the server
  3. Your compiled code (it is reflected back to model when you start the ecospace in runtime)
  4. If you utilize codedress - the model assemblies are uploaded to the MDrivenServer and reflected in order to use the c# code for model methods.


We will assume that Your model is the latest and correct. Now refresh your code with the C# button - and possibly right click c# and generate all - then Build. The assemblies now has the correct model.

Then "Upload model" - if you use CodeDress - your assemblies are sent to the server now - that is why it is good practice to have compiled your generated code - so you don't risk sending old assemblies with old model to MDrivenServer.

Now start you local App, or your turnkey server,

Troubleshooting: Code generation not working

This page was edited 72 days ago on 09/01/2024. What links here