Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[NuGet] GLControl doesn't add to VS2012 Toolbox when installed via NuGet #37

Closed
david-bakin opened this Issue Jan 8, 2014 · 36 comments

Comments

Projects
None yet

This issue was originally reported here, and repro'd by the Fiddler who believes it happens with NuGet installed OpenTk but not manual installed OpenTk:

I can't get GLControl to appear in the VS2012 toolbox - I'm trying the OpenTK "Building a Windows.Forms + GLControl based application" tutorial.

I have: VS2012. A new Windows Forms project. OpenTK 1.1.1456.5398 and OpenTK.GLControl 1.1.1456.5398 installed in my solution via NuGet. They show up in the project references.

When I use the "choose items" dialog in the toolbox, and find the dll OpenTK.GLControl.dll it eventually tells me:

---------------------------
 Microsoft Visual Studio
 ---------------------------
 There are no components in 'R:\...\OpenGLTest1\packages\OpenTK.GLControl.1.1.1456.5398\lib\NET40\OpenTK.GLControl.dll' that can be placed on the toolbox.
 ---------------------------

Various online solutions to that are proposed (not specific to GLControl) - including drag/drop of the DLL right onto the toolbox (also doesn't do anything), restarted VS completely (doesn't help), compiling the project first then restarting VS (doesn't help).

The Fiddler says:

I can reproduce this in VS2013 when using the nuget package. If I uninstall the nuget package and reference OpenTK.dll and OpenTK.GLControl.dll directly from a local installation, then it appears to be working correctly.

Contributor

thefiddler commented Jan 9, 2014

@exdreamduck any ideas?

BTW - suppose I continue with the NuGet installed package and manually add the code for the control to the Foo.designer.cs file as if I was the designer. Then it shows up in the design view window as a black box and I can set properties, move it around, change its size, etc. It is only the discovery of GLControl by the toolbox window, not its use in the designer view, that is affected. (Unless it isn't supposed to be visualized as a black box.)

@thefiddler thefiddler modified the milestone: 1.1.1, 1.1.0 Feb 17, 2014

Contributor

thefiddler commented May 20, 2014

Should be fixed in the latest nuget package (1.1.1589.5941)

@thefiddler thefiddler closed this May 20, 2014

I've gotten this same error in VS2012 (11.060315.01 Update 2) using the nuget package version in the comment above.

@thefiddler thefiddler reopened this Jul 23, 2014

Is there any update on this bug? I'm not able to add the GLControl to my Toolbox with the same error as the OP.

Using 1.1.1589.5942 and Visual Studio 2013

@sureshjoshi Try to install OpenTK.GLControl from NuGet

pldeschamps commented Apr 18, 2016 edited

Hello,
I use:

  • MS VS 2015 14.0.25123.00 update 2
  • .net Framework 4.6.01038

I have created a windows Forms project and installed from nuget:

  • OpenTK.GLControl 1.1.2225 version 1.1.1589.5942

I do what is described here :http://www.opentk.com/doc/chapter/2/glcontrol (Building a Windows.Forms + GLControl based application)

I found the OpenTK.GLControl.dll but I get the message "There are no components in C:...\OpenTK.GLControl.dll that can be placed on the toolbox."

How can I do ?

pldeschamps commented May 17, 2016 edited

I tried what david-bakin commented on 9 Jan 2014 : I added manually the control in Form1.designer.cs file but that makes VS2015 crash when I open Form1 in design mode.
Here is the code:

{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.gLControl = new OpenTK.GLControl();
            this.SuspendLayout();
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(16, 19);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(35, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "label1";
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(284, 261);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.gLControl);
            this.Name = "Form1";
            this.Text = "Form1";
            this.ResumeLayout(false);
            this.PerformLayout();
        }
        private System.Windows.Forms.Label label1;
        private OpenTK.GLControl gLControl;
    }
}
Contributor

wcdeich4 commented May 17, 2016

An issue has long existed that you will probably need to download the .dll from github instead of using the nuget package. If you search hard enough, there was a comment a long time ago, but I understand there are 1000s of comments....

pldeschamps commented May 17, 2016 edited

