After applying update 2 VisualStudio 2015 Enterprise can't connect to TFS - exception TF205020 - tfs

VisualStudio 2015.1 Enterprise/TFS integration worked fine until VS2015 update 2 was applied.
Reinstalling/repairing VisualStudio didn't fix the issue, keep getting:
TF205020: Could not connect to server ...... The server returned the following error:
Could not load type Microsoft.VisualStudio.Services.WebApi.Utilities.UserAgentUtility' from assembly 'Microsoft.VisualStudio.Services.WebApi, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
SETUP:
VS Enterprise 2015.2
TFS 2015.2

We had the same issue here. Reinstalling Visual Studio 2015 after deleting cache, user profile folders and registry settings didn't help us. It looks like a TestComplete 11.31 installation installs some assemblies in the GAC which conflicts with Visual Studio 2015 Update 2. We fixed the issue comparing two almost identical systems (one with and one without TestComplete) and these assemblies we deleted from the %WINDOWS%\Microsoft.NET\assembly folder:
Micorosft.VisualStudio.Services.Client
Micorosft.VisualStudio.Services.Common
Micorosft.VisualStudio.Services.Integration
Micorosft.VisualStudio.Services.WebApi
But the problem still existed. After removing:
Microsoft.TeamFoundation.Client
Microsoft.TeamFoundation.WorkItemTracking.Common
the problem was gone!
I hope this will help your issue...

To narrow down this issue:
Check Windows event viewer for more info of the errors.
Try to clear TFS and VS cache ,detail step with this blog
Try to make sure you can access the TFS web
accesshttp://:8080/tfs/web/

The same as this issue: Extension fails to load on VS2015.2, try with the solution in it:
Can you check if Microsoft.VisualStudio.Services.WebApi.dll is
installed into the GAC? The easiest way to do this is to check if
there is a folder that starts with v14.0.0.0 under the
c:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Services.WebApi.
I suspect you have an assembly from VS 2015 RTM or VS 2015 Update 1 in
the GAC. Uninstalling it, will fix the issue.

Thanks to Ernstjan Freriks, this additional info (originally from Microsoft Connect) helped me:
The Tfs client binaries should not be in your GAC. The only way they would get there is to add them yourself, or install some 3rd party application that has added them. Once they are in the GAC they will be loaded instead of the binary that matches your version of TeamExplorer or tf.exe. You need to remove all instances of any Team Foundation binary from the GAC including the following:
Microsoft.TeamFoundation.Build2.WebApi.dll
Microsoft.TeamFoundation.Chat.WebApi.dll
Microsoft.TeamFoundation.Common.dll
Microsoft.TeamFoundation.Core.WebApi.dll
Microsoft.TeamFoundation.Diff.dll
Microsoft.TeamFoundation.Discussion.Client.dll
Microsoft.TeamFoundation.Discussion.WebApi.dll
Microsoft.TeamFoundation.Git.Client.dll
Microsoft.TeamFoundation.Lab.Client.dll
Microsoft.TeamFoundation.Lab.Common.dll
Microsoft.TeamFoundation.Lab.TestIntegration.Client.dll
Microsoft.TeamFoundation.Lab.WorkflowIntegration.Client.dll
Microsoft.TeamFoundation.Policy.WebApi.dll
Microsoft.TeamFoundation.ProjectManagement.dll
Microsoft.TeamFoundation.SharePointReporting.Integration.dll
Microsoft.TeamFoundation.SourceControl.WebApi.dll
Microsoft.TeamFoundation.Test.WebApi.dll
Microsoft.TeamFoundation.TestImpact.Client.dll
Microsoft.TeamFoundation.TestManagement.Client.dll
Microsoft.TeamFoundation.TestManagement.Common.dll
Microsoft.TeamFoundation.TestManagement.WebApi.dll
Microsoft.TeamFoundation.VersionControl.Client.dll
Microsoft.TeamFoundation.VersionControl.Common.dll
Microsoft.TeamFoundation.VersionControl.Common.Integration.dll
Microsoft.TeamFoundation.Work.WebApi.dll
Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader.dll
Microsoft.TeamFoundation.WorkItemTracking.Client.dll
Microsoft.TeamFoundation.WorkItemTracking.Client.QueryLanguage.dll
Microsoft.TeamFoundation.WorkItemTracking.Common.dll
Microsoft.TeamFoundation.WorkItemTracking.Proxy.dll
Microsoft.TeamFoundation.WorkItemTracking.WebApi.dll
Microsoft.VisualStudio.Services.Client.dll
Microsoft.VisualStudio.Services.Common.dll
Microsoft.VisualStudio.Services.WebApi.dll
You can use gacutil to remove these. Once removed your issue should be fixed.

