4

I complied my C# windows forms application on Visual Studio 2008 with configuration "Release". When I try to run it on another computer, no windows are shown at all. Complied on Windows 7, another computer has windows xp installed. What can it be?

Added: I didn't create any installer. Another machine has .net framework 3.0, not 3.5 installed, but simple hello world application works just fine. I tried to copy the program to another folder on my computer - no changes.

Sergey
  • 47,222
  • 25
  • 87
  • 129
  • 4
    It could be anything. Insufficient rights, missing assemblies, missing settings, ... The folks here are going to need more details. – Mike Chess Feb 21 '10 at 20:52
  • 1
    No errors appear, nothing in the application log, no trace of the process in Task Manager? – Michael Todd Feb 21 '10 at 20:53
  • 1
    Its bombing out before the window can be drawn. Are you trapping an error and not throwing it or logging it? Assuming the other computer does have .NET 3.5 runtime. Have you tried launching from a command line? Anything returned? Anything running in the task manager? What is memory utilization doing? – Rob Fuller Feb 21 '10 at 20:54
  • Another computer has .net framework 3.0 installed. – Sergey Feb 21 '10 at 20:59
  • @Sergey: no _code_ appears, either. Please post some code. In fact, create yourself a simple "hello, world" program, and try to make it run on the other machine. If it doesn't run, post the code here. – John Saunders Feb 21 '10 at 20:59
  • Did you actually create an installer for this program, or just copy the binary? Although a simple copy *might* work, it's very likely that there are a whole bunch of missing dependencies. – Aaronaught Feb 21 '10 at 21:01
  • @Sergey: have you tried copying the program to a different folder on your own computer and running it? Copy it the same way you did to the other computer, but copy it to a different folder on your own computer. – John Saunders Feb 21 '10 at 21:06
  • Hello world application works. Even with .net framework 3.0. What code do you mean? – Sergey Feb 21 '10 at 21:06
  • Yes, I tried copying the program to a different folder on my own computer and running it. Everything works. – Sergey Feb 21 '10 at 21:08
  • @Sergey: maybe you should install .NET 3.5 on the other computer? – John Saunders Feb 21 '10 at 21:17
  • I commented the part with some file operations and it worked on another machine. Why can it happen? – Sergey Feb 21 '10 at 21:20
  • 1
    IMO, it doesn't really make much difference why. When you're deploying an application, you create an installer (or use ClickOnce). Simple as that. Almost no non-trivial application today can be successfully deployed by simply copying over a few files. – Aaronaught Feb 21 '10 at 21:22

9 Answers9

5

Create a setup program instead of simply copying the files. This will help determine if you are missing anything such as .net fw 3.5.

Otávio Décio
  • 73,752
  • 17
  • 161
  • 228
4

You said:

Another machine has .net framework 3.0, not 3.5 installed

If you configured your project to run with .NET 3.5 then you MUST install it on the other machine.

Sameh Deabes
  • 2,960
  • 25
  • 30
3

There are a lot of possibilities, from permission problems to difference in installed framework versions. Consider adding a deployment project, at least then all your dependencies will be taken care of, removing a large set of possible issues.

Edit: We won't really be able to help without more details though.

David Božjak
  • 16,887
  • 18
  • 67
  • 98
3

I agree with everyone. There are a lot of things that could go wrong. Here is my take on this issue. Are you spawning any threads when application starts up? If so, make sure you child threads are not failing and if you're doing any exception handling, keep in mind that you will not be able to catch exceptions in child threads from the main thread as they don't bubble up and will essentially be swallowed. Just a heads up.

3

Double check on the .NET version, if you built a release against .NET 3.5, and the other machine does not have .NET 3.5, that must be installed I'm afraid, not alone that, don't forget the Service Pack 1 as well. Have a look at this SO thread here to determine the .NET version that is installed, run it on the computer that 'appears to be broken' to see what version...

Community
  • 1
  • 1
t0mm13b
  • 34,087
  • 8
  • 78
  • 110
2

Try running your program from a command prompt. Sometimes a message will be dumped to the console. I'm going to guess that it has to do with the .net version though.

CodingWithSpike
  • 42,906
  • 18
  • 101
  • 138
1

Simply add another form in your solution explorer and copy your source code from previous form to the new form and also from form designer to new form designer.

Matt
  • 74,352
  • 26
  • 153
  • 180
1

Start your program and afterwards take a look in windows Event log. You will find an error entry in windows protocols application. There are maybe two entries. It tells you the reason.

Patrick
  • 907
  • 9
  • 22
0

Run your app in a console, prefixing with dotnet:

dotnet yourapp.exe

it gave me more logs to deal with.

Joe Mayo
  • 7,501
  • 7
  • 41
  • 60