We have a legacy Visual Studio 2003.NET C++ DLL project. Still works with VS2003 on Windows 10 but we're looking to migrate to VS2019.
In VS2003 when you debug (F5), the box Executable for Debugging Session pops up. In the Executable file name box you select Browse... and navigate to the .EXE which will consume your DLL. Great!
But how to do the same in VS2019? Whenever I debug, Visual Studio thinks I'm using the Local Windows Debugger and I get the error "[PATH][PROJECT].dll is not a valid Win32 application". The Debug > Attach to Process... option is not right either because my target executable is not running yet.
If I'm understanding the problem correctly, I think you want to select the Debugging section of your DLL project's property pages. There you can choose which debugger to use and you can even set the executable you want to launch.
I have created a simple plane MFC application using VS 2015 and if i try to run the exe in another windows 10 machine where VC++ 2015 redistributables are present, then exe is not getting launch.
If i change it to Unicode then it works fine in another machine where VC++ 2015 redistributables are present, its failing specific MBCS.
in the Event viewer i noticed below error,
"Application popup: MFCApplication2.exe - System Error : The code execution cannot proceed because mfc140.dll was not found. Reinstalling the program may fix this problem."
i checked the mfc140.dll its present in system 32 folder, also i placed the same dll at the exe level and run. again new error noticed in event viewer like
Application popup: MFCApplication2.exe - Application Error : The application was unable to start correctly (0xc000007b). Click OK to close the application.
For testing purpose, i made the application as static linkage, in that case its working fine in another machine, but for dynamic linkage the exe is not launching in another machine.
Here are the list of VC++ Redistributes present in the windows 10 machine.
How we can fix the issue?
Edit,
Here i found MBCS installer for 2013 (http://go.microsoft.com/?linkid=9832071). But if i run i'm seeing below error, why we require VS for running MBCS i'm not understanding.
thanks
I am using an ASP.NET site on a ISS Server on a Windows Server 2008 that compiles a solution for me In the following matter:
Dim command = "devenv ""Solution.sln"" /build Debug /project ""Project.vbproj"" /projectconfig Debug /out ""logBuildUpdateInfoprim.log"""
Dim cmdsi = New ProcessStartInfo(command)
cmdsi.Arguments = arg
cmdsi.CreateNoWindow = True
cmdsi.UserName = "user"
cmdsi.Password = "pass"
cmdsi.UseShellExecute = False
Dim cmd = Process.Start(cmdsi)
cmd.WaitForExit()
The "user" and "pass" are for a system adminitrator
I also set the Identity of the site's Application Pool as the "user"
And it works for about a few weeks and then at the next compilation the devenv process just sits as 0% processor and ~2Mb of RAM. And it sits indefinitely.
The only way to fix this is to log as the "user" in windows, close the devenv process manually and then open Visual Studio. After that I can logoff from the windows server and the website works again for a few weeks.
(I am using Visual Studio Community)
I suspect that Visual Studio needs to be open so it activates the Visual Studio account, or maybe it's a issue with the windows server. Anyway, it's a real pain to periodically have to fix the issue.
Since I did not find any answers on how to bypass the login in Visual Studio I used
msbuild.exe
as a workaround.
after several unistalls and reinstalls processes of VS 2017 I'm still getting the following error (translated from spanish) when I try to compile for chrome emulator a new and empty project in vs 2017 RC:
MSBUILD : cordova-build error BLDErr_Build_ToolsetInstallation: Could not find the target tool set on the disk.
I've tried also to perform repair processes but the error still persists. Of course I've checked that android SDK, node, etc. are installed and the environment variables have the correct name and path.
Does anyone know how can force to find cordova tools or whatever it is looking for?
Big thanks in advance.
In my case this worked:
Go to visual studio installer(type it in windows start menu).
Choose to modify your installation of Visual Studio.
Go to indivudual components.
Choose to add cordova 6.3.1(at this moment) toolset.
Install and try to build your project.
I had previously installed the VS11 beta, and had some issues with my Visual Studio 2010 instance, which you can see here how they were resolved: Excel AddIn Click Once deployment issue.
Now I have a code base which compiles/builds a vsto, which installs fine and runs fine in Excel 2010. However, when I remove the installed version from Excel, and try to run it directly through Visual Studio 2010, the AddIn does not get loaded into Excel when running in debug configuration mode, in release configuration mode it works fine. Any ideas on why this might be occurring? I've tried re-enabling it through Com AddIns, and a few other things with no luck.
I've found the issue which was not letting me run my project in 'Debug' configuration mode, though it worked in 'Release' mode. At some point, the AddIn, got hard-disabled (not sure if that's the term to use). At that point, trying to re-enable from within Excel doesn't do anything. Within the registry, there is a folder where disabled AddIns are flagged. I deleted all of the keys from this folder except for "(Default)" and now my AddIn works when launching from Visual Studio 2010 in 'Debug' mode.
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Resiliency\DisabledItems
When you run through Visual Studio 2010 does it hits the breakpoint in the addin_startup event.
If not try to debug this way
Hope this helps you
You can reenable a hard-disabled Add-In with Excel
http://msdn.microsoft.com/en-us/library/ms268871(v=vs.80).aspx
I had the same problem with a Word VSTO, but there was no Resiliency\DisabledItems folder in my registry, so I think it was never hard disabled (as in #mservidio's solution). What worked for me was to edit the Manifest path in HKEY_USERS\<user key>\Software\Microsoft\Office\Word\Addins\<Add-In name> to reflect the 'Debug' path rather than the 'Release' path.
To find the right folder it might be easiest just searching for the Add-In name and checking that any Manifest keys refer to the Debug path.
I had the same problem in Excel.
The following worked for me:
Go to the following key....
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Excel\AddInLoadTimes
see if your plug-in is listed. if so, delete it.
now run your app from Visual studio again.
This worked for me, hope it can help someone else.
I also had the same problem, what I didn't understand was :
Why I re-install Office 2016, I don't change my code neither VS setting but I get a cant load error message ?
After many many hours, repairing Office and VS and getting the same error message, I observed that the Addin was starting well in Release config, I started checking the difference between the both config in my code.
I found that debug config was targeting to x86 proc bug release to any cpu
So Office x64 didn't load x86 dlls (in my case)