Visual studio - build selection not available - visual-studio-2010

In Microsoft Visual Studio 2010 the option to build a single file, via the command "Build Selection" has suddenly become unavailable. I can however still build and as far as I know I did not change any solution/project properties.
What can I do to make this option available again?

If you open a file and do not [add it to a project] then apparently MSVS doesn't know how to build it. Simply adding it to my project fixed this problem.

Related

Visual Studio debugger starts Solution build

I've designed a Visual Studio 2022 solution that contains 6 projects. One produces an executable (.exe) and the others produce dlls that are consumed by the executable. I've noticed that when I try to debug the executable, Visual Studio starts a build for the solution every time I debug. I'm at a loss as to why it builds the solution when nothing has changed in any project. I'm assuming that something in a project is causing the build to occur, but, I don't know what that may be.
Any ideas on how to troubleshoot this?
Update: This solution is built for.Net5. I found this setting in the options under SDK-Style projects that does not appear to work.
Go Tools->Options->Projects and Solutions->Build And Run, set MSBuild output to Detailed, build the project, check the output log.
You can also try resetting all settings.
The post, "Visual Studio not auto-building when I press the debug button" solved my problem. I set the following to force Visual Studio to NOT build each time I started the debugger.

Unable to debug issue Apache cordova project in vs 2017

I have install visual studio 2017 with almost all components on my PC (windows 8.1) but when I Add new Apache Cordova project and run it will show
"unable to start debugging. The startup project cannot be launched. Ensure that the correct project is set as the startup project. The startup project can be changed by selecting 'Set as startup project' command from right click menu solution explorer. Additionally make sure its debug settings are correctly configured in the project properties" Other project types are work fine. Project Properties
I have already set startup project but it is not working please help
In case someone is struggling with the same, here's the step to fix it. Go to Visual Studio "Tools" > "Extension and Updates" > then search for "Cordova". Make sure it is turned on:
I just lost a couple of hours to this error. For me, the solution was to follow the instructions available at this link:
In case that link ever dies, here is a copy of the instructions:
If you get a message in Visual Studio that says you can't start debugging your app, try these steps. Also, try these steps if no emulators or devices are listed in the debug target dropdown list.
Close all instances of Visual Studio.
Open this folder:
C:\Users\username%appdata%\Local\Microsoft\Phone Tools
Rename the CoreCon folder to any other name (CoreCon will get recreated when you rebuild).
Restart Visual Studio and try again.

VS2013 Build "Does not support previewing"