Related

model does not exist in the current context in view after opening project in visual studio 2017

My project was working in visual studio 2012 MVC4 i opened it in visual studio 2017 and i see under URL,model,View Bag,im getting error stating model does not exist,Url does not exist in the current context,
i dont know what im missing something which i have to add when i want to open project in visual studio 2017,in webconfig my mvc version :
System.Web.Mvc, Version=3.0.0.0
i changed it to 4 also but still the same errors,what could be the cause?am i missing a reference?
Are you able to run the project, even though it's giving you errors? I had the same issue when I started using VS2017 with an older project. For some reason, it could not resolve the dependencies and restore packages was not working. However, I am now on VS2017 15.8.6, and a simple "Rebuild Solution" did the trick. Failing that, you can try some of the suggestions mentioned here. Good luck, I hope it helps!

Update 2 Error Adding MVC View

Last night, I updated Visual Studio 2015 on my system from RTM to Update 2. I now get an error message when I try to add a new View to an ASP.Net MVC application I am working on:
There was an error running the selected code generator:
'Expected 1 export(s) with contract name "NuGet.VisualStudio.IVs.PackageInstaller" but found 0 after applying applicable constraints.'
Any ideas on how to fix this? I had no trouble adding a few views to this project yesterday before I installed the update.
tl;dr - Reinstall NuGet Package Manager
I know this is an old thread. But I encounter the same error message today and found no solution online that works for me. So I decided to answer on this old thread for future devs that will encounter the same error message.
The reason for my case is that my NuGet Package Manager was missing.
I recently installed Wekan and it required me to install Visual C++ 2015 Build Tools, and I think that might be the culprit why NuGet was removed.
So, my solution is to download and reinstall NuGet Package Manager:
In Visual Studio open Extensions and Updates Tools > Extensions and Updates (or by pressing ALT+T+U)
On the left pane click Online and search for keyword NuGet Package Manager for Visual Studio 2015, download/install
Restart VS
These are the other solution that worked for some (didn't work for me):
Try clearing the ComponentModelCache, the cache will rebuild next time VS is launched.
Delete NuGet.Config at C:\Users\UserName\AppData\Roaming\NuGet, and restart VS
Unload/Reload project, Clean solution, Rebuild then restart VS
Updating the VS2015 will force you to update after that the whole work you have done so far. Most of the references specially NuGet are changed or outdated in 2015. I am currently using vs2013 with MVC5. I would suggest you to update the references and find a solution about this NuGet package. It might be no longer available for this view you want to add. In addition, there is a similar topic with Q&A to your and it is accessible right here: Unable to Install Any Package in Visual Studio 2015 . Take a look but VS2015 the free version is not that good for coding. Better download visual studio 2013 with update 5 and you will be much better. If you still want to keep it with VS2015, take a look at this and download it.
VS2015 NuGet Manager:
https://visualstudiogallery.msdn.microsoft.com/5d345edc-2e2d-4a9c-b73b-d53956dc458d

Can't run solution from TFS as all references are missing

I have a project which works fine. This morning, I created a new TFS project and published all the code from Visual Studio 2015.
On another computer, also via VS2015, I've logged into Visual Studio Team Services to grab the same project and downloaded all the code
When I try to build, there are over 100 errors, but the cause appears to be the same. It can't find resources, and the error messages all appear to be
The type of namespace name 'some name' does not exist in '....' (are you missing an assembly reference?)
So, I expand the References and I'm missing pretty much all of them. In fact, other than the references within my own project, the rest are not there
Looking at the properties shows no path. Back on the original PC I see the path to any of the .dlls is similar too
C:\Users\Me\Documents\Visual Studio 2015\Projects\MyProj\ToT\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll
Is the issue that since this path doesn't match on the 'faulty' machine it can't show... Therefore what is the solution to this
I checked and noted that the files do appear to exist when I look at them in File Explorer.
All system references missing Visual Studio 2013 NuGet Async did not help
Please note, this happens with all projects in my solution, but not consitently. For example, EntityFramework is missing from all, but System is missing from my UI layer, but not from my BLL layer
Is there a way to fix this?
You need to run the update-package -reinstall command to reinstall all referenced packages.
I had the same problem, there are lots of answers by now but I will still post it here:
1.Close Visual Studio
2.Manually delete the local “packages” folder
3.Reopen the solution, and rebuild. (Nuget should restore the packages)
Source:
http://robertgreiner.com/2013/09/team-foundation-service-build-error-nuget/
Go to TOOLS -> nuget package manager -> package manager console -> and run to the console : UPDATE-PACKAGE -REINSTALL .
Clean your solution, rebuild and you are ready!
Sounds trivial but your missing references to system.xxxx could imply a problem with the .NET Framework, what version are you using and is it installed properly on your 'faulty' machine. Might be worth a re-install/repair? I'd check what versions are actually referenced too.
As for NuGet, make sure that Enable package restore is set as:
Also, I had a problem similar to this once and I had to upgrade the NuGet package manager to version 3 in Tools -> Extensions and Updates (You need to uninstall and then re-install as update won't work)
Finally if that doesn't work, check in File Explorer in the packages path and delete all packages. They should not be included in source control as this is what NuGet will download. If they are there or partially there, sometimes it will not download them.
Verify the .NET version:
Open the project properties pane and check the Target Framework:
Ensure this version of .NET is installed. OR change the target framework to a suitable version
First, go to VS--Tools--Extensions and Updates to check whether there are updates, install all updates. Then select one reference with a warning icon, check the Specific Version property, if the value is True, change it to False.
If the issue persists, check the Reference Assemblies of .Net framwork on your two computers, to see whether they are under the same location (the .Net framework is supposed to be under *C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework*).
=========================================================================
11/5: To avoid references missing, you can either check in all references to source control and reference from the source controlled ones, or use Nuget Package Manager to install packages. The previous is not recommended now, try Nuget Package Manager.
Before hitting your head against the wall with the million of Nuget 'fixes' you need to make sure you are getting ALL the DLLs that are in your Bin folder under source control. For some reason a simple "Get Latest Version" is not enough. Visual Studio will keep telling you all files are up to date but apparently this doesn't mean all the files under source control are downloaded (or it does and what happened to me is just a sassy bug). Anyways, to make sure you are truly "getting all" you need to force an update by using the "Get Specific Version" command with the "Overwrite all" option checked as VS suggests. To do this:
Go to your Bin folder in Source Control Explorer (Or w.e folder you truly want to get all)
Right Click > Advanced > Get Specific Version
Check the "Overwrite all files even if the local version matches the specified version" checkbox
Click Get
By doing this I ensured all the referenced DLLs were downloaded from TFS and for me that solved the problem. I'm using Visual Studio Enterprise 2015.

this template attempted to load component assembly Microsoft.VisualStudio.Web.Project

I just installed Visual Studio 2013 Ultimate trial version for completing the MVC5 tutorial by Rick Anderson, which worht doing it.
The tutorial: http://www.asp.net/mvc/tutorials/mvc-5/introduction/getting-started.
However, I created a blank solution first and then try to add an ASP.Net Application project, which is going to be my MVC5 tutorial project. And I got this weird message:
Error: this template attempted to load component assembly
'Microsoft.VisualStudio.Web.Project, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'. For more information on this problem
and how to enable this template, please see documentation on
Customizing Project Templates.
But I´m not customizing, I´m just creating a project out of a built in template.
Do you know how can I solve it?
Here is the solution:
In Visual Studio 2013, select Tools > Extensions and Updates
Check for updates. You should have the Azure SDK update available.
Download and install the Azure SDK. After this, everything should work fine.
If your updates are not turned on, enable your auto detection of updates in Tools > Options > Environment > Extensions.
If you have unspecified error related to E_fail(code), try this:
When creating a new MVC 5 application, change the framework version from 4.5.1 to 4.5, if that did not work change it to 4. Check the below image if it is not clear.
Another approach:
This is really important if you are installing Visual Studio 2013 on un-updated Windows 7.
there reason i am calling out "not updated is",
The reason that 'un-updated' matters is because Visual studio 2013 does not update the powershell that is required by VS2013 for most of the stuff.
The simple solution is to update Powershell to the latest version.
If you are not sure how to update powershell, you can use this tutorial.
So I stumbled upon this issue as well and would like to share how I was able to resolve this problem.
Tools -> Extensions and Updates -> Online -> NGet Package Manager: Click the download button once you have the NGet Package Manager selected. Make sure to restart your Visual Studio after you have downloaded the Manager.
This should do the trick
Close Visual Studio, run the VS executable with the command line option as shown below (you will likely have to supply the full path), and relaunch VS normally. This should re-initialize the templates, including the one that you are having problems with.
devenv.exe /installvstemplates
So I faced the same problem with Visual Studio 2013, and I don't know what's the problem but it appears that it only occurs when creating a new project, and choosing "Web" from the panel.
What I did was simply clicking on "Visual Studio 2012" just below it, and it worked !

VSIX Custom Checkin Policy not loading

I'm attempting to modify a custom Checkin Policy to work against Visual Studio 2013.
At first, I attempted to just add a new section to the manifest for 2013:
<VisualStudio Version="12.0">
<Edition>Ultimate</Edition>
<Edition>Premium</Edition>
<Edition>Pro</Edition>
</VisualStudio>
and whilst this allowed it to install, it doesn't allow the policy to run (if I go to the policies>>Add section of TFS it's not present, and the policies throws an exception stating that the Policy is not registered).
After much hunting around, I thought perhaps there was an issue with the Policies.pkgdef - The Extension manager in VS2013 shows it as installed, but it's not showing as installed at Pending Changes. However I can't see any issue with it either:
[$RootKey$\TeamFoundation\SourceControl\Checkin Policies]
"VersionOneTFSPolicy"="$PackageFolder$\VersionOneTFSPolicy.dll"
I've opened it and compiled it in 2013, and fixed any reference issues so that it will compile correctly, but it still doesn't seem to like using it.
Does VS2013 manage Custom Checkin policies differently to 2010/2012? From what I can see it should just work with a manifest change and a recompile.
Edit
So I managed to get the custom policy running on VS2013 by upgrading the reference to Microsoft.TeamFoundation.VersionControl.Client from 11 to 12 and upgrading the project to .Net 4.5. However, this now renders the custom policy unusable on VS2012 (and I would assume 2010 too but I haven't tested that yet). Is there a way to have this run on 2010 through to 2013 from a single VSIX?
In the absence of any other solution, I reverted to the tried and tested method of updating the extension and building it as a new package. So simply having a 2012 version and a completely separate 2013 version.
I am trying to solve this as well, and from everything I have found, the only way to get extensions that target all versions is to actually create 3 separate (2010, 2012 and 2013) extensions, and install them using an InstallShield package that has each one as sub-features that get installed in sequence.
Upgrades are then done on each one individually as the VSIX is actually doing the install.
Links that may help you out on this include:
Single extension targeting VS 2012 and VS 2013
How to target an extension in both VS2012 and VS2010

Resources