Run StyleCop option not showing on right click on file/inside file - visual-studio

I have StyleCop installed on my Visual Studio 2015. But, it does not give the option for running StyleCop on one particular file (on right click). StyleCop only runs on build. I am not getting the StyleCop setting option too. I have Visual Studio 2015 professional edition and I have install StyleCop from Codeplex. I have installed it using Nuget Package Manager.

You can try Visual StyleCop, which is an extension to Visual Studio. This preports to give the right click functionality into Visual Studio 2015
StyleCop.Analyzers gives you something close to the old right click functionality, but at a project level, not a file one. Let me know if you want more info on it.
Update 11 Feb 2016 There is an alpha release of StyleCop (4.
7.50) with Visual Studio 2015 support (but not C# 6).
Update 16 Oct 2018 StyleCop is mainstream available up to VS2017. Options in VS itself are provided by the extension, not the nuget package.

Related

Choose specific VSTO-Version when opening TFS-Project

I do have a TFS Project (TFS 2013) and I would like to set up my Visual Studio 2015 to work at that project. I have Visual Studio 2017 and Visual Studio 2015 installed. Now whenever I go to the main page of my Project and click "Open in Visual Studio" (like described here), Visual Studio 2017 opens. I would like to have it open in VSTO 2015. How can I select which version of Visual Studio should open?
The solution file should contain a UTF-8 signature that describes in which version the solution is to be opened. This is what's used for example to show different icons for solution files targeting different Visual Studio versions.
This signature info is also used by the Visual Studio Version Selector when opening a solution. An easy way to fix this is make sure that have the solution local on your dev machine and then right click -> open with and choose the Visual Studio Version Selector. Then pick the correct version of Visual Studio that you want to use.
This will then be honored by your browser when opening a solution since this also uses the Visual Studio Version Selector.

I upgraded my project from visual studio 2010 to visual studio 2015 but i is there any need to upgrade the msbuild

I am upgrading my project from visual studio 2010 to visual studio 2015
please tell me is there any need to upgraded the ms-build project.
Follow these steps to upgrade project created in earlier versions of VS this may help you:
In VS, on the File menu, click Open and then click Project/Solution,
Web Site, or File, depending on the kind of project you are
upgrading.
In the Open Project dialog box, select a project file, and then click
Open. If VS detects that the project or file was created in an earlier version of Visual Studio, the Visual Studio Conversion Wizard opens.
Complete the Visual Studio Conversion Wizard.
Refrence
is there any need to upgraded the ms-build project?
The answer is No. That because since start with Visual Studio 2013, Visual Studio team made a number of exciting changes to MSBuild for Visual Studio 2013. Now the 2013 version of MSBuild will ship as a part of Visual Studio instead of the .NET Framework. See this blog MSBuild is now part of Visual Studio! for more detail info.
You can find the MSBuild.exe from the directory: C:\Program Files (x86)\MSBuild\14.0\Bin
Since it ships as a part of Visual Studio 2013, just as Michael said, MSBuild upgrade should happen with the VS installation. So you do not need to upgrade the MSBuild separately.
Hope this helps.

Visual Studio 2015 not finding Visual studio 2010

My visual studio 2015 cannot build 2010 platform toolsets. It says:
The build tools for Visual Studio 2010 (v100) cannot be found. To
build using the Visual Studio 2015 (v140) build tools, either click
the Project menu or right-click the solution, and then select "Upgrade
Solution...". Install Visual Studio 2010 (v100) to build using the
Visual Studio 2010 (v100) build tools.
I do not want to upgrade my project or switch the toolset. I have visual studio 2010 installed. It builds the 2012 projects inside visual studio 2015 fine. 2012 also finds the 2010 build tools and builds 2010 projects fine.
Is there a visual studio setting where I can point it to the Visual Studio 2010 directory so that it correctly finds the build tools?
I have tried reinstalling 2010, 2012 and 2015 in that order.
tldr; Visual studio 2015 wont build 2010 projects even though I have visual 2010 installed.
Install this service pack: https://www.visualstudio.com/news/vs2015-update2-vs
Fixed the issue for me. Released March 3, 2016 so it was unavailable at the time of posting.
according to this documentation from microsoft, the toolset is a per-project setting. So you need to change it for all of your VS2010 projects inside VS2015.
To change the project toolset
In Visual Studio, in Solution Explorer, open the shortcut menu for
your project (not for your solution) and then choose Properties to
open your project Property Pages dialog box.
In the Property Pages dialog box, open the Configuration drop-down
list and then select All Configurations.
In the left pane of the dialog box, expand Configuration Properties
and then select General.
In the right pane, select Platform Toolset and then select the toolset
you want from the drop-down list. For example, if you have installed
the Visual Studio 2010 toolset, select Visual Studio 2010 (v100) to
use it for your project.
Choose the OK button.
does that help?

Missing CodeLens references count in Visual Studio Community edition 2015 and 2017

Is there a reason why the references count (code lens) is missing in Visual Studio Community edition?
Is is possible to enable it in the options?
Here is a screenshot of Visual Studio 2015 and 2017 Community edition:
Here is a screenshot of Visual Studio 2013:
source: dailydotnettips.com
I installed the latest SSDT preview for Visual Studio 2015 from the link below on 2 machines I have with VS 2015 Community edition (Update 1), and CodeLens started working for all my projects.
https://msdn.microsoft.com/en-us/library/mt204009.aspx
This isn't a generic reference counting feature, it's just one of the features of CodeLens. CodeLens is only available in Visual Studio 2015 Pro and above. In Visual Studio 2013 it was a Ultimate-only feature.
UPDATE
As others have noted, installing SSDT or SSMS 2016 may enable CodeLens as well. That's because VS 2015 Community is Pro, with a different license and some missing extensions like CodeLens. As long as an extension's binaries and settings are installed, Community will activate the extension.
UPDATE 2019
"CodeLens has been a feature found only in Visual Studio Enterprise, but that will change in an upcoming preview of Visual Studio 2019, when it will also be available for the Community edition, likely in 2019"
What's New in Visual Studio 2019
I have Visual Studio 2015 Community edition and it originally did NOT have CodeLens.
However, after going to Tools -> Extensions and Updates -> Product Updates and then downloading SSDT and installing all options within the SSDT package, my VS 2015 Community Edition now miraculously has access to CodeLens.
On the Tools tab choose Options.
In the open window choose like bellow, and then press ok.
Good Luck!!!
This feature has been disabled in Visual Studio Community 2017, although it sounds like it was temporarily available in pre-release versions.
The Visual Studio Team issued this statement on the 14th of March 2017:
An authoring error in the SQL Server Data Tools resulted in the
capability temporarily showing up incorrectly in Visual Studio
Community when installed; the change you see is a result of correcting
that mistake.
Also, on the Compare Visual Studio 2017 Offerings page CodeLens appears to not be available in the Community edition.
I'm not allowed to Comment on R. Richards answer above, so posting this as a separate answer: CodeLens references disappeared for me too when I upgraded my VS Pro to 2017. But only on my Desktop ("same" upgrade behaved differently on my laptop, where CodeLens settings apparently unaffected). Anyway, very easy to resolve just Enable CodeLens under Text Editor : All Languages
An alternative is to just right-click the member and select 'Find All References' or the hot key shift + F12*. Not only you will find the count of references grouped by project, but also the underlying code lines and their classes.
* As per Visual Studio 2017 Community.

Visual Studio - vdproj is incompatible

I have a project in a solution I am working on in Visual Studio 2012, and I get this message for one of the projects: "This version of Visual Studio does not have the following project types installed, or does not support them." It is a vdproj. What does this mean and how do I resolve this problem
The correct procedure to resolve "Incompatible" issue with VDPROJ Projects coming from Visual Studio 2010 and 2015 in 2017 or 2019 is:
Enter Visual Studio .NET 2017 or 2019
2017: Click on "Tools" -> Extension and Updates -> Online
2019: Click on "Extensions" -> Manage Extensions -> Online
Type "Installer Project" on the search box
Click on "Install" in Microsoft Visual Studio Installer Project
Restart Visual Studio .NET and follow the instructions to install the extension
With this extension the old project (2010, 2015) is capable to work in (2017, 2019). VDPROJ are not deprecated, simply they are improved with a new extension, for more information about this please visit the oficial MarketPlace.
There is also the official:
Microsoft Visual Studio 2015 Installer Projects
Microsoft Visual Studio 2013 Installer Projects
Microsoft Visual Studio Installer Projects (2017 & 2019)
Microsoft Visual Studio 2022 Installer Projects
if you can jump to VS 2013, 2015, 2017+2019, or 2022
But BozoJoe is right, its time to drop vdproj and move on to WiX.
vdproj is a MSI creation project for Visual Studio. Its been deprecated and most people have moved on to either WIX or NSIS or a professional grade installer creation tools such as Install Shield.
If you do not require an installer for your product just exclude the vdproj project from the solution and continue with your life
for fun if you want to try to transition right away to wix, try this powershell script https://github.com/chrisoldwood/vdproj2wix
Visual Studio 2017 can use the Visual Studio Installer. It is NOT a default. You have to run InstallerProjects.vsix. You can get it at Microsoft Visual Studio 2017 Installer Projects. I have used it and worked great, at least for a windows GUI project. It's worth a shot before you get into the Install Shield intricacies.
if You use Microsoft Visual Studio Installer Project (Vs2017).
Microsoft Visual Studio Installer Project may be disabled after an update.
Tools -> Extensions and Updates..
Click Installed
Find and Select -> Microsoft Visual Studio Installer Project
do Enable
Restart Visual Studio

Resources