0

I have spent all day trying to figure out how to publish a project I made in school. My intention is to use it as part of my portfolio for future job prospects. I have one math class left and I get my BS in CS. In school, we only created installers once and it was in Java, and I think the teacher gave us the code, which isn't that helpful for learning how to do this.

I used Visual Studio 2015 Community with Monogame to make a trivia maze game. It runs fine when I have it in VS. I do ClickOnce installer via a tutorial I found online and I cannot get it to successfully install on my machine, or any other machine for that matter. I get a .net framework exception when I try to install the game. I look at the contents of the publish folder and it does create the manifest, the setup.exe, several .dll's and even my content folder that contains my sprite sheets. I do not see any of my .cs files however. I am not sure if this is an issue. Heck, I am not sure what to completely expect from running ClickOnce.

Another thing that might be worth noting; I read something about making sure to have VS set to release instead of debug. My program will not run when I select release. It crashes when it tries to load the content. Throws an unhandledContentload exception. I am not sure if this is a symptom to my problem or anything I should be concerned about.

And maybe this is another issue; For my .cs files, the Copy to Output Directory is set to Do not copy. Could this be an issue when it comes to publishing? The build action is set to compile.

Any help would be greatly appreciated. Thanks in advance for any help.

Isaac Dee
  • 38
  • 1
  • 2
  • 10
  • Could you add more details on the ClickOnce exception? The Copy to Output Directory setting is correct and you should not see any `.cs` files, since you're publishing the compiled program and not your source code. – Petri Laarne Aug 23 '16 at 06:55
  • For the content load exception, does your bin\[...]\Release folder contain the content files? It could be an issue with the content build. – Petri Laarne Aug 23 '16 at 06:57
  • Sorry, I have been experimenting with the problem. Thank you for responding. Thank you for telling me what to expect. This is what happens when I try the installer. Everything is generated right, but when set up runs, it crashes as the program starts up. In Just-In-Time debug, it tells me there is a framework issue or something, but I can't get visual studio to work for debugging. The crash is epic. – Isaac Dee Aug 25 '16 at 20:32
  • Oh, and my content folder is created. I think it has something to do with perhaps SQL. There is also references to Entity frame work that might have occurred from a failed attempt at another database implementation. I will keep messing about. – Isaac Dee Aug 25 '16 at 20:34
  • The exact message is: An unhandled Microsoft .NET Framework exception occurred in Legend_Of_Trivia.exe [8760] – Isaac Dee Aug 25 '16 at 20:43
  • As I play around, I have another build that doesn't have the SQLite reference and it installs fine. But I have another program that uses SQLite that also installs fine. This is so bizarre. I am about ready to rebuild the project. Copy and paste, baby. – Isaac Dee Aug 25 '16 at 20:51
  • I have one more piece of information. I am using System.data.Sqlite from nuget. This seems to be where the issue is because all projects that are using SQL work but this one. I used some other package in the previous program I talked about that worked. – Isaac Dee Aug 25 '16 at 21:23
  • Okay, I did a rebuild. Several in fact. I used the same sql set up I did in the previous assignment that published correctly, and it still doesn't work. I can't figure this out. Monogame with out the SQL works, SQL with out Monogame works, but the both together doesn't seem to work. I guess I can hard code what was going into the database and see if that makes a difference. I'll let you know what I find out. It seems odd that I could compile and run a monogame project with sql but I can't publish it. I wonder what VS is doing to let it work in the context of debug. – Isaac Dee Aug 25 '16 at 22:57
  • Well, never mind guys. I did a refactor and removed the sqlite aspect of the program and now I can do a successful install. It must be something to do with monogame and sqlite not being able to work together, or I simply don't know what I am doing and screwed it up. So I guess the morale of the story is Monogame and SQLite don't play nice. – Isaac Dee Aug 29 '16 at 19:01

0 Answers0