I have a very simple VS2015 solution with one project. The project does not have any source code, but it has a pre-build event defined. The pre-build event was originally invoking a batch file pb.bat, but I have since changed it to REM pb.bat so that it only executes the REM statement.
Every time I try building, I get the following error message:
Microsoft.Common.CurrentVersion.targets(1250,5): error MSB6003: The specified task executable "cmd.exe" could not be run. The requested operation requires elevation
I should note that UAC is disabled. This is driving me crazy! I have even tried reinstalling Visual Studio, in case the targets files or something else was corrupt with the installation, but the problem persists. If I run Visual Studio as an Administrator, the build works, but I don't want to have to run it like that forever!
I had completely forgotten about this! A couple of days ago I had configured cmd.exe to always run as an Administrator. This was done in the registry:
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Windows\\System32\\cmd.exe"="RUNASADMIN"
The problem went away as soon as I reverted the change. I am making a note of this, as I am bound to hit the same problem in the future.
Related
I'm attempting to run a program built with a CMake-generated solution file under Visual Studio 2017's debugger in order to debug a problem. However, whenever I try selecting Start Debugging or Start Without Debugging I get the following error popup.
Unable to start program
'E:\build\someprogram\build\x64\Debug\ALL_BUILD
Access is denied.
At first glance the problem sounded like the one described here. However, that bug was allegedly fixed in VS 2017 15.5, and I currently use 15.6.7. And the location of the compiled executable isn't on a RAM disk or network drive, but on a physical drive. And the error happens when running without a debugger also.
Also I wondered about whether or not the executable was not properly configured, since it looks like the error is related to the ALL_BUILD target, but in my CMakeLists.txt I have this declaration:
add_executable(someproject ${SOURCE_FILES})
I would think that would add the executable to run. It also appears as a subproject in the Solution Explorer.
The compiled .exe runs outside of Visual Studio fine, although it crashes, which I'm trying to debug. Strangely, I cannot enter the Visual Studio debugger from the Abort/Retry/Ignore dialogue that appears after the crash by clicking Retry like it instructs; the window for choosing the Visual Studio version never appears.
It does not seem to be a permissions issue since I manually adjusted the permission of all the build directories with all permissions, with no changes. I'm also running Visual Studio with administrator privileges, and it makes no difference. Additionally I replicated the build process on an entirely different machine (Windows 10, as opposed to Windows 7) and the exact same error occurs, so I'm suspecting it's a CMake issue.
You need to set a different project as startup project (right click on your target executable project "someproject" and select "Set as StartUp Project" from the context menu). ALL_BUILD is a symbolic target and is not connected to an executable.
I have been trying to install Visual Studio 2017 RC for the past two hours but so far, I have not been able to install any version of Visual Studio. I have tried looking around for solutions, but so far nothing.
Here's an image of running the installer. This is about as far as it goes.
After doing this, the installer just exits and kills itself and no installation happens. Waited for a while and nothing happens. No installer applications running in both task manager and resource manager, so I'm assuming it right after it reaches that.
Any ideas?
EDIT:
This computer is clean and has never install or attempt to install any version of MS Visual Studio before.
[1/17/2017, 16:12:46] === Logging started: 2017/01/17 16:12:46 ===
[1/17/2017, 16:12:46] Executable: C:\Users\xxxxx\Downloads\vs_Community.exe v15.0.26020.0
[1/17/2017, 16:12:46] --- logging level: standard ---
[1/17/2017, 16:12:46] Directory 'C:\Users\xxxxx\AppData\Local\Temp\2a6df70b7a7d7cb06efead\' has been selected for file extraction
[1/17/2017, 16:12:46] Extracting files to: C:\Users\xxxxx\AppData\Local\Temp\2a6df70b7a7d7cb06efead\
[1/17/2017, 16:12:47] Extraction took 828 milliseconds
[1/17/2017, 16:12:47] Executing extracted package: 'vs_bootstrapper_d15\vs_setup_bootstrapper.exe ' with commandline ' '
[1/17/2017, 16:12:49] The entire Box execution exiting with result code: 0x0
[1/17/2017, 16:12:49] Launched extracted application exiting with result code: 0x2
[1/17/2017, 16:12:49] === Logging stopped: 2017/01/17 16:12:49 ===
I had the same problem, and it turns out that some part of the installation was trying to read from a config and failing. After running it a few times, it eventually created a folder called "VSFaultInfo", and it contained a ConfigurationErrorsException.
My problem was that I edited my machine.config at one point, and the installer was getting an exception from trying to read from it. It installed when I undo-ed the modifications I made. My config was located under "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config", but it might be different for you. Try to delete it or find a VSFaultInfo folder on your computer.
Most Visual Studio installer problems since VS2012 are caused by corrupt packages that is has downloaded. The log file you posted suggests this might be the case.
The packages are downloaded to the temp directory in user accounts \AppData\Local\ folder as indicated in the log file. I would suggest that you clear out all files in this directory and run the installer again, triggering it to re-download required packages which are hopefully no longer corrupted.
Refer to the error message, the installation met issues when extracted or launched the package. Make sure windows update is up-to-date, temporarily disable any antivirus software, clean up the %temp% folder, then re-run the VS 2017 installer as administrator.
In you have tried to install any VS 15 preview versions or re-install the VS 2017, you can perform a manually uninstall like the following:
Go to Control Panel—Programs and Features, if there have ‘Microsoft Visual Studio 2017’ or ‘Microsoft Visual Studio Installer’, right click it and choose ‘Uninstall’
Try to delete the following installed folders: (you can back up those folders before any modification, in case we need to roll back)
• Go to the folder: %ProgramData%\Microsoft\VisualStudio and delete the ‘Packages’ folder
• Go to the Visual Studio installation folder (normally under %ProgramFiles(x86)%\Microsoft Visual Studio) and delete the folder ‘2017’ or ‘VS15Preview’ if you have
After the uninstallation, then re-download the VS 2017 RC and run as administrator.
I finally figure out a problem after over an ENTIRE week of searching and messing around with settings. I can actually do my homework normally now (whoo hoo...).
Like so, I have tried everything you guys have said to no avail, although the solutions you guys have provided did solve some of my classmates' problems, so thank you for that.
So here is what I did:
Press Start (windows icon) + R to open up the 'Run' window.
Type in services.msc to open the 'Services' window.
Scroll down and find 'Windows Management' Instrumentation, right-click it, then click 'Start'.
Look at the 'Startup Type' and see if it says 'Manual (Trigger Start).' If it does not say that, right-click on it, click on properties and set the 'Startup Type' to automatic.
Run the installer as an administrator and install.
So if anybody has this problem, try enabling services. Some of these services are required in order for Windows to actually allow the application to install. In this case, it was a service which retrieves information from the computer in order for the installer to install properly.
I disabled this service previously in order to improve hard drive performance, with no awareness that it restricted me from installing software.
Cheers!
I noticed I had unknowinly messed up with machine.config
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG
I reverted the changes to default and the installation started well at last.
I'm having a recurring issue on Windows 7 whereby on clicking the compile button in Inno Script Studio version 2.2.2.32 the application hangs indefinitely and refuses to respond. After end tasking and restarting the software the problem persists and it is only rectified on a restart of the operating system.
The problem seems to be an issue whereby the previously compiled Inno Setup executable cannot be overwritten by the newer version of the file.
Attempting to manually delete the file in file explorer results in the following dialog appearing but never completing:
Attempting the same through the command line results in a command that never terminates.
This appears to happen only when an installation is terminated prematurely usually because the script has encountered an error. On inspection of the file it has no ownership or permissions set. It does not seem to be related to Anti-Virus software as far as I can tell because I've disabled all the Sophos services I can see in the SCM.
Anybody have this issue before?
Try to workaround the issue by using an unique output filename for each compilation.
You can use:
[Setup]
OutputBaseFilename=setup-{#GetDateTimeString('yyyy-mm-dd-hh-nn-ss', '', '')}
Does this happen with another IDE?
I mean classic Compile32.exe (default Inno Setup IDE) or Visual & Installer for Microsoft Visual Studio or RAD & Installer for Embarcadero RAD Studio?
This could be IDE related thing or Windows so we need to eliminate them one by one.
So my Visual Studio 2010 is extremely slow (and sometimes freezes) when I have a particular file open and attempt to compile and run the project. I have to open the Task Manager and kill the process for Visual Studio to regain control. If I close this file, and open any other file in the Solution Explorer in my project, Visual Studio compiles and runs the program just fine. The build succeeds, but Visual Studio just freezes after that. If I attempt to do anything in the IDE, Windows will tell me that Visual Studio is not responding. I've tried commenting out everything but the bare essentials in the file that's causing the freezing, and that didn't work. In order to get my program up and running, I have to close the file and then build the project. Visual Studio will then build and run the program in a timely manner as long as the particular file is not open. This only started a few days ago, and I haven't made any changes to the code that could have done this, nor have I updated or installed anything else onto my computer. Any ideas would be greatly appreciated. Thanks.
I fixed this. What I did was run devenv.exe /log and looked through the log. It had the following warning in it: "The CTM file is out of date and should be deleted and rebuilt, but the file 'C:\ProgramData\Microsoft\VisualStudio\10.0\1033\devenv.CTM' could not be deleted." I went and deleted this file, and it did the trick. Now even with that particular file open, Visual Studio builds and runs the program just fine.
Strange Visual Studio (TS 2008) problem: The IDE completely freezes whenever I switch from Release to Debug mode in a specific project. It happens right as I switch, before I try to build or do anything else.
The whole thing started out of the blue, without any abnormal change I can think of.
I tried to clean the solution, but it didn't help.
Anyone ran into this before?
If everything has worked fine and then stopped, usually it means there was some problem even though it had passed unnoticed.
Things I would try one after another:
Check which files were changed (why and how) after update from a source control engine
Review the list of extensions and plugins. Try to disable all or some of them
Close Visual Studio and kill all the development processes: devenv, mspdbsrv, vcpkgsrv, msbuild, msvsmon, vshub, vstest etc
Remove .suo, .ncb, .VC.db, .VC.VC.opendb files of the solution as well as .vs directory, which sometimes cause problems
Remove project setting files, sort of YourProjectName.vcproj.DOMAINNAME.LOGINNAME.user or YourProjectName.csproj.user. The setting file name depends on a project kind you use
Run "C:\Program Files\Microsoft Visual Studio [vs_version]\Common7\IDE\devenv.exe" /setup or "C:\Program Files (x86)\Microsoft Visual Studio [vs_version]\Common7\IDE\devenv.exe" /setup for x64 environment
In some complex cases, it helps to remove user settings, located in home %USERPROFILE%\AppData\[Local|Roaming]\Microsoft\VisualStudio[vs_version] and in registry HKCU\SOFTWARE\Microsoft\VisualStudio[vs_version]
It should reset all things to the beginning state. If it won't work, so there are additional tools to investigate. Download Process Explorer and once IDE freezes, start the Process Explorer, find the devenv process, double-click on it and go to Threads tab. Check, which thread has the biggest switch delta in case of the freeze, double-click on it and take the name (or offset) of the top function. It gives additional info where the problem may be.
Moreover, sometimes it helps to repair Visual Studio in the "Add or Remove Programs" wizard in Control Panel.
Had this problem in 2017. I ran VS 2017 as Administrator and it worked.
I've encountered this in VS 2017 (15.8). Upgrade to the newest version (15.9 at that time) resolved the issue.
VS seems to be doing a lot behind the scenes and putting project-specific files in App Data and who knows where else. I had this experience: I had a project which had two sets of identical code in two different directories: one for production, one for development. The development project started hanging on debug, the production did not. Tried all kind of settings and deleting .suo files, but no help. So I renamed the directory that the development version was in and presto, eveything worked without hanging.
In my particular case, I tried many other answers with no luck. It turned out that a call to this was hanging the debugger:
Log4NetExtensions.AssertFail("Error");
I managed to narrow it down to this line of code by bring up the threads window under [ Debug > Windows > Threads ] and clicking on the current thread to browse to the line of code it was hanging on.