visual studio 2012 ,tfs project loading failed - asp.net-mvc

My admin of the TFS rename the project name and when i get the latest version all other projects are loaded to my local visual studio but the project which have been renamed is not loading . I tried to delete the solution from the local mapped path and then got again latest version but still the problem is same and its give me a message that the Project file .csproj has been moved ,rename or not in you computer. I also tried to delete the .SUO file and get specific and latest version restart visual studio added the existing project to solution . I spent many days to resolve the issue but I am not able to do so , can any one help me in this Problem ,

Check the solution file when it comes our of TFS. I have had an issue similar to this, and I could see the correct files comin out of TFS into my local workspace, but the minute I loaded it it VS, all of the old code came back.
Eventually I discovered the solution file still referenced my old code, which caused it to be loaded in from the TFS profile.
See if the admin physically renamed the files in TFS but didnt change the details in the soluton and project files.

Related

NullReferenceException when installing any Extension in VS2019

I got the exact same problem posted here:
Attempting to Install an extension to VS2019 results in a NullReferenceException
Same error, same log.
But since I cannot comment nor answer and the question has not been answered as of yet, I'm asking again.
I am using VS2019 Community, but I had VS2017 Enterprise at one point. (student license)
Every single extension I tried to install so far has led to this error. For example "Live Share", "Open Command Line", "Github Extension for Visual Studio", "Markdown Editor".
I believe it started with Live Share when suddenly an update wouldn't install for no reason. I guess that was back with VS2017 even. But I cannot recall, I just assume. With the newly installed VS2019 I was never able to install any extension via the in-app Extension feature, nor by downloading with browser and then trying to open it.
What I've tried:
0) Every suggestion by Perry Qian-MSFT
1) Repairing Visual Studio 2019
2) Reinstalling Visual Studio 2019
3) Uninstalling "Live Share"
4) Deleting various Folders or contents thereof:
C:\Users\Admin\AppData\Local\Microsoft\VisualStudio
C:\Program Files (x86)\Microsoft Visual Studio\2017 (trying to get rid of any remnants)
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\Extensions
Next I'll deinstall as much as possible: VS2019 and Installer and try to see what's left, what could have remained that causes such pain in the a***.
But since my internet will be busy with reinstalling afterwards for a while this question goes up now.
Update1: The installer made some problems getting uninstalled. Deinstallation via Windows Software Management failed with an error but it was still removed from the list. Now I've deleted the folder and will try and reinstall the installer. I don't know why I didn't try that before throwing it all over board.
Update2: I decided to start with a simple barebones VS2019 version without any workloads. But it still doesn't work. So back to throwing everything out and looking for the remainder.
Update3: I now tried to delete various folders then reboot and tried to reinstall a barebone VS 2019 Community again. Still same error.
Here's a list:
C:\Program Files (x86)\Microsoft Visual Studio Tools for Unity
C:\Program Files (x86)\NuGet
C:\Program Files (x86)\MSBuild (except for .\Microsoft\Windows Workflow Foundation)
C:\Users\Admin\AppData\Local\Microsoft\VisualStudio Services
C:\Users\Admin\AppData\Local\Microsoft\VisualStudio\Packages
C:\Users\Admin\AppData\Roaming\Microsoft\Microsoft Visual Studio
C:\Users\Admin\AppData\Roaming\Microsoft\VisualStudio
C:\Users\Admin\AppData\Roaming\Visual Studio Setup
C:\Users\Admin\AppData\Roaming\vs_installershell
C:\Users\Admin\AppData\Roaming\vs-report-problem
C:\Users\Admin\Documents\Visual Studio 2013
C:\Users\Admin\Documents\Visual Studio 2017
C:\Users\Admin\Documents\Visual Studio 2019
Oddly enough my personal settings are still persistent. So these will be my next target. But where are they stored? Any pointers?
Update4: Seems like settings are stored in a cloud, hm. I made a local backup and tried to reset them resulting in yet another error.
Your settings were reset, but there were some errors.
Error 1: An error occurred while importing settings for 'Product Updates' [code 5396].
Was this 'Product Updates' Setting the culprit?
Update5: The settings reset didn't seem to accomplish anything at all.
Update6: So, I've signed out of VS, reinstalled VS2019 again and this time it seems like settings were actually reset. Still no luck. This is getting really frustrating.
That's it. I'm done. Apart from reinstalling Windows 10 I have no clue what could help now. Maybe there was some registry error? I am lost here.
Thanks to #dxiv who made me aware of the InstallCleanup.exe.
I don't know what that tool does additionally to what I did and I cannot tell what was wrong in the first place. But that thing actually helped!
Thanks again!

References don't show up in Visual Studio 2017 after creating a .NET Standard branch

I'm working with Visual Studio 2017 on the open-source project https://github.com/SpiegelSoft/XamarinForms.Reactive.FSharp
I recently created a branch called dotnet-standard, which, as its name suggests, is a migration to .NET Standard. However, after creating this branch and checking back in to the master branch, which is a PCL rather than a .NET standard library, the project will no longer build.
First of all, the references are not visible. All I can see in Visual Studio is a .NET node (see screenshot).
The build fails in the first instance with
Xamarin.Forms targets have been imported multiple times. Please check your project file and remove the duplicate import(s).
This is odd because the same fsproj file was working before I created the new branch.
When I delete the Xamarin.Forms import line in my fsproj file and then perform a git reset --hard, the error message changes to
Your project is not referencing the ".NETPortable,Version=v4.5,Profile=Profile259" framework. Add a reference to ".NETPortable,Version=v4.5,Profile=Profile259" in the "frameworks" section of your project.json, and then re-run NuGet restore.
But the IDE won't even let me a a project.json file. Something has clearly gone very wrong with my Visual Studio settings.
Does anyone have any obvious tips before I reinstall Visual Studio?
As alluded in the comments, VS / MS Build can trip up on previously generated files - often in the various obj folders.
To get back to a ‘clean’ state (the same as when you first clone a repo), run git reset —hard to revert any uncommitted changes and git clean -xfd to remove any untracked files and folders.
Assuming your .gitignore file is configured correctly, this last step should remove all temporary files.

