MapWinGIS C#.Net Winform app without install

Sorry to ask an old question. A previous post asked how the VB program implements registration-free COM. The general idea is that by changing the settings in VS, VS will automatically generate a manifest file after compilation, and copy MapWinGIS OCX and all of its dependencies into your executable directory.
MapWinGis VB.Net without install
I am using the C# winform program, but I did not find the setting for the second step in the above post.
How do I set up the C# winform program? Thank you.
I am very sorry for asking for a question that has been answered before.

Hello @Henry

In a c# app, the References are listed in the right-hand treeview rather than in the Project Properties. In there, you will find the Isolated property for both AxMapWinGIS and MapWinGIS. See below:

Regards,
Jerry.

Note that the project I have shown is not set up for Isolation; I just used it for the snapshot.

awesome. After copying the debug folder to the client machine, without installing MapWinGIS, double-click the exe to run the program directly.

However, I also want to publish this program through ClickOnece, instead of letting customers copy a folder containing a lot of dlls. The specific operation is: in the VS development environment, right-click on the project and select publish. After the program is released, an installation package will be generated. The user double-clicks the installation package exe, the program will be installed on the machine. But after this operation, MapWinGIS cannot be packaged together. What should I do? Thank you.

Hello @jerryfaust

Can you help me again?

We don’t want users to copy a folder containing dlls. We want to publish the program and let users install the program (the specific operation is: by right-clicking the project in Visual Stidio and selecting “publish”).

So, how to publish a MapWinGIS-based program on the development machine, and the client machine can use the published program without installing MapWinGIS?

Best regards,
Henry.

Hello @Henry

I confess that I’ve never used the Publish feature, and don’t know exactly what it does. My best guess is that you would need all of the files to be seen as references (even though they are only run-time dependencies, and not build-time dependencies). I really don’t know.

I guess if you find or figure out an answer, you could post it here for others.

Regards,
Jerry.

Thank you for your patient answers. However, when referencing the dll in the C:\dev\MapWinGIS folder, an error will still be reported. Let me see if there are other solutions.

Best regards,
Henry.

It is not likely the Interop or the OCX, it is likely all of the other required files (GDAL, GEOS, etc.) that are stored in the MapWinGIS bin directory, but have to be in your applications bin directory in order to use registration-free COM.

Jerry.

Hello @jerryfaust

Thank you for your answer.

I tried to follow your method and add dlls as references. First, I copy the dll in the C:\dev\MapWinGIS folder to the bin directory of the program. Then, I added a dll reference (dll in the bin folder) in Visual Studio. I encountered such an error, as shown in the picture below.

Therefore, I cannot reference these dlls as build-time dependencies. In fact, the essence of the latter problem is how to package the dlls for publishing.

Best regards,
Henry.

It seems that the problem can be solved by directly adding the dll to the project (instead of adding the dll in the reference). As shown below.

Best regards,
Henry.

Excellent. Thank you, Henry, for sharing that. Glad you got it resolved.

Thank you for your selfless help.

Best regards,
Henry.