Program doesn't start from VS, but starts from .exe

This forum is meant for questions and discussions about the X# language and tools
Post Reply
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Program doesn't start from VS, but starts from .exe

Post by ic2 »

I received a zipped solution from Kees, which I could compile after Unblocking some .resx files. Now what happens is that it doesn't do anything when I start it. Even when I select Start debugging with a breakpoint on the InitializeComponent.

However, the last compiled exe (e.g. in the..Debug directory) runs without any problem when doubleclicked from Explorer.

What I tried is to Unload both projects, remove bin and obj directory, reversed it all, Clean, Rebuild, restart. Originally it showed an endless rolling cursor with "Working on it" but that disappeared when I closed all tabs and reopened again.

But I still can't start this project from the IDE. What could cause this, and how can I solve it?

For Kees, starting from the IDE obviously works.

Dick
User avatar
Chris
Posts: 4910
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Program doesn't start from VS, but starts from .exe

Post by Chris »

Hi Dick,

Does the project contains both libraries and executables? If yes, right click on the executable project that you want to run in the Solution Explorer and select "Set as startup project". Maybe this makes it work as expected now?

.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Program doesn't start from VS, but starts from .exe

Post by ic2 »

Hello Chris,

Yes, but the executable project is the startup project (in bold). Set it again to be sure, but no change.

I copied the whole project to another Pc. This has an older X# 2.8.3.15 (release) and my Pc has 2.11.0.1 (release). It didn't start either but also directly starting the exe failed. In the Windows Application log says this:


Framework-versie: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Info: System.MissingMethodException
at <Module>.$AppInit()
at iConnectEmail.Exe.Functions.Start()


But there's a normal Public Constructor in the program which starts with Self:InitializeComponent() .

And after all, the solution starts on the IDE on Kees' PC, the exe starts on my Pc and the copied exe doesn't start on where I copied it.

I am a bit out of clues what to check next.

Dick
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Program doesn't start from VS, but starts from .exe

Post by robert »

Dick,

> Info: System.MissingMethodException

This sounds like DLL hell.
Does Kees have the same version of X# on his machine?
Are you using DLLs that are not part of the solution (as assembly reference) and are they the same.
Is it possible that there is an older version of that DLL in your GAC ?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Program doesn't start from VS, but starts from .exe

Post by ic2 »

Hello Robert,

Eventually the exe also worked on the computer where I copied everything, which makes DLL hell unlikely. No idea why it gave the error mentioned earlier. Everything I do with Visual Studio seems to work or not work randomly...

I don't have the GAC checked when installing X#. All references point to the latest X# redist directory and Kees also has the latest X# (or at most 1 version earlier). To be sure I removed all X# references and reapplied them, pointing again to the X# Redist directory. The solution uses a Chilkat DLL and 2 specific HTML from the Zoople HTML editor. The references to these DLL point to the files in the project themselves. I copied these DLL's to the work directory with the DBF files, to be sure but still: the exe works, F5/Ctrl F5 is doing nothing....

Dick
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Program doesn't start from VS, but starts from .exe

Post by robert »

Dick,
Without seeing the project and the contents of the various folders it is hard to tell what could be causing this.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Program doesn't start from VS, but starts from .exe

Post by ic2 »

For future readers: Chris had a look at the solution, and as usual, found the cause.

Kees recently found out that in Project properties/Debug you can set a working directory so you don't have to duplicate all kind of files in a Debug and Release subdirectory. This is great.

But in this case, I took over Kees' project with a working directory/disk filled in which I didn't have. Then the project doesn't start.

Chris logged this issue so a future X# will show an error when this directory does not exist. And I could point Chris to smaller Intellisense issue which is logged too.

As I wrote Chris: it again shows how valuable the Fox program is, and I think there's no support program which can (even closely) match Fox in terms of solving issues. The cause found within a few hours after sending the solution and no doubt, an error message to deal with it will be implemented in a version released in the distant future.

I've posted some serious VS issues on Microsoft's developer site. If Microsoft's "feedback bot" isn't killing someone's message, the chance is minimal that a VS engineer really takes a look at it, and even if you get that done (always months after your first post, check out the developers site) the chance is still minimal hat it will ever be solved. What a contrast with X#.

Dick
User avatar
Chris
Posts: 4910
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Program doesn't start from VS, but starts from .exe

Post by Chris »

Dick, thanks for your nice words!
Btw, Robert has fixed the problem just now :)

.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply