LNK 1168: Cannot open .exe VS 2013, Windows Audio is using the .exe - c++

Trying to compile a VS 2013 C++ application and Im getting the LNK1168 cannot open .\bin\foo\bar\foobar.exe for writing.
I've followed other articles. Application Experience is enabled and running. Ive restarted VS. Cleaned and tried to rebuild. Checked the Task Mgr to make sure the application isn't running too.
My only success is after a full system reboot.
Nothing is working except the system reboot. I went to the directory and noticed that when I tried to delete the .exe that is currently there (from a previous successful build) it gives me an error saying that the operation cannot be completed because it is open in Windows Audio..
Has anybody dealt with this before? Restarting my whole OS to build is not going to work for me much longer.
The project is mapped to a D: drive (i.e. not located on C:).

Related

UWP/WinRT: App stopped working after November update

I have a Universal Windows Platform app that was working fine. My development machine is running Windows 10, and after the Windows 10 November Update (1511, build 10586), the development version built by Visual Studio has stopped working. I was actually running this day-to-day as a standalone app, and I noticed this problem when after the update the app started immediately closing after the splash screen.
I uninstalled the development version of my app and installed the store version, and that works fine, even though no code has changed between the two versions. I updated Visual Studio to Update 1, and it still doesn't work. I've fully uninstalled and reinstalled Visual Studio but that didn't help either. I've also tried changing the Project Properties to target platform version 10.0.10586.0 and rebuilding, but that also doesn't seem to help.
This occurs on both Release and Debug builds, and on both x86 and x64.
On launch, it gets as far as the splash screen before informing me that I've triggered a breakpoint. The breakpoint was not set by me, but rather is in KernelBase.dll, and no source is available.
If I hit Continue, then I get an Unhandled exception at 0x00007FFC4C431F08 (KernelBase.dll). The body of the error is:
0x00000004: The system cannot open the file (parameters: 0xFFFFFFFF80004005, 0x0000000000000005).
Hitting Continue again will get me into my code, which dies with:
Microsoft C++ exception: Platform::COMException ^ at memory location 0x000000C1517FAF50. HRESULT:0x802B000A The text associated with this error code could not be found.
Any ideas on what happened and how to correct?

Can't run VS 2015 Community without /resetsettings; Getting CANTLOADLIBRARY on opening new projects, and crashing on new .cpp files

I have Windows 10, fully updated.
I downloaded and installed Visual Studio Community 2015 last week for the first time, (previously programmed in Code:blocks, still installed) and selected custom install to allow for C++ and Python programming.
Installation ran smoothly, but VS always fails on launch.
On first launch ever, it said it was setting things up for first startup; asked me for sign-in which I did, at which point it briefly showed something about my profile before saying 'An error occurred while starting for the first time. Please restart Microsoft Visual Studio'. Imgur images of all dialog boxes here, including parts of a processmonitor log I estimated to be around the general time of the error.
Closing and restarting several times didn't help.
Uninstalling and re-installing didn't help.
Rebooting didn't help.
And uninstalling, running Ccleaner's Cleaner and Registry Cleaner, rebooting computer and re-installing VS didn't help either.
Repairing the install from Programs also didn't help.
I managed to find the exact same error on Google Search for VS 2013 but the only solution was where one person got a completely new OS and re-installed VS on that.
I tried the other suggestions they had including running:
devenv.exe /safemode
devenv.exe /resetskippkgs
devenv.exe /resetuserdata
devenv.exe /installvstemplates
devenv.exe /resetsettings
the first 3 took me to the same sign-in screen. Regardless of signing-in or not, or running VS from the Administrator Profile or not, these option always give the same failed on first startup error.
Installvstemplates gives an error saying the operation could not be completed, but /resetsettings finally got me into VS.
That's about all it does though, I can go to the home page and access options/menu buttons, but signing-in makes it crash and reload again (but it does sign me in and take me to the home screen)
Signed-in/not and Administrator or not, VS crashes on opening a new .cpp file.
When I click Start a New Project I get "Error loading type library/DLL.(Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)). Closing VS and trying to open it normally from start menu still always throws the original error, despite working if I open it via /resetsettings.
I've also checked [HKEY_CLASSES_ROOT\CLSID{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32] in Regedit and found it is apparently correct.
I also used devenv /log to generate an xml file of the process when I open it.
Just to mention I have .NET Framework 4.5-4.6 installed with VS as well.
Looking forward to any advice.
So, for anyone else getting the same problem, I haven't gotten any other advice, since this post.
If you're still having probs # this point the only real solution seems to be a clean install of your OS .
I can confirm it solved all my issues, with VS + some OS problems I wasn't aware of . I can only assume they might've been related, good luck.

Visual Studio 2015 error: Unable to start debugging. Unexpected GDB output from command "-target-select remote :5039". Remote connection closed

I see the following error whenever I try to debug "Cross Platform" under "C++" category: "Unable to start debugging. Unexpected GDB output from command "-target-select remote :5039". Remote connection closed"
I've installed all of the contents when I downloaded Visual Studio 2015 community and I ran it on Windows 10 Pro which supports Hyper-V.
I've been searching a solution for this and I've found an assumption:
"What is your debug target, the VS Android Emulator? When we saw this before it turned out to be a bad emulator image. Do you have this problem with all targets (e.g. if you try a physical device) or just one?"
In my case, I just tried this via Emulator(VS Emulator 5" Lolipop (5.0) XXHDP Phone (0x86 -...)
So I've sent an Email to VS 2015.
And the answer was like this:
"Sorry for the delay in responding we were looking at an emulator image of another user that ran into this problem so I was waiting until we had the results of that investigation to report back. We actually were not able to find anything wrong the emulator itself, our current hypothesis is that it is a network or adb problem interfering with GDB’s ability to connect to GDB server on the remote machine. Do you see this error every time you try to debug, or if you reboot the emulator will it work sometimes right after the reboot? Next time you see the error, can you open the emulator’s console mode by going go the Hyper-V manager and double clicking the emulator. Then find the location your app installed to and run “gdbserver --version" from the app path and let me know what it says? This will validate if the correct version of gdbserver is on the device."
So we are trying to solve this problem but I'm also asking here just in case.
Is there anyone who has magical solution for this problem?
I'll put a comment on this if I figure out how to solve this.
Thanks in advance.
** Following answer is from the manager of Visual Studio 2015:
You are only the second person who has run into this issue, and the first person that ran into it provided their everything works correctly when we run their .vhd on our machines so it appears to be some strange problem where gdbserver (which comes from the Android NDK provided by Google) crashes only when running on certain machines. Unfortunately the .vhd you provided does not appear to be the correct one it won’t boot for me. You can see the .vhd file being used by the emulator if you look under the settings of the emulator in your Hyper-V manager. .However given we got the other person’s .vhd you can hold off providing any additional information at this point. I’m waiting to hear back from the emulator team on if they have any ideas since this appears to be an issue only on specific machines since.
If you don’t mind my asking, if you don’t have a background in computers what inspired you to try C++ on Android? That scenario will be significantly more complicated than doing Java on Android.
It's been almost two months since I got this answer but I haven't got any additional response from them yet. So, I ended up quitting developing an application by using VS2015.
If you run into this problem, there are only two ways to go. Change your computer or stop developing application via VS2015.
If the project name contains spaces, the whole remote debugging fails. Visual Studio also creates weird paths. When checking out the "Blink1 for Raspberry Pi" template, I named the Project "Blink1 for Pi", which resulted in a path like this:
~/projects/Blink1?/for/pi/PI/for/pi....
And all the debugging failed. When I recreated this keeping the project name "Blink1", everything worked fine. It's a pity, that spaces aren't handled here...

Cannot Attach Kernel Mode Debugger to Process in debugging KMDF driver

I am currently trying to build a simple Win 7 x64 USB driver using this guide: https://msdn.microsoft.com/en-us/library/windows/hardware/hh706187(v=vs.85).aspx
Host is using VS2013 & WDK 8.1
Because I don't have a null-modem cable (or any other means of setting up a debugger connection between host and target), I just filled my settings with the default ones found here, expecting some sort of error to return, but the configuration process went through without a hitch, displaying
WDK Remote User Account successfully created
Installing .NET Framework 9possible reboot)
Installing VC Redist (x64)
Installing test automation (x86)
Installing test automation (x64)
Installing debuggers (x86)
Installing debuggers (x64)
Installing driver test framewok
Registering logging components
Configure debugger settings (x64) (possible reboot)
Configure computer settings (x64) (possible reboot)
Creating system restore point
Complete
So I assumed that what I assumed about serial/com ports to be wrong and continued to attach the WKM Debugger to 'Kernel' of my target computer, which was listed under the "Available Processes" datagrid. When I click the 'Attach' button, however, I get an error that says:
Windows Debugging Extension for Visual Studio
Could not start debug session, error 80070002: The system cannot find the file specified
I've tried Building/Rebuilding the project many times, and Provisioning the target computer also multiple times to the same results. I saw that question number 25776839 also had the same issue as me, but he mentioned something about changing VS's default from Kernel Debugger to Remote Debugger, which I'm not sure how that can be accomplished, but also caused other problems. I've also tried to "attach process" using the same setting via WinDBG but did not produce anything useful.
Also, I switched from MSVS2015 and WDK10 to MSVS2013 and WDK8.1 because their tutorial files led me to missing header files (warning.h many others), and package files.
Can anyone show me what I did wrong or what I need to do to fix the 80070002 error? Yes, I am new to driver dev.

_com_error at memory location

I have mfc application that working fine on the machine with VS 2013 pro. But when I try to run it on the other pc which has VS redistribute package 2013, VS remote tools. Nothing happening. I can see in the task manager that it is started but then it goes away...
What I have tried so far:
1) I used Dependency Walker to find dll that my application depend on. And for my setup project I add MSVCR120.dll, the rest of the dll's were mfc120.dll the ones that part of the OS i didn't add it them, because I got warnings if I'll add dll which is part of the OS and another PC has exactly the same Windows 7 so they are on the PC.
2) I used VS remote debugger, and at this time I got this First-chance exception .. _com_error at memory location. But I can't catch it. I don't know where to look. My call stack look's that this.
3) Last out put before error, says that sqloledb.rll was not loaded, I check it systems folder does have it, I even copied to the folder where application executable located, still does not loaded, still have exception.
Can any one point me to what can cause this error or why application does not run? What else to install so my application can run the same way it is run on the machine with VS. It is seems that this error rise often but none of the solution helped me.
I used procmon.exe and it is shows buffer overflow.
It is turn out to be database connection. Application quite on this line, so I add try/catch block. But shows "unexpected error"...
m_pAppConn->Open("File Name=MyData.udl", "", "", adConnectUnspecified);
m_pAppConn is a _ConnectionPtr. On my pc I have MS SQl Server Enterprise, but on target pc MS SQL Express, could it be the issue?