I have custom check-in policies deploying via VSIX. Now I'm trying to use them in Visual Studio 2013.
What I did:
I opened my policies in VS 2013. Changed "Install Targets" in vsixmanifest to [10.0, 13.0).
Then built project, installed VSIX and opened both VS.
VSIX project uses .NET Framework 4.5, policies project uses 4.0.
What I have:
Last version of my policies in C:\Users\...\AppData\Local\Microsoft\VisualStudio\12.0Exp\Extensions directory
Copies of policies for both 2012 and 2013 VS in C:\Users\...\AppData\Local\Microsoft\VisualStudio\11.0(and 12.0)\Extensions
Key with path to policies in registry for both VS in HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config(and 12.0_Config)\TeamFoundation\SourceControl\Checkin Policies
Now, when I want to apply them in Team Project Settings -> Source Control -> Check-in Policy -> Add, I can choose my custom policies in VS 2012, but VS 2013 just doesn't see them.
What can I do to fix it?
UPD:
So, I solved my problem by changing assembly version of Microsoft.TeamFoundation.VersionControl.Client from 11.0 to 12.0
AND
.NET Framework version in policies project from 4.0 to 4.5
As the Original Poster has posted, the version of .NET and of the referenced Client Object Model:
For Visual Studio 2005, you need to reference the 8.0.0.0 assemblies and your project must be an AnyCPU .NET 2.0 project.
For Visual Studio 2008, you need to reference the 9.0.0.0 assemblies and your project must be an AnyCPU .NET 3.0 project.
For Visual Studio 2010, you need to reference the 10.0.0.0 assemblies and your project must be an AnyCPU .NET 4.0 project.
For Visual Studio 2012, you need to reference the 11.0.0.0 assemblies and your project must be an AnyCPU .NET 4.0 project.
For Visual Studio 2013, you need to reference the 12.0.0.0 assemblies and your project must be an AnyCPU .NET 4.5 project.
For Visual Studio 2015, you need to reference the 14.0.0.0 assemblies and your project must be an AnyCPU .NET 4.6 project.
If you have multiple versions of Visual Studio installed, you need to deploy the assembly multiple times, once for each version of Visual Studio. These assemblies must have the same AssemblyName and the same AssemblyVersion and be signed with the same strong name.
The policies must each be registered in the registry under the following keys:
HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\{VisualStudioVersion}\TeamFoundation\SourceControl\Checkin Policies
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\{VisualStudioVersion}\TeamFoundation\SourceControl\Checkin Policies (64 bit OS only)
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\{VisualStudioVersion}_Config\TeamFoundation\SourceControl\Checkin Policies (should be added automatically by running devenv /setup)
A more extensive walkthrough can be found on my blog.
I had the same problem, a custom policy working on VS 2008/2010 don't install correctly in vs2013. Finally I opened the custom policy project in VS 2013, then I readded Microsoft.TeamFoundation.VersionControl.Client reference and compile it. Now it works and recognize as the same policy that VS2010.
Related
Goal:
I try to open a visual studio project (c#) with CLR code for SQL Server from the Pluralsight course.
Issue:
I get no error messages just warnings below after One-way upgrade on Visual Studio 2017.
Your project is targeting .NET Framework 2.0 or 3.0. If your project
uses assemblies requiring a newer .NET Framework, your project will
fail to build. You can change the .NET Framework version by clicking
Properties on the project menu and then selecting a new version in the
'.NET Framework' dropdown box. (In Visual Basic, this is located on
the Compile tab by clicking the 'Advanced Compiler Options...'
button.)
When I open a solution with single project inside I get message below
The Project Needs to be migrated
or
The Project Needs to be loaded
Tried:
I tried editing csproj files with newer/older version numbers.
I tried different PCs with Visual Studio 2017 and Visual Studio 2015
Idea: Install Visual Studio 2010 as course was released in 2010 BUT I really do not want that.
When I got this issue, I tried reloading the project and when I did, it told me that I did not have an SDK installed and then it offered to install the SDK. Once I had the SDK installed, the project loaded and I was able to work with the project.
Our build environment is VS 2015 (ideally) targeting .net 4.0
We have just re-worked our visual studio plugins based on the Visual Studio extensibility project template in VS 2015. The resulting VSIX works great on VS 2015 & 2017 RC1.
However I would like to target the VSIX at VS 2010 (and ideally 2012). This is where the problems start....
VS 2010 uses .net 4.0.
I drop the compiler to .net 4.0
The VS 2015 (4.5) assemblies wont load (i.e. Microsoft.VisualStudio.Shell.14.0).
Thats OK as I don't use anything in them, so I drop the references to them in favour of the version 10.0 (2010) ones.
Great the code compiles.
But the VSIX package does not
1>C:\Program Files
(x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5):
warning MSB3274: The primary reference
"Microsoft.VisualStudio.Imaging, Version=14.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not
be resolved because it was built against the
".NETFramework,Version=v4.5" framework. This is a higher version than
the currently targeted framework ".NETFramework,Version=v4.0".
So the problem seems to be that if I target VS 2010 I need it to build as .net 4.0, but the VS 2015 build script requires .net 4.5.
I'm wondering if its possible to use the VS 2010 build tools in a VS 2015 project? Or must I convert my VS 2015 project back to VS 2010?
UPDATE
Starting to think this is not possible for other reasons...
https://learn.microsoft.com/en-us/visualstudio/extensibility/faq-2017
The new VSIX v3 format is backward compatible with VSIX v2, so you’ll
still be able to have a single VSIX with a single VSIX ID that
supports Visual Studio 2012 and later. The new VSIX v3 format does not
support Visual 2010 and earlier. To support Visual Studio 2010 onward,
you will need to create a separate extension (with a separate VSIX
ID).
I have ran into similar problem, so I have created a Nuget package called VsixUpdater, which can do the VSIX migration automatically if added to a VSIX project, it even works with older versions of Visual Studio (I tested it with 2012), after adding the package the generated VSIX packages will be V3 and 2017 compatible, see https://github.com/axodox/VsixUpdater for details.
Create a seperate project and VSIX for VS 2010 and another for VS 2012 and later. You can have a look at my source here: https://github.com/ErikEJ/SqlCeToolbox
Notice that I require .NET 4.5.1 for my VS 2010 extension also (simply requires that .NET 4.5.1 is present/installed on the PC, and it is built in to Windows 8.1 and later)
In the end I ended up with 2 projects
A project targeting VS 2010 compiled under .Net 4.0 using a version 2.0 manifest (built using VS 2015).
A project targeting VS 2012 + compiled under .Net 4.5
using a version 3.0 manifest (built using VS 2015).
There has been a certain amount of faffing around with references, but it all seems to work. Our only outstanding issue is the code signing, as VS 2015 will not accept anything below SHA256 and VS 2012 will not accept SHA256....
I am wondering whether the result VSIX artifact of a VSPackage project created and written in Visual Studio 2010 can be deployed to Visual Studio 2008 - provided, of course, that the package does not use/rely on any .NET 4 assemblies?
Alternatively, what other paths may exist, that allow me to create an installable extension targetting both VS2008 and VS2010 from a VS2010 solution?
VSIX is a new feature for VS 2010, so you can't deploy your package to 2008 with a VSIX. You could, however, build a package that targets both 2008 and 2010 and deploy it with a MSI. (MSI deployment of packages in 2010 is still supported.)
I wrote a blog post explaining how you could set up a project in 2010 that would target 2008 and 2010: http://blogs.msdn.com/b/aaronmar/archive/2009/12/07/targeting-vs-2008-with-the-visual-studio-2010-sdk.aspx
I notice that Visual Studio 2010 database projects have a re-distributable component to support the deployment on end-user systems.
Will this component work against .Net 3.5, or does it require .Net 4.0?
From what I can tell, Visual Studio 2010 database projects will require .Net 4.0 on the target machine. If you inspect the redistributable components in %ProgramFiles%\Microsoft Visual Studio 10.0\VSTSDB\Deploy using Reflector, you'll see that they all depend on version 4.0.0.0 of the framework libraries.
In addition to this, the .deploymanifest files (which are really MSBuild files in disguise) specify 4.0 as the MSBuild tools version.
It looks like you would need to use Visual Studio Team System 2008 Database Edtion GDR R2 (which of course requires VS 2008) if you want to target .Net 3.5 on the database server.
I was hoping there would an option somewhere that would just let me open my VS 2008 projects and continue working in .Net 3.5 - while using some of the neat new VS UI enhancements.
Yes, Visual Studio 2010 allows you to target previous versions of the CLR/.NET framework at the project level.
When you open the Visual Studio 2008 project file in Visual Studio 2010 it will convert the project file for you. Once this is done, it will be smart enough to target the proper framework and runtime version for you (.NET 3.5 and CLR 2). If it doesn't, you can change this yourself on the property sheet for the project.