0

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?

2
  • Are you sure that the other computer you tested on has the appropriate version of the .NET Framework installed? There is no way of creating a .NET application that does not require the .NET Framework to be installed. Commented Jan 3, 2012 at 3:33
  • Yeah, I tried testing it with the dotnetbar dll and it worked, so the only problem is that I need to include the dll, which I want to have inside the application. Commented Jan 3, 2012 at 3:40

3 Answers 3

2

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.

Sign up to request clarification or add additional context in comments.

4 Comments

It's possible to do it though. I have applications I've downloaded that use dotnetbar but are only one executable file.
Chances are you already had them installed, or the app you downloaded used a bootstrap installer that installed them on your behalf. In either case, .NET doesn't support linking, and those dependencies have to be there one way or another
Neither of those two... I was told it used some kind of dependency compiler that eliminated the need for external files.
Well yes, there are 3rd party tools such as Salamander .NET from remotesoft (remotesoft.com/linker), but it's not something that is directly supported by .net. I explicitly excluded mentioning it because (IMO) it's almost always an unnecessary thing because the dependency system in .net is so flexible.
1

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.

2 Comments

Someone had mentioned it before and I wasn't too inclined to figure out how to use it, but I ended up getting it anyway and it worked, so thanks :D
@Walkerneo No problem, glad to be of help
0

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).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.