DevPartner 2018 Workshop : Maximize Your Traditional Synergy Development with Visual Studio

Exercise 6: Executable Library to .Net Assembly

Previous Exercise Home Next Exercise

This is the sixth of a series of exercises that demonstrate the abilities of developing Synergy inside Visual Studio.

If you have not completed the previous exercises you can find the first one here.

This exercise will take our existing code from our object and executable libraries and create a native Windows .NET assembly using Synergy .Net. Throughout the exercise you will make changes to elements of the Visual Studio solution and see the powerful MSBUILD sub-system in action.

To begin the exercise, follow these simple steps:

This will create a .NET assembly project. After the project is created it will open up the Class.dbl file. Close this window. We can also delete the default source file from the project:

To ensure the correct version of the software is built:

We already have all the source code we require for this library – it is part of the OnVinylObjectLibrary project. Our goal is to reference the existing source files so as not to make a copy of them. This will ensure that we only have a single copy across multiple projects:

All of our existing source files will be added to the OnVinylAssembly project. If you inspect the properties for any of the included source files, the “Full Path” specification should be the OnVinylObjectLibrary folder.

Now we can try to execute the build process:

At this point our OnVinylAssembly project fails to build.

We are missing the same references that our Executable Library requires – the Synergy/DE UI Toolkit. Luckily, Synergex provide a .NET version which we can reference:

Now we can try to execute the build process:

At this point our OnVinylAssembly project may still fail to build. The errors this time are data related – it can’t find the repository.

If your project builds this is a result of “environment bleed” which is discussed here. The repository environment variables become part of the solution and not specific to each project. It is recommended that the following step is still completed to ensure that the project continues to build correctly.

Our repository project can be consumed by both Traditional Synergy and Synergy .NET projects:

Now we can try to execute the build process:

Again our OnVinylAssembly project may fail to build. If the project does build, this is again because of “project bleed”. Any errors this time are due to the fact that the project can’t find various include files that contain certain application values:

Now we can try to execute the build process:

Success! At this point there is nothing to execute so a successful build means the exercise is complete.