Issue generating resources in VS.Net 2010, windows 7 64 bit - visual-studio-2010

I am having an issue generating resources in VS.Net 2010, windows 7 64bit. It am able to compile the solution in Visual studio. But when I try to compile the solution in command prompt using msbuild, it fails generating the resources.
I went through the below link and find a solution to get it compiled in command prompt using msbuild.
http://blogs.msdn.com/b/visualstudio/archive/2010/06/19/resgen-exe-error-an-attempt-was-made-to-load-a-program-with-an-incorrect-format.aspx
I used option 2 from the above article.
Before compiling in command prompt I have to execute the below two commands.
CorFlags /32BIT+ /Force Resgen.exe
set RESGENTOOLARCHITECTURE=Managed32Bit
And after finishing the compilation I have to execute the below remove 32 bit command. Other wise it fails in visual studio.
CorFlags /32BIT- /Force Resgen.exe
One weird thing is non of my team members are having any issue with this. I only have the problem.
Could you please let me know why it's only me?
Also any other permanent solution if you have, with out running the above commands again and again.
Thanks in Advance

Sometimes it has issues with the privileges.
Just make sure that you have tried running your command prompt with full privileges.
i.e. Run as administrator

Related

visual studio 2017 install break : it not get start

I use the permission of Administrator to install vs_enterprise.exe.
But the install package don't work at all.
OS: win10 professional
The install log in appdata/local/temp/ is as follow:
dd_bootstrapper_20170313103210:
Beginning of the log. Start Time: 13/03/2017 10:32:10 VisualStudio Bootstrapper:13/03/2017 10:32:10: Current Optin root path does not
exists VisualStudio Bootstrapper:13/03/2017 10:32:11: Commandline
arguments =
dd_vs_enterprise_decompression_log.txt:
[3/13/2017, 10:32:4] === Logging started: 2017/03/13 10:32:04 === [3/13/2017, 10:32:4] Executable: D:\vs2017\vs_enterprise.exe
v15.0.26206.0 [3/13/2017, 10:32:4] --- logging level: standard ---
[3/13/2017, 10:32:4] Directory
'C:\Users\gary\AppData\Local\Temp\b012f31d56525c685e\' has been
selected for file extraction [3/13/2017, 10:32:4] Extracting files
to: C:\Users\gary\AppData\Local\Temp\b012f31d56525c685e\ [3/13/2017,
10:32:5] Extraction took 484 milliseconds [3/13/2017, 10:32:5]
Executing extracted package:
'vs_bootstrapper_d15\vs_setup_bootstrapper.exe ' with commandline ' '
[3/13/2017, 10:32:11] The entire Box execution exiting with result
code: 0x0 [3/13/2017, 10:32:11] Launched extracted application
exiting with result code: 0xc000000d [3/13/2017, 10:32:11] ===
Logging stopped: 2017/03/13 10:32:11 ===
Thank You~
I was having this exact problem, thought it was a services thing. The installer would start if I ran it as soon as Windows booted; if I waited, it didn't.
Turns out it was RivaTunerStatistics server that was running for my gaming overlays. Closed it, and voila, working again. Tried multiple times to confirm.
I had a similar issue, my Visual Studio Professional 2017 installer was closing before the installation starts. I solve the issue by following these steps:
1 - Open the prompt(CMD) with administration rights
2 - Check if you have the "InstallCleanup.exe" file inside the folder "%programfiles(x86)%\Microsoft Visual Studio\Installer\resources\app\layout\". If the file is there then go to step 7
3 - Manually delete the "%programfiles(x86)%\Microsoft Visual Studio\Installer” folder
4 - Relaunch the newly downloaded visual studio installer
5 - Allow the first step to install the installer
6 - Once the installer comes up and you can see workload choices (.net desktop and the like), close it
7 - inside CMD navigate to the folder "%programfiles(x86)%\Microsoft Visual Studio\Installer\resources\app\layout\"
3 - run this command: "InstallCleanup.exe -full"
4 - that's it. Just run the installer again.
It worked for me.
I had the same Problem on two different Pc's (both win10) and the only thing that worked for me, was reinstalling Windows's and rerun the visual studio installer. I know, that's not a good, fast or easy solution, but it works.
I had a similar issue with the VS 2017 installer (similar error message), and I was finally able to resolve my problem after 4 days of troubleshooting with Microsoft Support. I'm developing on a Dell laptop and the support technician believes one of the Dell services was causing issues with the winmgmt service.
Below is a command that failed to run during troubleshooting. After making sure we had an OS restore point saved, we issued the winmgmt /resetRepository command. After that, the VS 2017 Pro installer was able to execute without error.
Here are the exact steps taken by Microsoft Support:
Step 1: Create a Windows system restore point.
Step 2: From the command prompt with administrative rights or elevated privileges, execute the following command: net stop winmgmt
Step 3: Open a Windows Explorer and locate the path to C:\windows\system32\WBEM\ folder and rename the Repository folder to something else like RepositoryOLD (right click and choose 'Rename Folder').
Step 4: restart the computer
Step 5: From the command prompt with administrative rights or elevated privileges, execute the following command: net stop winmgmt
C:\>net stop winmgmt
The Windows Management Instrumentation service is stopping.
The Windows Management Instrumentation service could not be stopped.
Step 6: From the command prompt with administrative rights or elevated privileges, execute the following steps and execute the following this: winmgmt /resetRepository
C:\>winmgmt /resetRepository
WMI repository has been reset
Step 7: restart the computer.
Hope this helps someone else.
I had the same problem but it was solved by the answer #Ben Logan gave (Closing RivaTunerStatistics).
After trying all the suggested answers here (using VS 2017), I followed the instructions on the official Microsoft docs which worked for me. In summary:
Close the Visual Studio Installer.
Delete the Visual Studio Installer directory. Typically, the directory is C:\Program Files (x86)\Microsoft Visual Studio\Installer.
Run the Visual Studio Installer bootstrapper. You may find the bootstrapper in your Downloads folder with a file name that follows a vs_[Visual Studio edition]__*.exe pattern. If you don't find that application, you can download the bootstrapper by going to the Visual Studio downloads page and clicking Download for your edition of Visual Studio. Run the executable to reset your installation metadata.
Try to install or update Visual Studio again. If the Installer continues to fail, go to the next step.
For anyone still having this problem:
One of my co-workers encountered the same problem. We spent 4 hours searching for solutions, uninstalling VS and other software that we thought might be the culprit.
In the end, THIS LINK helped us figure it out. The problem is somehow explained there and is linked to NODE_OPTIONS variable. If you have that variable set, remove it then restart your computer. This solved his problem.
Configuration:
Widows 10, Visual Studio 2017 Enterprise.
I hope this helps you
Copy vs_enterprise.exe to a USB and run. It will work.
try to run this file using console
example: c:/vs_community__556869458.1519050247.exe

