Why does Visual Studio start when opening a WindowsApplication.exe file? - vb.net

I have a VStudio2012 solution for a Windows form app that has been compiled and runs fine for me when I launch it from myproject\bin\debug\utility.exe (the mainform comes up fine and the program runs fine).
I am trying to get a colleague familiar with the program and when he creates a shortcut to the above program and opens the utility.exe by doubleclicking it, then VStudio comes up instead of the mainform of the app.
Is there any way to achieve this without getting into some deployment scenario? I would like to leave this utility.exe where it is now and just get somebody else to run it from there? Is this possible?

Your friend is opening the .config file, not the .exe.
See "hide extensions for known file types"

Related

Test VB.Net Application as if Vb were not installed

I have created a VB.Net application that I plan to distribute using the .exe file in the Release folder. Upon sending this to a user, I was informed that it would not run on their system. The exe runs fine on my system no matter the location of the file so it's not a folder dependency. I don't have easy access to another computer, so is there an easy way to test my file as if visual basic were not installed on my system?
Edit: By "does not run" I mean nothing occurs when the exe is clicked

VB.NET program Behaves Differently When Run From Shortcut vs Program Folder

I created a VB.net application that, among other things, uses two DLLs to update the firmware on a microprocessor. It works perfectly during debugging.
To distribute it, I used InstallShield LE to create an installer. If I install the program and run from the Start Menu or Desktop icon, the program works - except for that part that uses the DLLs... that fails part of the way through.
The kicker is that if I go to C:\Program Files (x86)\programName\ and run the .exe from there everything works perfectly.
When I run from the shortcuts or from the actual directory and go to Task Manager and view the process properties, it lists the same directory. So I am under the assumption that the shortcuts are properly referencing the correct location.
So, how can running from a shortcut affect the running of the .exe?!
Thank you for your help.
-Mschmidtbauer

Publish WinForm that uses .dll in one file

How can you publish a WinForm that uses a .dll extension into one .exe file? I'm using VB.NET on Visual Studio 2013.
I have tried several methods such as using only the program .exe file from both the Debug and Release folder but these didn't work in isolation - a runtime error happened every time a command from the extension was used, as if it didn't exist.
My problem is packaging the entire program into one file. I don't want to have to use ClickOnce applications because you can't use a custom logo and so it kinda looks bad. I'll use it if there's no alternative.
I realised that the answer was to use the setup.exe file when publishing. Also, changing the logo of a ClickOnce program is possible.

VB.NET Debug Button Disabled

I am using Visual Studio Ultimate. I have made a fairly long program which worked fine.
One day I find that the debug button was disabled and both the build and rebuild buttons do not work. I have tried opening the same project files in Visual Basic Express 2010 but still, the sane problem.
I don't really want to have to reinstall but I'm not even sure that that will fix the problem. Thanks in advance.
Is there a startup project? One project in the Solution Explorer should be in bold. Right-click the executable project and select "Set as StartUp Project". Additionally, open the Project Properties, Application tab, and ensure Application type is either "Windows Forms Applications" or "Console Application".
Did you try to reset the setting of your Visual Studio Ultimate?
Type: (In your visual studio command prompt)
devenv /resetsettings
Buttons disabled for just that program, or all programs?
I vaguely remember having a similar problem many years ago. Re-creating the project and solution files fixed it, I think (ie. create a new solution/project and import all the .vb files).
Another thing to check would be whether the compiled files have become read-only. Maybe VB.NET can't delete the old .EXEs
You need to build a test application. I think thats more difficult then making the application itself. In my personal opinion, your better off building the whole software in a notepad.
http://msdn.microsoft.com/en-us/library/ms182532.aspx

OpenFileDialog fails on Win7

My installer needs to open a file browse dialog. As there is no file browse dialog provided by WIX I have written a C# dll containing a method to invoke the standard OpenFileDialog when called by a Custom Action. However while this works fine in Win2003 the Custom Action just hangs when run on Windows 7. It seems to get as far as the ShowDialog() call then stop. As a test I have written a separate Windows Forms app with a single dialog and button to invoke the OpenFileDialog and, as expected, that works fine. I just can't get the OpenFileDialog to appear from within my msi!
I suspect it may be a security thing so I ran the installer from msiexec opened as Administrator but with no difference!
Does anyone have any ideas how to fix this?
Many Thanks.
// create a new thread with appropriate apartment state to launch UI
OpenFileDialog fileBrowser = new OpenFileDialog();
Thread worker = new Thread(fileBrowser.Show);
worker.SetApartmentState(ApartmentState.STA); // <-- here is the magic code
worker.Start();
worker.Join();
When I attempted this I found it was popping up behind the other MSI windows. Until I figured this out, it looked just like a hang.
For this and a whole heap of other reasons, I ended up writing a bespoke install mechanism and ditching MSI. Much friendlier on the user and their system in the end.