microsoft / automatic-graph-layout

A set of tools for graph layout and viewing
Other
1.35k stars 304 forks source link

Cannot load WinForm at design time: Method 'InvalidateBeforeTheChange' does not have an implementation. #111

Open blumu opened 7 years ago

blumu commented 7 years ago

After migrating my project to the latest version of MSAGL, I am getting the following error in Visual Studio 2017 when loading a WinForm containing a Microsoft.Msagl.GraphViewerGdi.GViewer control:

Method 'InvalidateBeforeTheChange' in type 'Microsoft.Msagl.GraphViewerGdi.GViewer' from assembly 'Microsoft.Msagl.GraphViewerGdi, Version=3.0.0.0, Culture=neutral, PublicKeyToken=fffc27ea4058b3a1' does not have an implementation.

image

The control works fine as runtime though.

studiosi commented 7 years ago

Also, when I try to add the component DLL to the toolbox, it tells me that there is no valid component inside it. Maybe related?

<package id="Microsoft.Msagl" version="1.0.2" targetFramework="net452" /> <package id="Microsoft.Msagl.Drawing" version="1.0.2" targetFramework="net452" /> <package id="Microsoft.Msagl.GraphViewerGDI" version="1.0.2" targetFramework="net452" />

keif888 commented 7 years ago

This appears to be a Visual Studio 2017 issue. I have this issue with VS2017, and NOT with VS2015. To prove, load the GraphLayout solution in VS2015, rebuild the WindowsApplicationSample, and then open the Form1. Repeat this in VS2017. Fails in VS2017, works in VS2015.

stephenhirst commented 6 years ago

This has been driving me mad for a few days. Eventually I discovered that Azure Data Lake add MSAGL to Visual Studio, with the same DDL version. When launching the designer in Visual Studio it appears to pick up the Azure Data Lake version of the DLL.

To fix the problem I changed the version in version.cs. The designer now loads in Visual Studio 2017.

tcp-wegener commented 6 years ago

I use the NuGet binaries. Is there are a way to fix this issue in the Visual Studio 2017 designer?

acodelib commented 6 years ago

any news on how to fix this in VS 2017?

Method 'InvalidateBeforeTheChange' in type 'Microsoft.Msagl.GraphViewerGdi.GViewer' from assembly 'Microsoft.Msagl.GraphViewerGdi, Version=3.0.0.0, Culture=neutral, PublicKeyToken=fffc27ea4058b3a1' does not have an implementation.

MikeHardman commented 5 years ago

This problem went away for me in VS2017 when I moved the instantiation of the GViewer into InitializeComponent rather than instantiating it at the class level. Now the control renders fine at design time.

amonroejj commented 2 years ago

I can confirm that as of Feb 2022 this is still an issue in Visual Studio 2019 (16.11.0) using Nuget Microsoft.Msagl.GraphViewerGDI 1.1.3.