10

I don't recall the previous version I had (it could have been 16.8.1), but updating just now to 16.8.4 results in none of my solution projects being able to load. Here's the output window for one of my solutions:

F:\Users\username\Documents\Visual Studio Projects\FitnessManagerCore\FitnessManagerCore\FitnessManagerCore.csproj : error  : The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets" is correct, and that the file exists on disk.  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.CSharp.CurrentVersion.targets

F:\Users\username\Documents\Visual Studio Projects\GeneralUtilities\GeneralUtilities\GeneralUtilities.csproj : error  : The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets" is correct, and that the file exists on disk.  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.CSharp.CurrentVersion.targets

F:\Users\username\Documents\Visual Studio Projects\FitnessManagerCore\FitnessManagerConsole\FitnessManagerConsole.csproj : error  : The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets" is correct, and that the file exists on disk.  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.CSharp.CurrentVersion.targets

VS advised to try to reload the projects manually. When I attempt this, I get the following error message:

enter image description here

It seems Microsoft has no means to roll back a previous installation. I do not have a restore point. I do not want to uninstall/reinstall.

Edit:

I just tried creating a new solution to see what would happen if I tried to load one of my existing projects. When creating a console app w/ .NET Core, I get this:

enter image description here

Update:

This latest VS 2019 simply does not want to work on my machine in any capacity. I uninstalled VS 2019, rebooted, and attempted to reinstall. The installation stops midway with the below error message. When I click "Report this problem", it opens a Microsoft web page to report the issue, but says "Disconnected from Visual Studio". Since I can't roll back to a previous version according to what I'm reading, I guess I just can't use VS 2019 anymore.

enter image description here

oscilatingcretin
  • 10,457
  • 39
  • 119
  • 206
  • 1
    Thanks for the warning. AFAIK, a restore point is the only way. MS does not make previous versions available for download anywhere. If someone knows how to install the last good version, which was 16.6.x, it would be an immensely valuable contribution to the community. – Kevin Krumwiede Jan 15 '21 at 19:50
  • It's time to rename `Microsoft` to `Buggysoft` or `Zerotestedsoft` (better late than never). Theirs `Skype` works not better. – Alexander Dyagilev Jan 15 '21 at 19:57
  • 1
    @AlexanderDyagilev It's interesting how you can see hints of their internal structure or policies in their products. I've always thought VS was one of the best IDEs around, if not hands down *the* best, but msbuild and anything related to Azure were garbage. We could distinctly see the rot spread to VS between 16.6.x and 16.7.x. Makes you wonder who they hired or fired. – Kevin Krumwiede Jan 15 '21 at 20:02
  • I see the Visual Studio Installer creating restore points all the time... Have you run the Visual Studio Installer and tried repair? – Chuck Walbourn Jan 15 '21 at 23:09
  • @ChuckWalbourn I ran the repair. It basically did a full reinstall, it seems. No luck, though. Still getting the same errors. – oscilatingcretin Jan 27 '21 at 14:58
  • OK, so it still says you are missing ``C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets``. Can you look in that directory and see if the file is there or not? – Chuck Walbourn Jan 27 '21 at 20:30
  • @ChuckWalbourn The only part of that path I have is `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin`, so it's missing the `Roslyn` directory altogether. I searched the entire 2019 folder for `Microsoft.CSharp.Core.targets` and it found nothing. – oscilatingcretin Jan 28 '21 at 00:40
  • 1
    OK, run "Visual Studio Installer". Modify. Then go to the tab "Individual Components". Search for "roslyn". I see I have "C# and Visual Basic Roslyn compilers" installed on mine. It looks like is part of the ".NET Core cross-platform development" workload. – Chuck Walbourn Jan 28 '21 at 01:01
  • @ChuckWalbourn Under Individual Components, I have `C# and Visual Basic Roslyn compilers` checked – oscilatingcretin Jan 28 '21 at 01:18
  • @ChuckWalbourn This is all messed up. I uninstalled and attempted to reinstall. Partway through, it crashes with the error `couldn't install microsoft.visualstudio.vswebprotocolselector.msi`. – oscilatingcretin Jan 28 '21 at 01:27
  • You might want to do a scandisk on your system first., – Chuck Walbourn Jan 28 '21 at 04:20
  • @oscilatingcretin "*installation stops midway*" - Maybe try [`InstallCleanup.exe`](https://learn.microsoft.com/en-us/visualstudio/install/remove-visual-studio?view=vs-2019) before reinstalling. – dxiv Jan 31 '21 at 00:32
  • @dxiv Thanks, I will look into that as a nuclear option since it will also uninstall my 2017 installation which I use extensively. I don't trust Microsoft enough to uninstall my only remaining VS instance. – oscilatingcretin Jan 31 '21 at 00:44
  • For the disconnection error - try turning off IPv6 on your network adapter - I've recently had trouble communicating with Azure from my router - resetting the router and turning of IPv6 fixed the communication issue - if you uninstall and then try in the install again you might then get a clean installation – Web Develop Wolf Feb 02 '21 at 15:36
  • I need to make two question, BUT; (1) do you run VS2019 as Administrator? Please, may you try do give "Everyone" privilege access in directory where contains project(s)? – Antonio Leonardo Feb 02 '21 at 17:27
  • @AntonioLeonardo Re-read OP, especially update at bottom. I uninstalled VS 2019 and can't even reinstall it. – oscilatingcretin Feb 03 '21 at 07:33
  • @oscilatingcretin, ok. And the root-cause? During update installation the machine lost internet connection or machine suspended/hibernated? Do you remember if occurred some interruption that impacts the update installation? If you have this information, it's more easy to map if the problem impacts REGEDIT, or disk only. You have Admin privileges, all right? – Antonio Leonardo Feb 03 '21 at 12:13
  • Due to the amount of time it takes to un-install and re-install, it's faster to re-image the computer. I had an issue where my upgrade to 16.8.4 was interrupted. I un-installed and tried to re-install, but my issue persisted. Since it takes so long to install, I decided it was faster to just re-image the computer than trying to troubleshoot why the re-install wasn't working. My goal was to get back to developing rather than finding the root cause of the installation issue. Make sure to choose "Download, then install". You may want to backup your NuGet packages in %UserProfile%\.nuget\packages – Tu deschizi eu inchid Feb 03 '21 at 14:07

1 Answers1

-1

You could check in your csporj file if you have:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

You would need to change MSBuildToolsPath to MSBuildBinPath, like this:

<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

When you create a project in Visual Studio 2008, $(MSBuildToolsPath) is added by default to your csproj file as the path to Microsoft.Build.Engine v3.5. Be sure to change it to $(MSBuildBinPath) which is the path to Microsoft.Build.Engine v2.0.

(more info here)

Rodrigo Rodrigues
  • 7,545
  • 1
  • 24
  • 36