mowwwalker
mowwwalker

Reputation: 17392

Visual Studio C# - Compiling application?

I spent the past week learning and coding a small personal application in C#. I used dotnetbar and everything runs fine when I debug on my machine, but I want to compile everything into ONE executable file and have everything work...

I was told that the way to compile in Visual Studio was to build the solution, which puts the file in bin/release or bin/debug. I built the solution in release mode and ran the application and everything worked, but then when I transferred it to another computer to test, nothing opened and after about 30 seconds an error came up.

I assumed it was dotnetbar, so I made a new project with one button, tested it on the other computer and it worked. I added one ButtonX from dotnetbar, tested it, and it didn't open and there wasn't even an error message.

Why is this happening? Does the program need to come with the dotnetbar dlls with it, or can I compile them with the app somehow?

Upvotes: 0

Views: 849

Answers (3)

Mark Hall
Mark Hall

Reputation: 54562

Take a look at this information from DotNetBar's website. You need to either copy the files over or use a Setup Project in Visual Studio.

From above site:

DotNetBar for WPF with your applications is as simple as including the DotNetBar assemblies in the same folder as your application executable. You only need to distribute assemblies you have referenced in your project.

Following assemblies may be included:

DevComponents.WpfRibbon.dll

DevComponents.WpfEditors.dll

DevComponents.WpfDock.dll

DevComponents.WpfSchedule.dll


Edit:

Based on your comments you could try making a Self Extracting Exe or using something like ILMerge. I have not personally tried it.

Upvotes: 1

Jesus Ramos
Jesus Ramos

Reputation: 23266

It looks like there might be some missing .dll files that should be in the same folder as release. Usually you need all the files in the release folder to properly run the application (since some files you may have written could have just been created as DLL's and linked at runtime).

Upvotes: 0

Joel Martinez
Joel Martinez

Reputation: 47809

Yes, all of the dependencies need to be included ... you can't link them into your assembly. I'm assuming that this dotnetbar (never used it) probably installed itself into your GAC. If the appropriate .dll doesn't get copied into your Release folder, then you need to change the "copy local" setting on the assembly reference to true. This will copy it to the output folder, which makes it available when you deploy it.

Upvotes: 2

Related Questions