sábado, 16 de julho de 2016

How my Visual Studio started working again after I decide to update

I was using VSE2015 (E for Enterprise) for a few months more than 5.

It was Sunday 10th July 2016
Then I decide to test this Xamarin thing and some option like MVC wasn't appearing in my projects option.

I've downloaded a VS from a external link (not from Microsoft's), at that moment I didn't knew that I could download the ISO from they own web site.

After that I uninstalled my VS to install the new one. I didn't want to update nothing, I wanted get everything new from the beginning [lol].

I select custom installation and I checked every thing that I wanted(Android something, Xamarin, web tools, it took me about 33GB)



As you can see in the screenshot over there.
Since the stupid VS setup didn't told me that I needed internet connection to install those items that I had selected I was installing with and without the internet.
I had the internet turned on, but every time I saw getmac.exe command window I turned off. It was too suspicious. At first I thought that that was a virus because I've download from a untrusted source (for me it wasn't).
But my 2 antivirus didn't say anything and from my Windows knowledge no strange application has arrived my PC without me knowing that day.

So I realized that it was really from VS installation process and the more suspicious thing is that every time I turned off the internet, after a amount of time the getmac.exe appeared like he was expecting me to do that.

Since MS has being accused of spying and other things, I wasn't let any probably spying action ruin my day, so I was turning on and off the internet (I was also downloading other things). If MS wanted to spy the loyal user (I'm talking about me) they could spy another day, because that wasn't the right time.

I even learn how to what the programs that was using internet through cmd, I was so focused on watch who's using the internet and what their doing that I some people could call me "CIA for a day" [ROTFL, LOL ][Joking]

After several hours, the setup finished and when  I tried to open one of my projects ... Sh**t I got an error that I never saw before on any moment of my VS user's life



Then after that, it was error after errors, project not loading, vbc.exe error , etc etc


  







After that I've repaired several times and nothing was working I uninstalled and re-installed several times and nothing was working till today 16.07.2016



Well after some advice from Social.Msdn,Microsoft  and other places on the web my VS is finally working. But I didn't test ASP.NET and there's still many problems that I may find later.
I've done many things to put him back to work.
I've uninstall and re-install more than 4 times.
I decide to delete and uninstall everything related with VS that I could, since VS wasn't working anyway I wouldn't lose anything special.
First thing I did was uninstall the VS, then
I've download msiinv.
Then I opened cmd and went to the directory were msiinv was trhough 'cd':
msiinv.exe -p >msiinv.txt
Then I open the msiinv.txt and search for "visual studio" so I uninstalled the following programs
PS: To uninstall locate the program data folder give a right click to the msi file

PS2: Only uninstall what matches with the version of VS you're trying to fix, and I didn't unistalled nothing that took ASP.NET or just .NET, because IIS may need that or other programs.
PS3:Since I wasn't expecting successful results I may put 2 or 3 items more than I really uninstalled, but I can tell you that there's no more than 3
Microsoft Visual Studio 2015 Update 3 Performance Debugger Web Views
Microsoft Visual Studio 2015 Update 3 Diagnostic Tools - amd64
Team Explorer for Microsoft Visual Studio 2015 Update 3 CTP1
Microsoft Visual Studio Team Foundation Server 2015 Update 3 CTP1 Office Integration Language Pack (x64) - ENU
Microsoft Visual Studio 2015 Update 3 Diagnostic Tools - ENU
Microsoft Visual Studio 2015 Windows Diagnostic Tools - ENU
Microsoft Visual Studio Team Foundation Server 2015 Update 3 CTP1 Storyboarding (x64)
Microsoft Visual Studio 2015 Update 3 IntelliTrace Front End
Microsoft Visual Studio 2015 Update 3 Diagnostic Tools - x86
Microsoft Visual Studio 2015 XAML Visual Diagnostics - ENU
Microsoft Visual Studio 2015 XAML Application Timeline
Microsoft Visual Studio Connected Services
Microsoft Visual Studio 2015 Update 3 CTP1 Team Explorer Language Pack - ENU
Microsoft Visual Studio 2015 XAML Visual Diagnostics
Microsoft Visual Studio Team Foundation Server 2015 Update 3 CTP1 Office Integration (x64)
TypeScript Tools for Microsoft Visual Studio 2015
Microsoft Blend for Visual Studio 2015
Microsoft Visual Studio 2015 Update 3 IntelliTrace (x64)
Microsoft Visual Studio Services Hub
Microsoft Visual Studio 2015 Windows Diagnostic Tools
Microsoft Visual Studio 2015 XAML Designer - ENU
Microsoft Visual Studio 2015 Shell (Minimum) Interop Assemblies
Microsoft Visual Studio 2015 Update 3 Diagnostic Tools - amd64
Microsoft Azure Shared Components for Visual Studio 2015 - v1.8
Microsoft Visual Studio 2015 XAML Application Timeline - ENU
Microsoft Visual Studio 2015 XAML Designer
Microsoft Visual Studio 2015 Update 3 Diagnostic Tools - x86
Microsoft NuGet - Visual Studio 2015
Microsoft Visual Studio Team Foundation Server 2015 Update 3 CTP1 Storyboarding Language Pack (x64) - ENU
Visual Studio Graphics Analyzer
Microsoft Visual Studio 2015 Profiling Tools
Microsoft Visual Studio 2015 Update 3 IntelliTrace (x86)
Microsoft Azure App Service Tools v2.8.1 - Visual Studio 2015
Microsoft Visual Studio 2015 Update 3 Diagnostic Tools - x86