OK Thank you very much!
I made it :-D
Though it is quit complicate to compile oneself the .dll:
First, one needs to create a new VS project and a new local repository to clone the solution found on github.
Unfortunately, the project openTK can't be built (three errors). Therefore OpenTK.GLControl can't be built :-(
Secondly, one needs to copy the opentk.dll found with nuget in the right folder
Thirdly, one can build OpenTK.GLControl.dll
Finally, add it manually in the toolbox.

Le 17 mai 2016 23:29, "William Deich" notifications@github.com a écrit :

An issue has long existed that you will probably need to download the .dll
from github instead of using the nuget package. If you search hard enough,
there was a comment a long time ago, but I understand there are 1000s of
comments....


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#37 (comment)

Contributor

wcdeich4 commented Jun 7, 2016

@varon are you using Visual Studio? Someone should test i the new glControl NuGet package adds to the Visual Studio tool box as described in the tutorial: http://www.opentk.com/doc/chapter/2/glcontrol?page=3

Owner

varon commented Jun 7, 2016

@jddde, you're on the right track. For the compile errors, check you've run NuGet restore. It should bring in the needed packages.

We're also working on simplifying the build process for the next release, which should help contributors.

@wcdeich4, yeah, but I've never used the GLControl package. Need me to test that?

@wcdeich4 @varon
Well, since my post in may, I compiled with success opentk 2.0 found on this github.
I could add opengl control to the vs2015 toolbox with no issue.
I could add an opengl control on an xamarin.forms content page and on a winforms with success.
Afterwards, I shifted to #395
as I don't know how to use point sprites with opentk.
There are so few documentation!

Contributor

wcdeich4 commented Jun 8, 2016

@varon Maybe I could find time to test it on Saturday. I can confirm that before OpenTK.Next.GLControl 1.2.2336.6514-pre, using the NuGet package did not add to the toolbox properly, but compiling the .dll myself did work.

Contributor

wcdeich4 commented Jun 12, 2016

Doesn't seem to be working. Following http://www.opentk.com/doc/chapter/2/glcontrol I Right clicked in some empty space of the Toolbox, picked "Choose Items..." and browsed for OpenTK.GLControl.dll

I got the message, "There are not components in ...OpenTK.Next.GLControl.1.2.2336.6514-pre\lib\net20\OpenTK.GLControl.dll that can be placed in the toolbox."

Contributor

wcdeich4 commented Jun 12, 2016 edited

BTW, this is the same issue as #371

Owner

varon commented Jun 13, 2016

@wcdeich4 Do we know if this affects the pre-release package?

@varon I commented in gitter that using nuget to install the .Next packages didn't allow me to add the glcontrol to the toolbox. Building the dll from the distribution works fine, so something seems to be awry in the packages.

Contributor

wcdeich4 commented Jun 18, 2016

I've never been involved w/ building NuGet packages before, but since the old NuGet package & the new one also have this problem - could there be something w/ the process of building it for NuGet & downloading it thru NuGet that prevents Visual Studio from considering it contain "components" for the toolbox?

Owner

varon commented Jun 19, 2016

@krgiddings Thanks for the info.

So the situation seems to be that OpenTK.GLControl doesn't seem work in any NuGet package.

It seems unlikely that it would be a NuGet specific bug, but perhaps VS versions or some build setting for the package? @wcdeich4 - it's probably worth experimenting further if you've got the time. I'd try these steps:

  1. Build the DLL manually and check it's working.
  2. Build a NuGet package locally and check if it's working.
  3. Check for differences between DLL/Local Nuget/OpenTK.Next NuGet.

I'm not using GLControl myself, so I'm pretty unfamiliar with that part of the system. @amulware @thefiddler - Anyone got any ideas on this?

Contributor

wcdeich4 commented Jun 19, 2016

@varon the last time I built the .dll locally, it added to the toolbox & compiled, but did not run properly. That laptop has VS 2013 Community

Guys,

Is there a solution for this anytime soon? I would like to use the NuGet package in VS 2015, and it's not working with the latest release 1.1.2349.61993 either.

Owner

varon commented Aug 11, 2016

@githubjanson Thanks for checking in.

The current solution seems to be building from source, as for some reason the NuGet build isn't working at all.

opcon commented Aug 25, 2016

I took a look into this and found that I couldn't add the GLControl to toolbox even when building from source. Recreating the OpenTK.GLControl project and copying all the source files fixed this. The new OpenTK.GLControl.csproj is changed quite a bit from the old OpenTK.GLControl.csproj, so I can't easily tell which part was causing the issue.

Owner

varon commented Aug 25, 2016

@opcon If you've got a working fix, we'd love to see a PR for it. I've got no problem if we need to re-create the project.

opcon commented Aug 25, 2016

Sounds good, I'll double check that nothing is broken, and that it'll work straight from a NuGet package, then I'll submit a PR.

Owner

varon commented Aug 25, 2016

Awesome! Thanks!

anyone have a solution for this yet? i'm still unable to add the component to the toolbox when using the NuGet package (VS2015, OpenTK v2.0.0, OpenTK.GLControl v1.1.2349.61993).

i'm bundling my source code for other people and i'd prefer not to have to make them build OpenTK from source in order to compile my code if at all possible.

Contributor

wcdeich4 commented Oct 30, 2016

@billypilgrim-uk - are you able to get the glControl to actually work when you compiled it locally? Compiling it locally, I was able get the glControl to add to the toolbox in Visual Studio 2013, but even though it compiled & the code looked good, it did not really work. I have not tried yet in VS 2015. Strangely, projects made way back in Visual Studio 2010 & upgraded to the newer version do seem to work correctly............

I actually did get it to compile and it mostly seems to be working. I
found that the pre-release packages on NuGet also seem to work so I
switched to those. It seems relatively ok to me but then I'm relatively
new to OpenGL....

On 30/10/2016 22:44, William Deich wrote:

@billypilgrim-uk https://github.com/billypilgrim-uk - are you able
to get the glControl to actually work when you compiled it locally?
Compiling it locally, I was able get the glControl to add to the
toolbox in Visual Studio 2013, but even though it compiled & the code
looked good, it did not really work. I have not tried yet in VS 2015.
Strangely, projects made way back in Visual Studio 2010 & upgraded to
the newer version do seem to work correctly............


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#37 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AWE9CsG9b4mJcoaxC0jEHEBDnn-XoQ62ks5q5R29gaJpZM4BYOEK.

Contributor

wcdeich4 commented Oct 31, 2016

Um, just to be clear, when I said, "it did not really work" I meant after I added the glControl to the Toolbox & compiled & ran the code, I got a black screen. If it's working better now, that's great.

I use vs2017, I have the same error that can`t load GLcontrol into vs toolbox.

TrueNoob commented Apr 22, 2017 edited

VS2015 dll have not components for installing.
Problem with OpenTK 2.0 and GLControl 1.1

UP: VS2015, not 2017 :)

I second that. VS2017, same problem.

TrueNoob commented May 4, 2017 edited

Now I can install, but I can't drag & drop element to form (Install OpenTK, after GLControl)
Install GLControl and OpenTK next I got exception PlatformNotSupporteda

PS Workly OpenTK v1.x & GLControl

Owner

varon commented Jun 11, 2017

I'm going to close this, not because it's fixed, but because we're consolidating into a single issue: #432

@varon varon closed this Jun 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment