- Roundup
- Getting Started
- Requirements
- Adjustments
- LEEGOO BUILDER integration
- Sample script to call your assembly
This is a demonstration of how to run LEEGOO BUILDER from Visual Studio (or Visual Studio Code) to use it's debugger and to have the ability to set breakpoints to simplify script development.
This Project can be found on GitHub.
url: https://github.com/eas-solutions/TestDebugScript
It is recommended to create a fork of this repository and store it in your own private repository on GitHub.
The following requirements must be met.
- A working installation of an up to date version of LEEGOO BUILDER G3
- MS Visual Studio 2022 or another development environment
- (optional) a personal GitHub account
There are several things to be adjusted to make this project working on a developers machine.
Add a Reference to the current version of DynamicEntities_*.dll.
You find the correct assembly in the "LocalAssemblyCache" folder, typically at this location:
c:\Users\<YourUserName>\AppData\Roaming\LB.Net\LeegooBuilder.LAC\<CurrentLeegooBuilderVersion>\<UsedDataBaseName>@<HostName>\Environment\
Reference the latest file in this folder wich file matches DynamicEntities_*.dll.
When using VSCode for debugging building and executing the script file will use the .vscode\launch.json to start LEEGOO BUILDER.
The file assumes that the LEEGOO binaries are located in the Leegoo folder of the repository.
To adjust the location of the LEEGOO binaries the following entries need to be edited:
"program": "${workspaceFolder}\\Leegoo\\EAS.LeegooBuilder.Client.GUI.Shell.exe",
"cwd": "${workspaceFolder}\\Leegoo",Change the following file names according to your requirements:
- TestDebugScript.csproj
- TestDataExport.cs
Do not forget to update the namespaces.
Open TestPlugIn.csproj and change the following nodes according to your requirements:
- <TargetFramework>
- <UseWpf>
- <OutputPath>
- <AssemblyName>
- <RootNamespace>
OutputPath should point to your binaries folder (where EAS.LeegooBuilder.Client.GUI.Shell.exe is located).
Open AssemblyInfo.cs and update all relevant attributes.
[assembly: AssemblyTitle("TestDebugScript")]
[assembly: AssemblyDescription("Exsample of using DebugScript for LEEGOO BUILDER G3")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("EAS")]
[assembly: AssemblyProduct("TestDebugScript")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
...
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]Try to compile the project. No errors should occur.
LEEGOO BUILDER needs to be configured to load this assembly.
Go to the binaries folder (see above) and open script.json.
Add the following nodes.
{
"ExternalAssemblies": [
{
"AssemblyName": "EAS.LeegooBuilder.Server.DebugScript.dll",
"Description": "DebugScript"
},
{
"AssemblyName": "EAS.LeegooB
63E5
uilder.Server.DebugScript.TestExport.dll",
"Description": "TestExport using DebugScript"
}
],
"AdditionalUsings": [
{
"Name": "EAS.LeegooBuilder.Server.DebugScript",
"Description": "DebugScript"
},
{
"Name": "EAS.LeegooBuilder.Server.DebugScript.TestExport",
"Description": "TestExport using DebugScript"
}
]
}Start LEEGOO BUILDER and go to the script editor, create a new script and replace the source code with the following source code:
public override object Main(CustomScriptArgs args)
{
var scriptDebugAssembly = new TestExportData(ScriptContext, "Alfred E. Neumann");
scriptDebugAssembly.HelloWorld();
WriteLine($"return value of GetYourName(): {scriptDebugAssembly.GetYourName()}");
WriteLine($"return value of TestEntityFramework(): {scriptDebugAssembly.TestEntityFramework()}");
return null;
}Set a breakpoint in your development environment e.g. at TestExportData.HelloWorld() and start the script. Visual Studio should stop at the breakpoint.
Take a look at the displayed messagebox and the output window underneath the source code.