Dino Novak asked 2022-09-04 11:14:16 UTC
Hi,
currently I am able to successfully run Wisej3 app in linux docker container (.net6).
Current app is actually multiple apps that are joined under one umbrella with separate wisej app acting as portal.
this means that I am able to run app within portal app by referencing other app assembly and user control using reflection (see code below)
var rootDir = Path.GetDirectoryName(Application.ExecutablePath);
String filePath = System.IO.Path.Combine(rootDir, "other_app.dll");
System.Reflection.Assembly asm = System.Reflection.Assembly.Load(File.ReadAllBytes(filePath));
Type type = asm.GetType("other_app.ucMain");
Wisej.Web.UserControl mainUC = (Wisej.Web.UserControl)Activator.CreateInstance(type);
var container = this.mainPanel;
container.Controls.Clear(true);
mainUC.Dock = DockStyle.Fill;
mainUC.Parent = container;
This is neat trick and works flawlessly so far. The only drawback is that as projects are referenced published app contains all other project outputs.
From micro services/segmentation perspective you can develop app separately, but still when publishing this is all merged to single app/container.
Is here a way to reference userControl from separate apps from some kind of portal app if apps are running separately (as separate dotnet processes/containers)?
Thanx,
D
Dino Novak asked 2022-09-04 11:14:16 UTC
Hi,
currently I am able to successfully run Wisej3 app in linux docker container (.net6).
Current app is actually multiple apps that are joined under one umbrella with separate wisej app acting as portal.
this means that I am able to run app within portal app by referencing other app assembly and user control using reflection (see code below)
var rootDir = Path.GetDirectoryName(Application.ExecutablePath);
String filePath = System.IO.Path.Combine(rootDir, "other_app.dll");
System.Reflection.Assembly asm = System.Reflection.Assembly.Load(File.ReadAllBytes(filePath));
Type type = asm.GetType("other_app.ucMain");
Wisej.Web.UserControl mainUC = (Wisej.Web.UserControl)Activator.CreateInstance(type);
var container = this.mainPanel;
container.Controls.Clear(true);
mainUC.Dock = DockStyle.Fill;
mainUC.Parent = container;
This is neat trick and works flawlessly so far. The only drawback is that as projects are referenced published app contains all other project outputs.
From micro services/segmentation perspective you can develop app separately, but still when publishing this is all merged to single app/container.
Is here a way to reference userControl from separate apps from some kind of portal app if apps are running separately (as separate dotnet processes/containers)?
Thanx,
D