-1

I have created a win form application in c# with sqlce. I followed the steps here http://erikej.blogspot.dk/2013/10/sql-server-compact-4-desktop-app-with.html making some tweaks along the way since I was using sqlce 3.5 .net and that blog was talking about 4.0 .net.

When I finished the application, I created a set up project and build it which gave me an msi and setup file.

Now when I run this set up on my own machine where I developed the applicaton, it works a charm.

I tried it on a friend's machine as well, it worked well, he had visual studio 2010 as well on his machine.

Now when I tried it on 2 other machines with VS, after installation, on launching the exe, it launches and immediately closes, I do not see anything although.

I know it launches as i look at processes from my task manager it shows it in there for like 3-4 seconds and its gone.

I tried using this Not able to run the .exe file created from c# where i wrapped the try and catch around all the code inside the root win form but no text file was created with any errors.

On doing some research, it says it could be because I am missing some dll's, how do i make sure all the dlls from the references would be copied into the project ? I set all dll's to true for copy local.

Is this something else and not related to dlls?

I really just want to be able to install the application on any machine without any problems.

Thank you for your time.

EDIT

I need to add that this was a project that involved using an XBox controller sending data to a wireless receiver that was hooked to a PC. I used the XNA framework to intercept these and display some form of output on the Win Forms.

Community
  • 1
  • 1
Shawn Frank
  • 4,381
  • 2
  • 19
  • 29
  • So the main form is never shown on the faulty machines ? Are you doing some database call in the form's constructor ? If so, can you comment them out and test again ? – Luc Morin Jan 29 '14 at 01:01
  • Yes I am, I commented it out again with the same result. I also was referencing some XNA files. I added them as content and deployed it again with the commented out LINQ code, same result - exe executes for a few seconds, I see it in the processes and then its gone but nothing comes on the screen. – Shawn Frank Jan 29 '14 at 09:28
  • You say that you put a try/catch around all of the code in the win form, but look again at the post that you reference. They suggested wrapping around the Main() content. This is an important distinction. The fact that you are getting nothing right now just shows that you never reach that try/catch block. Also, are you sure these other computers have the correct prerequisites, like the correct version of the .Net framework? – Mark Bailey Feb 03 '14 at 21:40
  • Hi Mark, I actually firgured out the issue. It was compatible with both 32 and 64 bit and it was not a sqlce issue. The problem was that the XNA framework needs to be installed as a prerequisite in order for the application to run. I think I did not mention the XNA bit as I am using an XBox controller to send requests to a windows form. It's sorted out now and thanks for pointing that out, it will helpe me in future projects. – Shawn Frank Feb 04 '14 at 17:16
  • If you write that up briefly as an answer to your own question, and then mark that answer as the correct answer, you may end up helping someone with a similar question someday. And maybe they'll +1 your question and your answer. – Mark Bailey Feb 04 '14 at 20:51

1 Answers1

0

When packing and installing/deploying an application that makes use of the XNA DLLs on another non developer machine, the XNA framework needs to be installed.

My solution was packing my application along with the xna installer and so the xna framework installs as a prerequisite and then my application installs and then it no longer crashes.

Thanks to mrlucmoring and Mark for their support and troubleshooting.

Shawn Frank
  • 4,381
  • 2
  • 19
  • 29