Visual Studio unable to read the project file (anymore) - visual-studio-2010

Ever since my latest windows update, (which system restore is failing to undo) I can't load any projects with visual studio 2010. The project are greyed out (unavailable) and when I try to reload them I get the error:
C:\Users\Benoit\Documents\Visual Studio 2010\Projects\Test123\Test123\Test123.csproj : error : Unable to read the project file 'Test123.csproj'. Could not load file or assembly 'Microsoft.Build, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I tried creating new projects: same error
I tried creating different type of projects (command prompt, silverlight, windows phone): same error
Deleting the .suo and .user files did not change anything
I did not move the projects
Using Visual Studio 2010 with Windows Vista

It looks like the Global Assembly Cache (GAC) is messed up, or possibly the update has done something with the Microsoft.Build assembly file itself.
Try repairing .NET 4.0, and if that does not work you can try completely uninstalling and reinstalling the framework.

Related

Visual Studio Installer - Unable to acquire updated Visual Studio Installer

I have a problem with installing Visual Studio 2022 from https://visualstudio.microsoft.com/fr/downloads/
I got this error when I try to run VisualStudioSetup.exe .This is my first attempt
Unable to acquire updated Visual Studio Installer. This problem occurs when the installer on your machine is the same or lower than the version to update. If this is your first attempt, we recommend that you Continue to install the Visual Studio update.
[Continue] [Cancel]
When I click continue and this error appear
Unable to launch the installer. Error: Could not load file or assembly 'System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
I 've try to unistall and ran setup.exe again but it didn't work..

Could not load file or assembly 'System.Web.RegularExpressions, Version=4.0.0.0

Last night I upgraded my Visual Studio 2017 to the latest version 15.7.0. Since then all my projects are not running any more.
The error I am getting:
Could not load file or assembly 'System.Web.RegularExpressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I tried adding manually a referece to the DLL, I am still getting the error
I fixed the issue by 1) updating Visual Studio from 15.7.0 to 15.7.1 2) repairing the installation

Could not load file or assembly 'Microsoft.CodeAnalysis" in visual studio 2015

I am creating an android app in visual studio 2015. While building the solution I am getting this error :
The specified task executable "csc.exe" could not be run. Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I have update my visual studio as well. but nothing is working for me.
Here is snapshot of error:
try to run visual studio as administrator or repair your visual studio from programs
see this post:
Visual Studio 2012 csc.exe Error. Executable not valid for OS

Visual Studio 2013 - errors when editing build definition

I get several errors when trying to edit my build definition. This has worked fine before, but I suspect that installing Visual Studio 2015 has messed things up.
History:
First I had Visual Studio 2013 Ultimate. At this time there were no problems
Recently I installed Visual Studio 2015 Professional.
For licensing reasons, I had to remove VS 2013 Ultimate and install VS 2013 Professional instead.
In VS 2013 Professional-> Team Explorer->Builds I now get an error when I edit my build definition. I suspect that the installation/reinstallation is the cause.
Under Process->Items to build I click the add button and get this error message:
[A]Microsoft.TeamFoundation.Build.Workflow.Activities.BuildSettings cannot be cast to [B]Microsoft.TeamFoundation.Build.Workflow.Activities.BuildSettings. Type A originates from 'Microsoft.TeamFoundation.Build.Workflow, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default' at location 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.TeamFoundation.Build.Workflow\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.TeamFoundation.Build.Workflow.dll'. Type B originates from 'Microsoft.TeamFoundation.Build.Workflow, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default' at location 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Build.Workflow.dll'.
You can also try to:
Clean the Cache folder on client computer. The folder path is: C:\Users\username\AppData\Local\Microsoft\Team Foundation\x.0\Cache. (x is the TFS version)
Clean the Cache folder on Server machine. The folder path is: C:\ProgramData\Microsoft\Team Foundation\Web Access\Cache_v10.0
Try resetting settings and add-in settings (devenv /ResetSettings) and (devenv /ResetSkipPkgs), try rebuilding all templates (devenv /setup).

Get Roslyn samples to work

I am using Visual Studio 2013 SP1.
After installing Roslyn I wanted to play with the samples. In the samples folder there is a project called MakeConstCS. So I hit F5, the experimental VS env is loaded. Then I create a new project and boom.
Normal Build Error incomplete Could not load file or assembly 'Microsoft.VisualStudio.LanguageServices.CSharp, Version=0.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I get the same error when I try File->New->Project->Templates->C#->Roslyn->CodeRefactoring->F5
Any idea why this happens?
You need to install Roslyn into your VS experimental hive. This is listed in the Readme, and the SDK includes an exe to do so.
Correct way to reinstall Roslyn:
Uninstall all the Roslyn extensions
Delete %LocalAppData%\Microsoft\VisualStudio\12.0Roslyn
Using regedit delete HKCU\Software\Microsoft\visualStudio\12.0Roslyn and 12.0Roslyn_Config
Run Install Roslyn Preview into Roslyn Experimental Hive.exe
Run Roslyn End User Preview.vsix
Run Roslyn SDK Project Templates.vsix
Run Roslyn Syntax Visualizer.vsix
For debugging with VisualStudio2013
Check the project file entry and use the correct version of your VS instance:
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == '">12.0</VisualStudioVersion>

Resources