Visual Studio Project
Description.
The Visual Studio Project action lets you use a project created in Microsoft Visual Studio inside a ZennoDroid project. That opens up unlimited possibilities for writing and debugging code and for connecting external libraries.
Unlike the C# code action, where the code is stored in the project itself, here the code lives in a regular Visual Studio solution: with classes, inheritance, NuGet packages, breakpoints and full debugging.
Where you can use it:
- Seamless integration of third-party libraries and their use in your code.
- Creating your own libraries for reuse across different projects.
- Debugging code in Visual Studio with access to the device and to the project.
How do I add it to a project?
Via the context menu: Add action → Your code → Visual Studio Project.
How do I work with the action?
The block can work in two modes: with a Visual Studio solution or with an already built dll.
Use Visual Studio solution.

- The block's operating mode.
- Path to the solution that contains the project.
- The project that will run when the block is executed.
- Project configuration.
- Flag to merge the output dll and its dependencies into a single file with ILRepack.
- Button to switch to the Use Dll mode.
- The Connect to Visual Studio button.
- The Create new Visual Studio project button.
Use Dll.

- The block's operating mode.
- Path to the dll that will run when the block is executed.
Creating a project and connecting to Visual Studio.
- Visual Studio 2019, 2022 or 2026. The free Community edition can be downloaded from the official site. If several versions are installed, the newest one is used.
- The developer pack for .NET Framework 4.6.2, the target platform of the project (Download .NET SDKs for Visual Studio).
- Add the action and pick the Use Visual Studio solution mode.
- Click the Create new Visual Studio project (1) button.

Set the solution, the project and the configuration in the block properties and click Connect to Visual Studio (2).
- In the window that opens, fill in the project name, the location and the solution name, then click OK.

- Wait while ZennoDroid creates the solution and connects to Visual Studio.
Connecting provides the interaction between ProjectMaker and Visual Studio: the Device Window moves into Visual Studio, so the code can be debugged with access to the device and to the project. In ProjectMaker the place of the window says Browser is used in Visual Studio solution and offers a Show browser here link, while the window's toolbar in Visual Studio has a Return to ProjectMaker button — either of them brings the window back.
If the device window did not open in Visual Studio on its own, you can call it up with View → Other Windows → ZennoDroidToolWindow.
If the extension is not installed, or its version does not match the version of ProjectMaker, the program offers to install the right one. Once it is installed, connect to Visual Studio again.
Then the extension is either not installed or disabled. In Visual Studio open Extensions → Manage Extensions, go to Installed and check the state of the ZennoDroid VisualStudio Extension. If it is not on the list, restart ProjectMaker and connect to Visual Studio again. If the problem persists, please contact technical support.
Project structure.
To be usable with the action, a project has to:
- reference the ZennoDroid libraries:
Global.dll,ZennoLab.CommandCenter.dll,ZennoLab.Emulation.dll,ZennoLab.InterfacesLibrary.dll,ZennoLab.Macros.dllandZennoDroid.Interface.dll. They live in the folder of the installed ZennoDroid — the template takes the path from theZennoDroidDllPathenvironment variable, which is set when ProjectMaker or ZennoDroid starts; - contain a class that implements the
IZennoExternalCodeinterface. When the block runs, thepublic int Execute(Instance instance, IZennoPosterProjectModel project)method is called; it has to return0on success and any other value on an error.
A project created from ProjectMaker already meets these requirements. It holds a single Program.cs file with a ready implementation of the Execute method:
public class Program : IZennoExternalCode
{
public int Execute(Instance instance, IZennoPosterProjectModel project)
{
// The ZennoDroid device API
IDroidInstanceAPI droid = instance.DroidInstance;
int executionResult = 0;
return executionResult;
}
}
The instance and project objects work exactly as they do in the C# code action: instance.DroidInstance gives you the device API, and project gives you the variables and the settings of the project.
To debug the code, use the standard Start button in Visual Studio.
Record the project in ProjectMaker as usual, and write the code in Visual Studio by hand.
Using a dll.
Which makes it handy for moving a finished project between computers. All you have to do is keep the required dlls available on each of them — for example, copy them into the project folder.
Once the development in Visual Studio is over, you can switch to using the output dll directly: click the Use as dll button. A window opens where you pick what to do.

- Build the solution (a required step).
- Merge the output dll and the libraries into a single file with ILRepack. Cuts down the number of files you have to carry with the project.
- Copy the dll to the given path. The project folder macro is used by default.
- Switch the block to the Use as dll mode and set the path to the dll.
- Show the built dll in Explorer.
Then the path to the dll is set in the block properties. For a dll to be executable, it has to contain a class that implements the IZennoExternalCode interface.
Possible errors and how to fix them.
Project Target Framework Not Installed.

The developer pack for .NET Framework 4.6.2 is not installed. Download it from the official site and install it: Download .NET SDKs for Visual Studio.
Call was rejected by callee (RPC_E_CALL_REJECTED).

Visual Studio is rejecting the interaction requests coming from ProjectMaker. Most often that happens when something has to be done in Visual Studio — a dialog window has appeared, for instance. Switch to Visual Studio, do what it asks, then connect to it again. If the error is still there, restart Visual Studio; if that does not help either, please contact technical support.
Block properties render incorrectly after connecting to Visual Studio.
Notice that clicking different blocks, or a blank spot on the diagram, does not refresh the block properties correctly.

To fix this, check the Visual Studio settings — Tools → Options… → General.

A detailed description of this setting: Per-Monitor support for Visual Studio extensions.
If the option is unavailable, update Windows and Visual Studio, or follow the instructions for adding a registry key.