NuGet: Error HRESULT E_FAIL has been returned from a call to a COM component

When I try to add a new package with NuGet I get the error
Error HRESULT E_FAIL has been returned from a call to a COM component.
I've checked several posts about this and tried alot of solutions but can't seem to find the issue. It might be worthing noting that I moved and renamed my project at some point and the copy I left behind still functions with NuGet packages.
After looking into it some more I found this error:
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at EnvDTE.SourceControl.CheckOutItem(String ItemName)
What I've tried already:
Deleting the user.csproj and/or .suo
Checking all project references and if they are located correctly
Deleting Temp files
Deleting bin & obj folders
Deleting the ProjectTemplatesCache
Checking the project web properties
Restarting VS, cleaning and rebuilding the project (always run in
admin).
Deleting the ComponentModelCache
Deleting packages folder content and restoring NuGet packages in
solution.
Check-in all pending changes to version control before attempting to
add a new NuGet package.
I just had this 01.08.2019 with both Visual Studio 2019 and Visual Studio 2017. I've tried the following solutions which did not work:
https://social.msdn.microsoft.com/Forums/officeocs/en-US/4eea5785-0a83-4389-89e3-209a5a4432c0/referencemanagerpackage-fails-to-install-vs-2017-community-edition?forum=vssetup
Error HRESULT E_FAIL has been returned from a call to a COM component on Add Reference
What worked for me is simply deleting the .vs folder and also deleting everything from the packages folder of the solution I was using. Then I ran Restore NuGet Packages on the solution level.
Checking in all pending changes and then performing a 'check-out for edit now' did the trick.
I had this problem with a log4net version on a build server. After backing up the local source folder I removed it, then started up visual studio, went to the Source Control Explorer, found my solution and went to Check out for Edit.
Once I had a new local copy of latest version, had to go to the directory on disk and replace the log4net package.
Then go back to visual studio, and build the solution, which built ok now. Then check everything in again, and the build server was fixed.
It can be happen when you create a Project in upper version Visual Studio and working in lower version Visual Studio.
Check which version Visual Studio you create your project and now working in which version Visual studio.
Try it on latest version Visual Studio.

Error: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found

I have migrated a VS2008 solution to VS2013. My solution contains VC++ projets.
I have set the tools platform to v120_xp for each project
My solution compile on my computer and compile on my builds server in VS2013
My builds server is a Windows2008 R2 with VS2008, VS2010 and VS2013 and a build controler of TeamFoundationServer 2010.
When i launch the build with the build controller, the build fails with :
The imported project "C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was
not found. Confirm that the path in the declaration is
correct, and that the file exists on disk.
In the V110 directory this file doesn't exist but it exist in the V120 directory.
I have checked the registry :
HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersion\12.0
the VCTargetPath are corrects
Have you an idea to help me?
I have edited the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\12.0\11.0
and
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0\11.0
to use the V120 directory
Now my server build the solution, but i don't understand why MSBuild use the key
ToolsVersions\12.0\11.0 and not the key ToolsVersions\12.0\12.0
Parhaps it's due to the v120_xp platform toolset
The true answer is that MSBuild subtracts 1 from the .sln Visual Studio Version. Since you do not have VS 2012 install or you have not installed it, the v11.0 folder is not found. It is all explained by Sayed Ibrahim Hashimi:
http://sedodream.com/PermaLink%2cguid%2ca5894bad-f2a1-441a-a5b2-74f16c6cf8aa.aspx
I came across the same problem in 2015 though, with Windows 10 and Visual Studio 2015 RC (fresh install)
To correct the issue I tried several solutions based on my research ie installing "VS Windows SDK" which didn't do anything different to resolve my problem, I then on another recommendation installed GitHub in order to download MSBuild which is now excluded from VS, I ultimately downloaded and installed "VS Tools for Windows 10" this didn't give me the same error in the end, without having to change registry keys
Installing VS 2012 on your build server should create the necessary targets files for you.
I was able to get past this by changing $(VCTargetsPath) to $(VCTargetsPath12) in the project file.
This feels like a temporary workaround rather than a permanent solution, since once we move to the next version of Visual Studio we'll have to find all the references to $(VCTargetsPath12) and replace with the new target path.

TFS does not build projects correctly

HI
I am trying to build my solution using TFS but it seems to skips the projects which have dependencies.
e.g Proj B depends on Proj A , then it builds only Proj A and not Proj B.
Also if i try to build the projects individually instead of the solution then it does not create the release folder. It says that the output path is not found.
Any help is much appreciated
thanks
Is the SLN file in question converted from an older version of Visual Studio?
I've found that sometimes, like when you upgrade from a VS2003 SLN file to a VS2008 SLN file, it fails in MSBuild (which is what TFS is doing essentially).
Try making a new SLN file in VS2008 (or whatever version you're using) with the same project and see if that fixes it...
If you right-click the solution, one option you'll have is dependencies. Make sure that the projects are correctly setup there, even though they may reference each other the dependencies on the solution itself may not be complete or accurate...and this is what MSBuild uses.
Have a look in the configuration manager and make sure that the build you are running has those projects selected to build.
It may be you are running the Debug configuration for your local build and then running Release on the TFS server and it's not configured the same.

Resources