After that I was deleting all folder related. Since my VS program files(x86) folder wasn't delete idk why, I decide to delete the folder.
C:\Program Files (x86)\Microsoft Visual Studio 14.0
I used a program called NSIS and I made something to delete
Delall -VS2015 its like a normal text file, just download NSIS, edit the file and compile.
Do not try to make cool editions, most of the folder are there, you'll need to add a few more.
run this through cmd -> mkdir C:\TestDeletion\WillBe then test with this https://1drv.ms/u/s!AtDflKLIrdZEjrdC4Lw40plXpPW5rw
You will see that the folder above will be delete, so its safe as long you know what you're doing.

After those steps I delete everything from the Recycle Bin and start to manually delete all this folders
PS: Don't delete permanently because, something may occur  and you won't be able to restore, except Blend and Team Foundation, since I don't like the "Blend" name and I never used TFS I delete permanently and nothing wrong happened 
PS2: I also delete VisualStudioSecondaryInstaller ,permanently 
"C:\Users\Username\AppData\Local\Microsoft\ApplicationInsights"
"C:\Users\Username\AppData\Local\Microsoft\Blend"
"C:\Users\Username\AppData\Local\Microsoft\Team Foundation"
"C:\Users\Username\AppData\Local\Microsoft\TeamTest"
"C:\Users\Username\AppData\Local\Microsoft\VisualStudio\14.0"
"C:\Users\
Username\AppData\Local\Microsoft\VisualStudio\SettingsLogs"
"C:\Users\
Username\AppData\Local\Microsoft\VisualStudio\vshub"
"C:\Users\Username\AppData\Local\Microsoft\VSCommon\14.0"
"C:\Users\Username\AppData\Local\Microsoft\VsGraphics\14.0VsNow"
"C:\Users\Username\AppData\Local\Microsoft\vshub"
"C:\Users\Username\AppData\Roaming\Microsoft\Blend"
"C:\Users\Username\AppData\Roaming\Microsoft\VsGraphics\14.0VsNow"
"C:\Users\Username\AppData\Roaming\Microsoft\VisualStudio\14.0"
"C:\ProgramData\Microsoft\Blend"
"C:\ProgramData\Microsoft\VisualStudioSecondaryInstaller"  
"C:\ProgramData\Microsoft\VisualStudio\14.0"
"C:\ProgramData\Microsoft\Team Foundation"


Then I turned off the internet and installed the "vs2015.3.ent_enu.iso" downloaded from MS official website.
After the installation complete it gave some error about analitics tool or something that couldn't be downloaded.

Then I try to open my VS projects from VB and C#, the I had an error telling to re-install Visual Studio (sorry I forgot the entire error name).
Then I made some researches and someone was saying that delete some registry entries didn't worked for him, so I decide to do that.
I delete those:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Remote
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\ABExp
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\Telemetry
and then I turned off the internet and repaired VS with the "vs2015.3.ent_enu.iso

And that's how everything worked again for me.

Please share this for every one that needs