Unable to start/debug program - visual-studio-2010

I recently installed Visual Studio 2010 to help me with some exercises for class.
It all worked great in school but when I got home and tried to run and debug the second program I got this error:
Unable to start ...\Kapitel_1\Debug\Kapitel_1.exe
This application has failed to start because the application configuration is incorrect. Review the manifest file for possible errors. Reinstalling the application may fix this problem. For more details, please see the application event log.
How can this be solved?

This message generally means that the machine on which you built the application did not have the same redistributables than the system where you run the application.
Redistributables are sets of DLLs needed for your application to run properly.
In your case, I noticed that you are trying to run a debug build. That might just be the problem: you cannot run an application or use a DLL that has been built in debug configuration on a system with no debugger installed. Installing Visual Studio (ideally the same version your school has) should do the trick. You could also rebuild your application in Release configuration to avoid having to install a debugger on the running system.
Another case where this error message might be displayed is if you just installed a new Visual Studio update on the system that built the application and not on the system where you are trying to run it. In that case, you would need to update your system with the latest set of redistributables from Microsoft (at time of writing, here was a good place to look for that).

Related

How to Deploy a Windows Service using Visual Studio 2017 Community

Working with VS2017 Community I have written a service that works on my local machine. I followed the instruction here:
https://learn.microsoft.com/en-us/dotnet/framework/windows-services/walkthrough-creating-a-windows-service-application-in-the-component-designer
and installed it successfully using Installutil.exe (as per instructions in above link). All good.
I now want to deploy that across six servers in our organisation. In Microsoft's documentation about installing services (https://learn.microsoft.com/en-us/dotnet/framework/windows-services/how-to-install-and-uninstall-services) it says:
If you’re a developer who wants to release a Windows Service that users can install and uninstall you should use InstallShield
and links to a page that applies to VS2012 (can't post any more links as my reputation<10)
I have downloaded and installed the "Microsoft Visual Studio 2017 Installer Projects" package, which allows me to create a Setup Project. When I run it, it installs the project output correctly (i.e. copies the exe & dll files to the correct folder in Program Files) but does not create the service.
There's a detailed post about deploying services on this site (question 9021075) but when I follow those instructions I get a 1001 error on Install.
All the documentation I can find refers to earlier versions of VS or the previous Installer package, so I'm not even certain if I can do it with the software I am using.
So, with VS2017 Community using Microsoft Visual Studio 2017 Installer Projects, how to I create a stand-alone Installer to deploy a service that works correctly when installed locally using InstallUtil?
Or can I use InstallUtil on the target machines? I think I'd need to install Visual Studio on them for that, which I'd prefer not to. Is there a quicker way?
I only have 6 servers to install this on, so even some manual work-around might do.
Thank you for the responses. I now have a solution. I found InstallUtil on the Target Server (in my case it was in C:\Windows\Microsoft.NET\Framework64\v4.0.30319 but search will find it). I copied and added that to my project as content so when I now deploy it, I have InstallUtil in the same folder as my EXE.
To install, I run CMD as admin, cd to project folder and issue command:
installutil.exe myService.exe
This is a one-off task. Once the service is working, to update it I just need to stop it, upload the new myService.exe (& any DLLs) to overwrite the old ones and restart it again.
Further information about settings you're using for the serviceProcessInstaller1 and serviceInstaller1 files will be needed to debug this issue, as the 1001 error raised by the installer is a generic error.
An alternative way of doing this is to use Topshelf, which is a framework for hosting services written using the .NET framework. It simplifies the creation of services, allowing developers to create a simple console application that can be installed as a service using Topshelf. The reason for this is simple: It is far easier to debug a console application than a service. And once the application is tested and ready for production, Topshelf makes it easy to install the application as a service.
Alternatively, you could use InstallUtil.exe. It is part of the .NET Framework, so no need to install Visual Studio.

SideBySide Application Error

I've got an application that has been built with TideSDK.
When trying to run the application on the machine that it was packaged with (runs Windows 8) the application works no problem. When I try to run this program on a Windows Vista machine that I've got, I get a
"The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail."
error.
Here's the event viewer information:
Activation context generation failed for "C:\Users[blah blah blah]\Program.exe". Dependent Assembly Microsoft.VC80.CRT, processorArchitecture="x86", publicKeyToken="1fc8b3b9a1e18e3", type="win32", version="8.0.50727.4053" could not be found. Please use sxstrace.exe for detailed diagnosis.
Some solutions say to update windows or reinstall visual c++ redist.
Do these errors signify a needed windows update or visual c++ redist reinstallation?
Thanks in advance!
Vince
Hi The MSVC Redistibutable files are outdated in your system. You need to install "Microsoft Visual Studio 2005 Service Pack 1" Redistributables.
they can be found here: http://www.microsoft.com/en-us/download/details.aspx?id=14431

Error debugging worker role in Azure

All the sudden started getting the following error while trying to debug a worker role:
"Windows Azure Tools for Microsoft Visual Studio
There was an error attaching the debugger to the role instance 'deployment16(360)blah blah' with Process Id: '8780'. Unable to attach. The Microsoft Visual Studio Remote Debugging Monitor has been closed on the remote machine."
Restarting Visual Studio and the machine do not help.
As you start getting this problem all of sudden in your development machine something must have changed and it is mostly due to some of the OS auto-update and/or some application update you installed in your machine. There could be any random reason for this problem however if I would have hit the exact same problem here is what I would do to troubleshoot such issue:
To start, first thing is to just check it is not an application specific problem by creating a base app from web/worker template and see if that exhibit the problem.
If you have installed new release Windows Azure SDK 1.7 check with both SDK 1.6 and 1.7 to verify if both exhibit the problem.
Check if your could debug IIS based application as well outside Compute Emulator. This will isolate if the problem is specific to Windows Azure development Fabric or bind to your IIS itself.
If this is IIS specific issue, Check IIS configuration for all enabled functionalities, try resetting Application Pool configuration, running "ASPnet_regiis -i" etc to fix the issue.
If it is Windows Azure Computer Emulator specific, I know sometime OS updates may make application unstable so in that case, I will re-install .net 4.0 and VS2010 SP1 again respectively. (This does help so many time) then re-install Azure SDK 1.7 completely.
Such random problem mostly occur due to some change in your machine configuration, so restoring the VS2010 and the re-installing all other application does help to solve problems.
If you have an exception in the role's OnStart() or in Application_Start() that the debugger doesn't pick up, you may also receive this message. Application_Start() errors are especially pernicious because the debugger doesn't attach to the web process until after this method returns.
If you are wedded to cloud specific classes such as RoleEnvironment and cannot make the web role a startup project, you can use Ctrl-F5 to run the cloud project without debugging. With some luck you'll get a yellow screen of death to show you the true error.
Avkash covers the points.
I had the same issue recently. I set my web project as start-up rather than Azure and I discovered that that web project didn't actually run. Turned out somehow when of my projects was compiling for X64. I changed that and it worked.

VB6 Application Silently Crashes on Startup/Form Loading

I have a VB6 app that loads initially (for a small prompt to enter a license key, only on the first time). It works fine on my machine (windows 7).
I had complaints of it crashing on someone else's machine (both xp and 7), so I made a Windows XP virtual machine. I installed it on the virtual machine, it crashed. I wanted to see where it crashed so I installed Visual Studio on the virtual machine so that I would get a debug prompt. When I ran the program again, it worked.
I am more familiar with C++ and had these kinds of problems, so I figured it was some sort of runtime issue.
I found this VB6 SP6 Redistributable Runtime:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=24417
I installed that, and it still wouldn't run.
Any ideas where to go from here?
Edit:
I have tried depends.exe, it only shows MSJava, which I've heard I can ignore. Does depends.exe also show things like .ocx (Active X controllers?) that are required?
Also, from the cmd prompt, %errorlevel% doesn't seem to get populated. Is that a VB6 things, or does that indicate that this is truely a crash and not a user exit?
Open the Visual Basic project and check both "References" and "Components" under the "Project" menu.
Since it is crashing with the VB runtime installed it is likely a component that you have referenced in the project that either does not exist (or is not registered) on the client under test.
This should be a simple fix.
I had the same problem on my windows 7 computer.
I have uninstalled everything, changed my windows theme to Windows Classic.
I changed following properties of VB setup file.
Right click on setup.exe and go to properties and in compatibility tab change the compatibility mode to windows XP SP2. And in settings uncheck the following check boxes.
Disable Visual themes
Disable Desktop composition
Disable display scaling on high DPI settings.
Run this program as an administrator
And have completed installation.
Followed by installing VB 6 service pack 6 from here.
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=24417
Hope it helps.
It may require something else other than just the runtime, have you tried viewing it with dependency walker http://www.dependencywalker.com/ on the machine that it crashes on?
It should quickly point out any missing references.
Maybe try again, create a new VM, but install the remote debugger instead of the full VS.
You should create an installer for your application. There may be more dependencies than just the VB6 runtime. A good installation tool will detect at least some of necessary dependencies for you. Have a look at this question or this question

VS2005 Setup and Deployment - MSI Installer on reboot

I built a VS 2005 Setup and Deployment project and i'm able to install the setup without any problems. But, if I reboot my computer, the setup utility is being run again, asking me to install the software again (It already exists). I have not run into this problem before, any help would be greatly apperciated.
Thanks!
Check the Event Log, it will show what missing component/file/whatever is causing the installer to run.
Try enabling Windows Installer Logging and looking at the log files to see what might be failing.
Validate your resulting MSI using Orca, it's available as part of the Windows Installer 4.5 SDK (look for orca.msi in the TOOLS folder)

Resources