1 up-to-date issue with VisualStudio 2010 and Visual studio 2012 - c++

I am trying to generate an .exe using visual studio 2010, for the first it builds fine but if i delete the .exe and again if try to build without making any changes in file for the second time, its not generating the .exe again and it is just showing as follows even if the .exe is not present,
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
On searching the internet, i found it may be possible to build again, by everytime using "rebuild" option of VS2010. But i dont want to use rebuild option as i am generating .exe via command prompt always using something like devenv /build "Debug|x64".....
I also Tried to build using Visual Studio 2012 and still facing the same problem for 2nd time generation.
Please suggest me with a solution. I am trying from two weeks and found no solution(except "rebuild" option) which works fine with this issue.

Project Properties -> Build Events -> Post-Build Events -> Command Line:
del /F /Q "$(IntDir)\$(MSBuildProjectName).lastbuildstate"
This will delete lastbuildstate file after every build, so .exe file will be regenerated every time.

Right click on the name of the project in the Solution Explorer window and then "Rebuild"

Related

Visual studio compiling failed without any errors [duplicate]

I have a WebApplication which contains reference to WCF services.
While building using Visual Studio 2010, Build fails without any error or warning. However building the .csproj using MsBuild is successful.
Can't figure out what should I try in Visual Studio, to resolve / diagnose the issue. Can you please help out?
I find out that the build has been failing,
From text displayed in status Bar.
From output window:
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
The output tab includes configuration details.
------ Build started: Project: <projectName here> Configuration: Debug Any CPU
I noticed that if "Build + Intellisense" is selected in the Error List, it causes the error messages to be swallowed.
Change this option to "Build Only", and all error messages will be displayed:
I don't know if this is a bug in Visual Studio or what, but it certainly revealed hidden error messages that were the key to pinpointing the failure for me.
Some, like Richard J Foster, have suggested increasing the "MSBuild project build output verbosity" setting to "Diagnostic" (the highest possible option), but this didn't solve the problem for me, as Visual Studio appeared to be suppressing the error message(s) themselves.
As an alternative, you may try to use the raw output messages from the "Output" tab, which haven't been filtered by Visual Studio. Either do an in-place search for the strings "error" and/or "failed", or copy all of the output to your favorite text editor and do a search there.
To ensure that the Output window appears each time you do a build, you can go to Tools → Options → Projects and Solutions → General, and ensure that the option "Show Output Window when build starts" is checked.
As an additional troubleshooting step, it is also possible to build the project from the PowerShell command line by running dotnet build. This will show you the complete build output, including any errors that Visual Studio may be hiding.
I just ran into a similar situation. In my case, a custom action (from the MSBuildVersioning package available on Nuget.org - http://www.nuget.org/packages/MSBuildVersioning/) which appeared in the csproj file's BeforeBuild target was failing without triggering any error message in the normal place.
I was able to determine this by setting the "MSBuild project build output verbosity" (in the latest Visual Studio's Tools tab [Path: Tools > Options > Build and Run]) to "Diagnostic" as shown below. This then showed that the custom action (in my case HgVersionFile) was what had failed.
Here are some things that you can try:
If your solution contains more than one project, try building each project one at a time. (You may even want to try opening each project independently of the solution.)
If applicable, ensure that all of your projects (including dependencies and tests) target the same version of the .NET Framework. (Thanks to user764754 for this suggestion!)
Tip: Check Tools → Extension and Updates to ensure that your packages are up-to-date.
Ensure that all dependency projects are built to target the same platform as your main project.
Try restarting Visual Studio.
As suggested by Bill Yang, try running Visual Studio as Administrator, if you aren't already. (If you are already running Visual Studio as Administrator, perhaps try the opposite?)
Try restarting your computer.
Try "Rebuild All".
Run "Clean Solution", then remove your *vspscc* and *vssscc* files, restart Visual Studio, and then "Rebuild All".
As suggested by Andy, close Visual Studio, delete the .suo file, and restart Visual Studio.
As suggested by Arun Prasad E S, close Visual Studio, delete the .vs folder in your solution directory, and then re-open Visual Studio. (This folder is auto-generated by Visual Studio and contains cache, configuration settings, and more. More details can be found in these questions: Visual Studio - Deleting .vs folder and https://stackoverflow.com/q/48897191.)
As suggested by MrMalith, close Visual Studio, delete the obj folder in your solution directory, clear your temporary folder, and then re-open Visual Studio.
Delete the hidden .vs folder & restart Visual Studio. That worked for me.
I want to expand on Sasse's answer. I had to target the correct version of .NET to resolve the problem.
One project was giving me an error:
"The type or namespace name 'SomeNamespace' does not exist in the namespace 'BeforeSomeNamespace' (are you missing an assembly reference?)".
There was no error in the Error List window but the assembly had a yellow warning sign under "References".
I then saw that the referencing project targeted 4.5.1 and the referenced project 4.6.1. Changing 4.6.1 to 4.5.1 allowed the overall build to succeed.
Nothing was working for me so I deleted the .suo file, restarted VS, cleaned the projected, and then the build would work.
I tried many things like restarting Visual Studio, cleaning and rebuilding the solution, restarting the PC, etc., but none of them worked for me. I was finally able to solve the problem by doing the following:
First of all, make sure all the projects in your solution (including tests) are targeting the same .NET version. Then:
Save pending changes in the project and close Visual Studio
Find the exact location from file explorer and find "obj" file and open it,
Then, delete all the included files (some files won't remove, it doesn't matter, just skip them).
Use run command (by pressing Windows Key + R) and type "%temp%" and press enter to find temporary files.
Finally, delete them all.
On other possibility is that Visual Studio needs to run as Administrator, this might be related to deploying to local IIS server or other deployment need.
Just for the sake of completion and maybe helping someone encountering the same error again in the future, I was using Mahapps metro interface and changed the XAML of one window, but forgot to change the partial class in the code-behind. In that case, the build failed without an error or warning, and I was able to find it out by increasing the verbosity of the output from the settings:
In my case (VS 2019 v16.11.20), disabling Text Editor->C#->Advanced->Enable 'pull' diagnostics in the options solved the issue.
Double check for _underscore.aspx pages in your project.
I had a page and code-behind:
`myPage.aspx` and `myPage.aspx.vb`
when building the project, I'd get errors on the .aspx.vb page stating that properties defined on the .aspx page didn't exist, even though the page itself would build fine and there were NO OTHER ERRORS showing in the output (even with diagnostic level build output).
I then came across a page in the project that was named the same thing but with an underscore: _myPage.aspx - not sure where it came from, I deleted it, and the solution built fine.

TRACKER : error TRK0005: Failed to locate: "xsd.exe". The system cannot find the file specified

In the intent of converting a Microsoft Visual Studio 2015 (VS2015) project with VisualGDB to VS2017 without VisualGDB, I get the following error:
Notes: VS2017 includes a native feature for remote build/debugging.
TRACKER : error TRK0005: Failed to locate: "xsd.exe". The system cannot find the file specified.
Why is that happening and how to solve it?
More details
Opening the project with VS2017 and going to the properties, most of the required settings for remote build are missing. I tried to add/modify the ``.vcxproj` xml to match an new empty project which seem to build correctly remotely.
After this step, the property window of the project seem pretty similar, except an additional XML Data generator Tool section in the not-working project.
When building the project, it shows the following:
1>------ Rebuild All started: Project: project, Configuration: Debug x64 ------
1>Cleaning remote project directory
1>TRACKER : error TRK0005: Failed to locate: "xsd.exe". The system cannot find the file specified.
1>
1>
1>Done building project "project.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
EDITED: it seem related with the inclusion of some sources like:
<Xsd Include="C:\Users\...\xml_file.xsd" />
I just faced the same issue and resolved it through a combination of the following two steps:
Locating xsd.exe on my file system. If it doesn't exist (although it should when Visual Studio is installed), this answer might help.
Adding the path it is in to the "Executable Directories" variable in the properties of the Visual Studio project. (Personally, I don't have Visual Studio installed, so I added <ExecutablePath> properties next to the <IncludePath> ones in the .vcxproj file via text editor)

CMake project in Visual Studio 2017 not rebuilding after first build

I have a project of roughly 50 files that I build with the CMake integration in Visual Studio 2017 (latest release, version 15.0.0+26228.9).
If I regenerate my CMake cache and then build, my project is built normally. However, if I change something in one of my files, then try to rebuild without regenerating my CMake cache, nothing happens.
This is what the build window looks like:
Build started ...
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
Nothing will be built until I regenerate my CMake cache, where I will only be able to build once before getting the same issue.
Same issue happens on any CMake project I try to build. This issue only started happening on the latest full release of Visual Studio 2017, this did not happen in the RC builds.
I ended up repairing the Visual Studio 2017 install from the Visual Studio installer and that fixed it. Everything works as intended now.

Visual C++ 2010 error. The system cannot find the file specified when running LibICP

There is a code for running libIcp for Andreas Geiger. I downloaded the code, and build the sln based on CMAKELISts.txt. Everything good so far.
According "readme.txt" I Opened the resulting Visual Studio solution with Visual Studio and Switched to 'Release' mode, build all and run the demo program. but 1st this window came up:
And Then I got this error:
Any help is appreciated.
You can not run the ALL_BUILD target it does not create an executable. It is there to force building the entire solution. Select an application target from the solution in Solution Explorer. Right click on that target and click set as start up project. This option should be around in the middle of the popup menu.

CUDA + Visual Studio = suppressed output window

Normally, when I use Visual Studio to do a build, I see warnings and errors shown in the output pane, e.g.
1>------ Build started: Project: pdcuda, Configuration: Release x64 ------
Compiling...
foo.cpp
Linking...
foo.obj : error LNK2001: unresolved external symbol "foo"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm doing some GPU programming with CUDA. Upon upgrading to 2.1, I no longer get any useful output in Visual Studio. For example, all I now see is:
1>------ Build started: Project: pdcuda, Configuration: Release x64 ------
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The other details can be found in BuildLog.htm, but it's inconvenient to hunt that file down all the time.
Does anyone know how to force Visual Studio to show the output in its output pane?
Things that don't help:
uninstalling CUDA: the problem persists in all projects
Tools > Options > Projects and Solutions > Build and Run > MSBuild project build output verbosity: changing this pulldown, even to "Diagnostic" has no discernable effect.
EDIT: Additional things that don't help:
devenv.exe /resetsettings
devenv.exe /resetuserdata
UPDATE (in response to Die in Sente): It's now working on one of the two machines (I'm not sure what I did to fix it though). The machine that's still having problems has a CUDA Visual Studio Wizard installed that has caused similar problems before. The still-broken machine had version 15.00.21022.8 of the compiler. The working machine has 15.00.30729.1. After making a backup, I transferred "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64" from the working to the broken machine. I observe no changes in behavior on the broken machine.
I have exactly the same problem, but without CUDA. Today Visual Studio just decided it wasn't going to show any build messages anymore. It was working fine, then one of my builds it just stopped working. The problem persists over all my projects now, and persists over reboots. I also see the correct messages in buildlog.htm. This is ridonkulous!
EDIT: Ooh, I used the add/remove programs to do a repair, and now it works again! Yeah!
did you tried to reset IDE
devenv.exe /resetsettings
or
devenv.exe /resetuserdata
I also recently install CUDA 2.1 (on top of 2.0 I believe). The default installation for CUDA 2.1 moved the SDK from
C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\
to
C:\Documents and Settings\All Users\Application Data\NVIDIA Corportation\NVIDIA CUDA SDK\
which initially caused me some problems. Are all of your paths resolving correctly?
This might sound like a far out suggestion. Get the CUDA SDK and try your code with the sample CUDA-C++ project in there. Maybe something changed in the build rules for CUDA v2.1.
If you go to Tools->Options->Projects and Solutions->Build and Run. Last property is "MSBuild Project build output verbosity". It defaults to Minimal, change it to normal and the build messages will show up in Output window.
This also enables any <Message Text="test message"></Message> output to show up in Visual Studio Build Output Window.
Final solution: reinstall the OS.