Every time I try to build my solution in VS2013, nothing builds, no errors - But in the status bar it says: "This item does not support previewing"
I googled around a bit but have come up empty.
But if I right click on each project and select build it works fine.
Any ideas?
Perhaps this message is totally unrelated... Post hoc ergo propter hoc
Steps to reproduce on my machine:
Right Click any project in solution: select build
Status bar displays Build successful
Right click solution select build
Status bar displays : "This item does not support previewing"
Perhaps it isnt related, but it sure does appear to be.
I was able to fix this... Somehow nothing was selected to build in the solution configuration. I right clicked on the solution, went to properties and then selected COnfiguration Properties and clicked the Build box for all the projects...
I have no idea how they became unchecked, only thing I can think of is a co-worker was trolling me.....
I've had this problem (i.e. debug not starting, and no error message) with Visual Studio 2015 in the following two cases:
after loading a solution that had previously been built with Visual Studio 2010
and also after using the "save as" function in Visual Studio 2015 to update a solution that had been started with Visual Studio 2010 (using Save as updates the solution file and sets the active Visual Studio version to 14 - i.e. VS 2015).
In both cases, deleting the bin and obj directories under the startup project fixed the problem. It's also worth closing visual studio and making sure that there are no {yourprojectname}.vshost.exe processes still running - if there are then kill them before running visual studio again. On that note, if you have multiple versions of visual studio on your machine, you should also check that you don't have the same solution open in the other version of visual studio at the same time (I've done that one myself).
One of the comments here suggests disabling the "enable visual studio hosted process" option. Don't do that if you can at all avoid it: you'll lose lots of debugging functionality (particularly in the area of being able to edit code while your solution is running).
Hope that helps someone out there.
Solution for VS2015
"this item does not support previewing" vs2015 (Visual Studio 2015/2016)
Step 1. Go to Control Panel -> Programs and Features
Step 2. Uninstall all: Windows Software Development Kit - Windows 10.0.10586.15 (maybe you have diff ver)
Step 3. Download new latest Windows Software Development Kit
https://go.microsoft.com/fwlink/p/?LinkId=619296
Install & Create new project, Done!
Dclick on MainPage.xaml and you will see Loading designer...
1: Add below lines in App.conf
<specFlow>
<unitTestProvider name="MSTest"></unitTestProvider>
</specFlow>
2: add a reference to Microsoft.VisualStudio.QualityTestTools.UnitTestFramework.dll
right click on your project and select: Add Reference
3: add using Microsoft.VisualStudio.TestTools.UnitTesting; in Step Defination
4: goto feature file and run it. This is what solve my problem on vs2013
I faced same issue with .aspx file. I just right click on the .aspx file and select open with (HTML Editor). You can choose any form the list.
I have come across the same issue for me, I have opened a project in VS 2010 and then when I open the same in VS 2015 then his error has occurred.
Solution:
By Closing the VS2010 project solution fixed the issue.

Can't open a TFS build process template with Community Build Extensions in VS2012 using the dummy-project-with-refrences trick

I'm trying to open a TFS Build Process Template (DefaultTemplate.11.1.xaml) file, incorporating an activity from Community TFS Build Extensions. I'm following instractions from here, section Get the custom activities into Visual Studio. I had no problems with that back in the RC version of Visual Studio 2012 but now, after upgrading to the release version, an attempt to open the file ends up in an error:
System.Xaml.XamlException: 'The type ‘InArgument(mtbwa:BuildSettings)’ of property ‘BuildSettings’ could not be resolved.'
TFS itself doesn't seem to have any problems running builds based on this template.
I am able to open the file without the trick, but then of course the custom activities are not displayed properly.
Check this out:
http://blogs.blackmarble.co.uk/blogs/rfennell/post/2012/08/30/Type-InArgument(mtbwaBuildSettings)-of-property-BuildSettings-errors-in-TFS-2012-RTM-builds.aspx
Quote:
"if the Visual Studio class library project you were using to manage the process template editing was targeting .NET 4.5, it needed to be 4.0. Well with Visual Studio 2012 RTM this is no longer the case, in fact it is the other way around."
I don't really think this is a great answer but I don't have enough rep to comment...
Build action on the xaml file is set to None?
I had a similar issue when opening build templates in VS 2012 RTM, but I was able to open the xaml "a little," meaning that I could open it in the workflow designer, but a lot of it was just the error activity. I found some errors to the effect that I should add references which I had not needed before (neither in VS 2010 or VS 11), such as PresentationCore and PresentationFramework. I wish I remembered more detail to pass on to you on this point.

How can I force Visual Studio 2010 to reload files and projects that have changed on disk?

I often use command line tools to do source control updates of files and projects that I have loaded into Visual Studio 2010. With previous releases when I did this I could force Visual Studio to notice and load the changes by doing a Save All. This doesn't seem to work in Visual Studio 2010.
I do have 'Detect when a file is changed outside the environment' checked in the Options window, but if I sit and wait it takes minutes or longer for the changes to be noticed.
How can I force 2010 to notice the changes in loaded source files and projects?
You can reforce reloading a project by unloading and loading the project.
Right-click the project and select Unload Project, then, when the project is unloaded right-click again and select Reload Project.
Note that this requires that all modified files in the project either be saved or the changes in the file be discarded.
It sounds like this could be the same problem that I experienced here. VS 2010 doesn't seem to pick up on file changes made outside the IDE (like if you add a file to the file system, and then click refresh in Visual Studio you don't see the new file, I experienced this on C++ projects).
You can refer here for the MS case, they claim they have fixed the problem in "the next VS release", which I assume would mean the first service pack for VS 2010.
Win7 shouldn't be a pre-requisite, though its possible an earlier edition (pre-SP1) of Visual Studio didn't work it. Upgrade always works, for reference the track changes option also needs to be turned on.

Resources