473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

roblems when using user control and class library

Hello!!

I use VS 2003 and C#.
I have sent several mail even tried with crossgroup because I want to find
out if my problem
is a bug in .NET or if .NET doesn't support what I do. It's only one of
these left I suppose.

I use project reference where a need to.

I have three project in my solution. One that build the exe and one that
build the user control dll and one that build the class library dll.

Note that I have only problem in design mode.
Look here. This is what I do and what should happen.
I drag the user control icon named B from the Toolbox into a form and when I
do so a row in the InitializeComponent is added see ** below. As you can see
the constructor for class B is used and here we instansiate an object of
class C which exist in the class library. This means that when we drag the
user control from the toolbox we use the class library to instansiate class
C.

private void InitializeComponent()
{
this.b1= new B();// **
}

Here we have the constructor for class B for the user control.
public B()
{
InitializeComponent();
C c = new C(); //Here we instansiate a class in the class library
c.foo();
}

If I recompile the user control which build both dll everything works fine
when I drag the user control into a form.
If I instead only rebuild the class library and then try to drag the user
control into a form I get this error
"An exception occured while trying to create an instance of
B. The execption was "?"."
This is because the class library can't be found.

So when I have this error I can solve this error by recompileng the user
control again and then it works again.

Has anybody any suggestion about my problem.
Is it a bug or .NET might not fully support what I do.

//Tony



Apr 3 '06 #1
1 1511
"Tony Johansson" <jo*****************@telia.com> wrote:
Hello!!
[some question]
[This section was removed and saved as file d:\download\programming\p.gif] ??????!!!!!!!!!!
end

Please don't add any pictures to your posts.
Binaries are not allowed in these groups.
(Not even small ones)
Check / Clean up your stationery / signature.
Martin Kramer
Apr 4 '06 #2

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

Similar topics

5
by: AAguiar | last post by:
I have an asp.net project where the code behind the aspx page calls a c# class which makes calls to a managed static C++ class. The C# class works fine when the asp net worker process starts, when...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
0
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file. called A One project that build a user control dll called B One project that build a class...
0
by: tony | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. In this user control we have a class...
1
by: Tony Johansson | last post by:
Hello!! I use VS 2003 and C#. I have sent several mail even tried with crossgroup because I want to find out if my problem is a bug in .NET or if .NET doesn't support what I do. It's only one...
0
by: tony | last post by:
Hello! This is a rather long mail but it's a very interesting one. I hope you read it. I have tried several times to get an answer to this mail but I have not get any answer saying something...
5
by: Kevin | last post by:
We currently have a 1.1 class library which houses the look and feel of our website by creating the html form dynamically in a base class. We then distribute our assembly to other application...
8
by: Mihai Velicu | last post by:
Hi ! I created a class library and in it I have a class that call "ConfigurationManager" to find out what type of database I work and the connection string.When I call this class from a form,...
1
by: Dale | last post by:
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...

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.