CodeDress
No edit summary
No edit summary
Line 35: Line 35:


Knowing these 2 limitations we avoid to include the eco.***.dll assemblies in the Modlr file assets. On the server the GAC is rarely a problem - but it may be a problem for the prototyping CodeDress functionality in MDrivenDesigner.
Knowing these 2 limitations we avoid to include the eco.***.dll assemblies in the Modlr file assets. On the server the GAC is rarely a problem - but it may be a problem for the prototyping CodeDress functionality in MDrivenDesigner.
<html>
<div class="video">
  <div class="video__wrapper">
  <iframe src="https://www.youtube.com/embed/nuNktUpn-cg?rel=0&autoplay=0" frameborder="0" allowfullscreen></iframe>
</div>
<div class="video__navigation">
  </div>
</div>
</html>


===== Problem solving =====
===== Problem solving =====

Revision as of 09:35, 27 October 2018

Overview

MDriven Framework has always used strongly typed c# code to represent the model.

MDriven Turnkey has used a strict declarative interpretation of the model to create the run-time model that the system follows .

The new functionality dubbed CodeDress close the Gap between these 2 strategies.

With CodeDress you can write strongly typed c# code in Visual Studio and make that code be the implementation in a Turnkey site.

This is how it works

The assemblies created with MDriven Framework will be uploaded to the MDrivenServer included as Assets in the Modlr zip file.

The collecting and packing will only happen if you have an <ModelName>_AssetsTK folder next to your model - this is the trigger for any asset modlr file inclusion.

The original assemblies should be on relative path from your model at either bin/debug or at ../bin/debug.

The assets that represent this code will be expanded into the site into a directory named ModelCodeAssemblies.

Note! You need to give your IIS app pool user rights to create files and folders in the web server file system where you have your MDrivenServer. Use Windows folder security, add user on local machine IIS APPPOOL\{app pool name}, For example "IIS APPPOOL\DefaultAppPool" or, important, if you have named you app pools "IIS APPPOOL\xxxxxx" Press "Check names" button. Then OK. Give the app pool user Modify rights.

When a Turnkey typesystem is to be created the ModelCodeAssemblies folder is scanned and if it contains assemblies that has classes that has identities in their UmlElementAttributes that match what Turnkey see in the model file based typesystem - then the type typesystem is dressed with these classes so that when an object of this type is created (as a new objects or a as an object read from persistent storage) the class from the assembly is used.

This is where it can be used
2017-03-14 22h40 05.png

CodeDress is implemented in MDrivenServer and as such you can make use of it in ServerSide ViewModels. CodeDress status can be seen in the MDrivenServer ModelVersionAdministration. See image.

CodeDress is used in Turnkey and as such you can make use of it in ViewModels and Actions. CodeDress status is included in Developer/ServerInfo page available when site is in debug mode.

CodeDress is also implemented in the MDrivenDesigner prototype functionality - including Wecpof.

Complexities associated with CodeDress

When loading assemblies in runtime we must make sure that shared assemblies are of the same version. With shared assemblies I mean all the eco.***.dll assemblies that are part of the framework and will be part of your MDrivenFramework code and will be part of MDrivenServer and MDrivenTurnkey and MDrivenDesigner.

Since versions discrepancies will be common we have implemented the AssmemblyResolve functionality available in .net. This functionality makes it possible for use to prefer the loaded version of an assembly rather than the actually referenced version. This works very good but there are 2 limitations that we need to be aware of: 1 If the assembly version consider to be wrong is available in the GAC - then the AssmemblyResolve will not be able to intercept its loading. 2 if the assembly version consider to be wrong is available next to the your code assembly (same search path) then the AssmemblyResolve will not be able to intercept its loading.

Knowing these 2 limitations we avoid to include the eco.***.dll assemblies in the Modlr file assets. On the server the GAC is rarely a problem - but it may be a problem for the prototyping CodeDress functionality in MDrivenDesigner.

Problem solving

Check user rights of the AppPool user

This page was edited 8 days ago on 05/02/2024. What links here