473,766 Members | 2,035 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem loading values from class library

I have a user control on a Windows Form that, in its Load event handler,
calls a method from a class library to initialize an array of objects that
are then used to populate a ComboBox.

When I run the app, the method runs just fine. The class library returns
the array of objects and the ComboBox is loaded.

The problem I am having is when I try to open the form that contains the
user control in the designer. Instead of the form, I get the ugly pink and
white designer error page that you've probably seen before. The error it
shows says:

Method not found: 'MyLib.MyObj[] MyLib.ClassInMy Lib.GetList()'.

I have tried making the whole thing static - there's no reason at all to
instantiate the class to get this list - but that didn't work. Next, I tried
non-static where I had to create an instance of the class in my user control.
I get the same error. I have tried calling the method directly from the
assignment to the ComboBox and I have tried filling a local array from the
method and assigning that to the ComboBox.

No matter what I have tried, the error from the designer is exactly the same
- not a single character in the message is different. It reads right through
all my attempts at obfuscation and rejects the underlying method.

Oh, and I tried returning the array as a property named ObjectList. That
changed the error message only in that it now said:

Method not found: 'MyLib.MyObj[] MyLib.ClassInMy Lib.get_ObjectL ist'.

The designer sees right past the property and rejects the underlying getter.

Like I said, I can compile this program and run it and it all works as
expected. I just can't work with it in the designer any more.

Any help at all would be greatly appreciated.

Dale

--
Dale Preston
MCAD C#
MCSE, MCDBA
Nov 18 '06 #1
1 1640
Well, I got it working. I moved the static class to my Windows Forms project
and changed all the references to the new location and still the designer
complained about the method not being available in the class library! And I
wasn't even referencing the class library anymore!

I just wasted 4 hours chasing a problem because the designer wasn't keeping
up with any of the code changes I was making even with compiling and
re-compiling both the class library and the Windows Forms project.

I finally put it all back like it was supposed to be, including the class
library, and then closed Visual Studio and re-opened the project and now it
works. GRRRRRRRRRRRRRR R.

Dale
--
Dale Preston
MCAD C#
MCSE, MCDBA
"Dale" wrote:
I have a user control on a Windows Form that, in its Load event handler,
calls a method from a class library to initialize an array of objects that
are then used to populate a ComboBox.

When I run the app, the method runs just fine. The class library returns
the array of objects and the ComboBox is loaded.

The problem I am having is when I try to open the form that contains the
user control in the designer. Instead of the form, I get the ugly pink and
white designer error page that you've probably seen before. The error it
shows says:

Method not found: 'MyLib.MyObj[] MyLib.ClassInMy Lib.GetList()'.

I have tried making the whole thing static - there's no reason at all to
instantiate the class to get this list - but that didn't work. Next, I tried
non-static where I had to create an instance of the class in my user control.
I get the same error. I have tried calling the method directly from the
assignment to the ComboBox and I have tried filling a local array from the
method and assigning that to the ComboBox.

No matter what I have tried, the error from the designer is exactly the same
- not a single character in the message is different. It reads right through
all my attempts at obfuscation and rejects the underlying method.

Oh, and I tried returning the array as a property named ObjectList. That
changed the error message only in that it now said:

Method not found: 'MyLib.MyObj[] MyLib.ClassInMy Lib.get_ObjectL ist'.

The designer sees right past the property and rejects the underlying getter.

Like I said, I can compile this program and run it and it all works as
expected. I just can't work with it in the designer any more.

Any help at all would be greatly appreciated.

Dale

--
Dale Preston
MCAD C#
MCSE, MCDBA
Nov 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4822
by: Outshined | last post by:
I have a class library where just about every class uses its static initializer to register with a central registry object in the same assembly. I am hoping for some sort of Assembly.Load event that I can handle to go through my assembly and invoke the static initializer on each relevant class. This way, everything that needs to be registered will be registered before the first request to the registry object. So my questions are:
17
2482
by: Dave | last post by:
Hi I'm making a 3D Engine which consists of the class C3DEngine. Part of this engine is a file loader, a class called CMeshLoader. I have made an instance of CMeshLoader in C3DEngine, ie composition. Unfortunately, CMeshLoader sometimes needs to refer to private members of C3DEngine. Inheritance, friends, and composition are all swirling around in my head at the moment. I know that inheritance is not the solution. Can someone please...
3
2498
by: KeithO | last post by:
I am having problems calling dynamic_cast<> on a pointer returned by a dynamically loaded library. The problem seems to be related to the fact that I dynamically load the library because if I link the app with the library it works fine. I am using gcc3.04 compiler on Linux AS2.1 The code works fine with MS VC6.0 and also with SunPro5.3 compilers. The library contains a base class and a derived class and also an extern "C" function that...
9
4493
by: Ender | last post by:
I have an application that I would like third party developers to be able to create Plug-ins that will be dynamically loaded into our application to extend functionality. I have utilized the "Let Users Add Functionality to Your .NET Applications with Macros and Plug-Ins" article at MSDN for the dynamic loading of DLLs http://msdn.microsoft.com/msdnmag/issues/03/10/Plug-Ins/default.aspx
3
1625
by: markeboy | last post by:
I am wanting to control when a page is loaded using a separate class to manage when and how it should be loade My current implementation needs to set a property of the page programatically (through a defined interface on the page) I can create an instance of the code behind class (and interface) that the page inherits and implements, however, I have no way of then calling it to load Of course, this was quite possible in VB6, by...
7
5788
by: George Copeland | last post by:
This is a request for assistance analyzing a problem we are experiencing in our VB6 development environment. All our code is developed in VB6, and our persistance layer is SQL Server. We are planning to convert this project to dot net sometime in the future. Our architecture is an exe project with references to four business object dlls. Also, each one of our tables is encapsulated in a data object dll. The data objects are referenced...
3
4605
by: f1racing24 | last post by:
I am trying to compile this class in the command-line and this error comes up 'Start -> C:\Inetpub\wwwroot\DCReview_Brinkster\code>vbc /t:library /verbose /r:System.dll,System.Data.dll,DBUtilities.dll CountryLib.vb Microsoft (R) Visual Basic .NET Compiler version 7.00.9466 for Microsoft (R) .NET Framework version 1.00.3705 Copyright (C) Microsoft Corporation 1987-2001. All rights reserved.
0
2400
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile View I want the form populated from there profile on the sql server. The code to save the profile works fine. But when the user logs back in they data doesn't load back to the form. The multiview is located inside the LoginView's Logged-In View ....
7
10292
xNephilimx
by: xNephilimx | last post by:
lHi guys! I'm having a little problem that's getting on my nerves, I couldn't find a solution, I also tryed googling it and I found nothing... (my field of expertise is in AS 2 and 3, but I still lack some JavaScript solid knowdlege) The problem is that when I try to send a form's content with Ajax (I'm using the prototype library), for some reason the latin characters (accents and stuff, like áéíóú) turn a mess when I try to store them in...
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10008
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.