Failing to load .csproj files after uninstalling visual studio 2017
See original GitHub issueEnvironment data
dotnet --info
output:
.NET Command Line Tools (2.1.3)
Product Information:
Version: 2.1.3
Commit SHA-1 hash: a0ca411ca5
Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.3\
Microsoft .NET Core Shared Framework Host
Version : 2.0.4
Build : 7f262f453d8c8479b9af91d34c013b3aa05bc1ff
VS Code version:1.19 C# Extension version: current version as of 5:33 PM EST 1/7/2018
Steps to Reproduce: Unknown.
The omnisharp log contained this:
Starting OmniSharp server at 1/7/2018, 3:31:34 PM
Target: c:\Users\Tyfyter\Documents\My Games\Terraria\ModLoader\Mod Sources\elemental\elemental.sln
OmniSharp server started
Path: C:\Users\Tyfyter.vscode\extensions\ms-vscode.csharp-1.13.1.omnisharp\OmniSharp.exe
PID: 7556
Starting OmniSharp on Windows 6.1.7601.65536 (x64)
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 15.0 - "C:\Users\Tyfyter.vscode\extensions\ms-vscode.csharp-1.13.1.omnisharp\msbuild\15.0\Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to 'C:\Users\Tyfyter.vscode\extensions\ms-vscode.csharp-1.13.1.omnisharp\msbuild\15.0\Bin\MSBuild.exe'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 15.0 - "C:\Users\Tyfyter.vscode\extensions\ms-vscode.csharp-1.13.1.omnisharp\msbuild\15.0\Bin"
CscToolExe = csc.exe
CscToolPath = C:\Users\Tyfyter.vscode\extensions\ms-vscode.csharp-1.13.1.omnisharp\msbuild\15.0\Bin\Roslyn
MSBuildExtensionsPath = C:\Users\Tyfyter.vscode\extensions\ms-vscode.csharp-1.13.1.omnisharp\msbuild
MSBuildToolsPath = C:\Users\Tyfyter.vscode\extensions\ms-vscode.csharp-1.13.1.omnisharp\msbuild\15.0\Bin
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:\Users\Tyfyter\Documents\My Games\Terraria\ModLoader\Mod Sources\elemental'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.DotNet.DotNetProjectSystem
Initializing in c:\Users\Tyfyter\Documents\My Games\Terraria\ModLoader\Mod Sources\elemental
info: OmniSharp.DotNet.DotNetProjectSystem
Auto package restore: False
info: OmniSharp.DotNet.DotNetProjectSystem
Update workspace context
info: OmniSharp.DotNet.DotNetProjectSystem
Resolving projects references
info: OmniSharp.MSBuild.MSBuildProjectSystem
Detecting projects in 'c:\Users\Tyfyter\Documents\My Games\Terraria\ModLoader\Mod Sources\elemental\elemental.sln'.
info: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: c:\Users\Tyfyter\Documents\My Games\Terraria\ModLoader\Mod Sources\elemental\elemental.csproj
[fail]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
The reference assemblies for framework ".NETFramework,Version=v4.5.2" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
Failed to load project file 'c:\Users\Tyfyter\Documents\My Games\Terraria\ModLoader\Mod Sources\elemental\elemental.csproj'.
c:\Users\Tyfyter\Documents\My Games\Terraria\ModLoader\Mod Sources\elemental\elemental.csproj
Detecting CSX files in 'c:\Users\Tyfyter\Documents\My Games\Terraria\ModLoader\Mod Sources\elemental'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.Stdio.Host
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
info: OmniSharp.Stdio.Host
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:\Users\Tyfyter\Documents\My Games\Terraria\ModLoader\Mod Sources\elemental' on host 9000.
the .csproj file it was attempting (and failing) to open (elemental.csproj) contained this:
[elemental.csproj.txt](https://github.com/OmniSharp/omnisharp-vscode/files/1610269/elemental.csproj.txt)
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Visual studio doesn't support specific csproj file - Stack Overflow
The error doesn't say that Visual Studio doesn't support .csproj files at all, it says it doesn't support a specific project type in...
Read more >15.4 VS Cannot open csproj file - Visual Studio Feedback
An error message "Object not set to an instance of object" appeared as a pop-up and in the the output window. 8) Ran...
Read more >Troubleshooting NuGet Package Restore in Visual Studio
If the package references in your project file (.csproj) or your packages.config file are incorrect (they do not match your desired state ...
Read more >One or More Projects in the solution were not loaded correctly
If you want to fix this types of error then must to update your tools, I face this problem when I was not...
Read more >OmniSharp fails to load the Assembly-CSharp.csproj from a ...
Therefore your assembly may not be correctly targeted for the framework you intend. ... Failed to load project file 'd:\Documents\GameDevelopment\ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I may have found the problem (which seems to be that my csproj file is set up for .net 4.5.2 but I have .net 4.7.1 installed), however, everything I’ve tried so far to fix it has failed: <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{8298EAB6-0586-4BDA-9483-83624B66B13A}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>Light</RootNamespace> <AssemblyName>Light</AssemblyName> <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> </PropertyGroup>
@rchande I recently reinstalled it for an unrelated reason, however, visual studio code is still not loading the .csproj file properly. I may have installed a severely outdated version, as the only versions in the sdk folder are 2.1.3, and NuGetFallbackFolder, but for some reason when I tried to install .net 4.5.2 it said I already have it or a later version installed, and when checking my registry to verify this I saw that I seem to have .net version 4.7.02558 installed, how would I update the files to work with this?