There is no option to build solution and open properties of project after retarget to net standard 2.0

0

Repro

  • I created new solution with project targeted net 4.6.1 and its test project.
  • Project was copied from solution created in VS 2017
  • I have changed <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> to <TargetFramework>netstandard2.0</TargetFramework> for both unit test and library project (<OutputType>Library</OutputType>).

Now I cannot build solution. When I open project properties window I see error:

An error occurred trying to load the project properties window.  Close the window and try again. Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))
visual-studio-2017
visual-studio-2019
.net-standard-2.0
asked on Stack Overflow Feb 14, 2020 by zolty13 • edited Feb 17, 2020 by zolty13

2 Answers

2

Answer

I had to replace:

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

to:

<Project Sdk="Microsoft.NET.Sdk">

In my csproj file

Source: https://arminreiter.com/2017/05/port-net-framework-net-standard/

answered on Stack Overflow Feb 17, 2020 by zolty13 • edited Feb 17, 2020 by zolty13
0

Does this help?

Ran into the same issue myself. Appears to be an issue with the solution file. I removed the project from the solution then added it back again. This cause VS to recognize this as the correct project type. Hope this helps somebody else from spending too much time on this issue.

Visual studio 2017 not treating csproj as a valid project file after conversion from netstandard to framework

answered on Stack Overflow Feb 14, 2020 by Nik P

User contributions licensed under CC BY-SA 3.0