Error loading Windows form designer

Nikolaj Olsson 96 Reputation points
2020-09-01T08:54:27.767+00:00

After upgrading to Visual Studio 16.7.2 from 16.6.<something> I have trouble loading the designer for forms which use a lib with multi target platform like "<TargetFrameworks>net40;netstandard2.1</TargetFrameworks>":

21778-image.png

Any solutions/ideas?

(it works if "netstandard2.1" is removed as target framework, but that's not the ideal solution...)

Developer technologies Windows Forms
0 comments No comments
{count} votes

Accepted answer
  1. Nikolaj Olsson 96 Reputation points
    2020-09-09T06:22:59.11+00:00

    Hi Daniel,

    Thanks for the good answer :)

    The lib need "netstandard2.1"... and even after many expriemnts I was unable to make it work unless I removed "netstandard2.1" as target framework.
    ( my winforms project is here: https://github.com/SubtitleEdit/subtitleedit )

    Visual Studio 16.7.3 update solves the problem :)


1 additional answer

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,651 Reputation points
    2020-09-02T03:10:12.587+00:00

    Hi Nikolaj Olsson,
    >>it works if "netstandard2.1" is removed as target framework, but that's not the ideal solution.
    What type of your project?
    According to your description, your project does not support .netnetstandard2.1.
    From this blog, you can see that
    "Given many of the API additions in .NET Standard 2.1 require runtime changes in order to be meaningful, .NET Framework 4.8 will remain on .NET Standard 2.0 rather than implement .NET Standard 2.1. .NET Core 3.0 as well as upcoming versions of Xamarin, Mono, and Unity will be updated to implement .NET Standard 2.1."
    Library authors who need to support .NET Framework customers should stay on .NET Standard 2.0. In fact, most libraries should be able to stay on .NET Standard 2.0, as the API additions are largely for advanced scenarios."
    So I suggest you use netstandard2.0 instead of netstandard2.1.

      <TargetFrameworks>netstandard2.0;net40</TargetFrameworks>  
    

    And when you specify multiple target frameworks, you may conditionally reference assemblies for each target framework.
    More details you can see this document.
    About another problem, what is your "subtitleListView1"?
    Did you declare or assign it in the your project?
    Best Regards,
    Daniel Zhang

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.