Platform toolset (v110) is not installed or invalid

I have a weird problem when I want to compile a Visual Studio 2012 solution via msbuild on the command line. Whatever I do, it exits with Specified platform toolset (v110) is not installed or invalid. I have tried launching it via the regular command prompt, the Windows 7 SDK prompt, and all three command prompts included in VS2012. However, compiling in Visual Studio itself works.
where msbuild outputs:
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
c:\Windows\Microsoft.NET\Framework64\v3.5\MSBuild.exe
You have probably solved the problem yourself but perhaps it may help others with a similar problem. Try to set the VisualStudioVersion environment variable before running MSBuild, e.g
SET VisualStudioVersion=11.0
There is a possibility that it helps.
You could also try passing the command line parameter /p:VisualStudioVersion=11.0 to MSBuild, when trying to build your project. It seems to have the same effect as setting the environment variable, in the above answer.

Env vars for Visual Studio command prompt

I'm doing an RDP into a machine that has just the CLR installed, and doesn't have Visual Studio on it. Can I somehow load all the Visual Studio-specific environment variables on to the regular command prompt and convert it into the VS command prompt so that I'm able to build my projects via command line?
I looked at the vcvarsall.bat file. That calls the appropriate processor-specific batch file. Couldn't get any inputs from there.
Short of installing all VS, or tracing thru all the various batch files to find out what's getting set, you may be able to simply capture the env vars that are set.
Open up a VS command prompt, and run set > vars.bat
Then open up vars.bat, and put a set command in front of each line.
Not sure how much this will help, since you're going to be missing all the utilities that come with Visual Studio, but it does answer your question.
I don't recommend trying to copy only what you need. You'll need other header files, libraries, dlls, etc... You can instead install VS express edition.
If you are trying to debug a problem you can use remote debugging in Visual Studio or use WinDbg on the computer.

64 bit VS2008 Post Build Event Command Line

I'm trying to use the post build command line to get my class library in the GAC.
It is:
"%programfiles%\Microsoft SDKs\Windows\v6.0A\Bin\x64\gacutil.exe" -if $(TargetPath)
I do not see any errors, but my DLL is not getting into the GAC.
However, I can run this from a DOS prompt and it works.
Anything special I need to do to make this command work in VS like this?
The answer is that on a 64 bit system, %programfiles% needs to be replaced with
%ProgramW6432% or %ProgramFiles(x86)%
Thanks for all of the help.
Are you running under Vista, Win7 or Win 2008 and UAC is making Visual Studio run in a non-admin context ? And you are launching the command prompt with admin privileges ?
You might need double quotes around the target: "$(TargetPath)"

spawning cmd.exe error in vs2008

I have created a simple vc++ console application and try to print "Hello World". I am using Windows Server 2003 machine.
When I try to build this project I got the error as Error: spawning cmd.exe
How do I fix this?
Check if cmd.exe is in <Path> environment variable?
I just did a small test by removing the %SystemRoot%\system32 from path environment variable and I got the same problem what you are facing.
Error 4 Error spawning
'cmd.exe'. Project SEH
If it is the path issue then try adding below to Projects and Solutions -> VC++ Directories:
$(SystemRoot)\System32
If you get error like this
Just open Tools –> Options –> Projects and Solutions –> VC++ Directories
and add these lines :
$(SystemRoot)\System32
$(SystemRoot)
$(SystemRoot)\System32\wbem
http://www.interact-sw.co.uk/iangblog/2005/09/12/cmdspawnerror
yes i hav found where the proble.
I unable to locate path of cmd.exe
so
go to visualstudio tools->options->projects and ->vc++ directories and specify ($SystemRoot)/system32 then it working fine.
Are you running on Vista? Could this be a case of needing to run Visual Studio as Administrator?
I believe cmd.exe is not runnable by a non administrative user by default on Windows Server 2003, so I would check its permissions. That of course assumes you are not running it as Administrator already.
Yep. (Another weird windows error)
Projects and Solutions -> VC++ Directories -> Executable Files
Add $(SystemRoot)\System32
it works
It was giving error for me because cmd.exe was not accessible with the current user.
What I did to solve this problem :
Close current Visual Studio.
Reopen Visual Studio by right clicking on visual studio and select 'Run as administrator'
Now run The project.
Why It works
To access cmd.exe application must have privilege to run this. It doesn't have permission to access this and hence it works next time when you tries to access it normally(without running application as Administrator)
Operating System
Windows 7

Resources