C# Project : Build Folder : Build a project on a computer and run it on another computer

1

I have a C# project. To run it, I need to provide 2 arguments.

I want to create a build folder, that I can just copy/paste on another computer and run in the future. First, I build the project on a computer, then I copy/paste the build folder on another computer (I use Remote Desktop Connection). The build folder contains executable, configuration file (XML) and .dll files.

When I run the program on the second computer, I had this response on the console : System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {99AEA70E-4D13-44BF-A878-33345CBFCBC8} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

I checked .NET Version on both computer and it is the same version.

I tried different case of build (Configuration : Release and Platform : Any CPU/x64/x86).

I saw some things like ClickOnce but I can't use it because of the 2 arguments.

Moreover, to run this project, I use a UI (same for both computer). The UI work on both computer. This update configuration file and run the project. On the first computer (we build the project on this one), the program works correctly. On the second computer, the UI works and when I run the program through UI, I have the issue above.

Are there any solution to fix this issue ? I found some solution but they are old and they doesn't work.

c#
build
visual-studio-2017
asked on Stack Overflow Sep 24, 2019 by Alicia

2 Answers

1

As mentioned in the comment, you are using a COM Component, which might need to be installed on your second computer as well.

There may be a way, when you locate the references, find the respective DLLs and copy them with your Executable. If you have a look at the RedemptionLoader, Dmitri is doing exactly, what you need to do, to load the types from the DLLs in there.

However, make sure to have everything in one assembly, that uses the types in question, when using them without installing the COM Component. Otherwise you will get weird error messages.

answered on Stack Overflow Sep 24, 2019 by Andreas
0

Thanks for your answers. It helps me to understand the issue.

So, this program permits to do some things with Photoshop. On the first computer, I have Photoshop CS6 and on the a second one I have Photoshop CC. To fix the issue, I will create a build folder for Photoshop CS6 and another one for Photoshop CC.

I tried to copy/paste the build folder from the first computer (with Photoshop CS6) on a third computer, with Photoshop CS6 too. This works !

The issue was caused by the version of Photoshop.

answered on Stack Overflow Sep 24, 2019 by Alicia

User contributions licensed under CC BY-SA 3.0