473,387 Members | 1,597 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,387 software developers and data experts.

Strange error for referencing dll

AA
Hi all,
I have created a .Net control for myself, and put it inside the folder
"framework\v1.1.4322".
Then, I create a new project, reference the dll and draw the control on the
window form.
I am fail running the project and the error is encountered at the line
"InitializeComponent" in the form, claiming that some dependency is missing.

However, once putting the dll outside the folder "framework\v1.1.4322",
everythings go normal.

Do anyone have idea for that?

Thanks in advance!
Richard
Nov 21 '05 #1
6 1178
Don't even try to put it in that folder.

..net assemblies are referenced from two places. #1 the folder in which the
application is stored and #2 the Global Assembly Cache or GAC.

If you're DLL is specialized for your application and unlikely to be useful
to other applications and deploy it into the folder where the executable is
to be stored. If your DLL is likely to be shared by several applications or
requires some strict version management then put it into the GAC. The
assemblies placed into the global assembly cache must be strongly named.

Your control probably falls into the latter category.

--
Bob Powell [MVP]
Visual C#, System.Drawing

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml


"AA" <aa@hotmail.com> wrote in message
news:uC**************@TK2MSFTNGP10.phx.gbl...
Hi all,
I have created a .Net control for myself, and put it inside the folder
"framework\v1.1.4322".
Then, I create a new project, reference the dll and draw the control on the window form.
I am fail running the project and the error is encountered at the line
"InitializeComponent" in the form, claiming that some dependency is missing.
However, once putting the dll outside the folder "framework\v1.1.4322",
everythings go normal.

Do anyone have idea for that?

Thanks in advance!
Richard

Nov 21 '05 #2
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:eA****************@TK2MSFTNGP10.phx.gbl...
Don't even try to put it in that folder.


Why not? The IDE looks for assemblies there, and it can make things a lot
simpler if one does not use strong naming.

Best Regards,

Andy
Nov 21 '05 #3
You can add a new key under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio \7.1\AssemblyFolders to
point to your own folder for things to appear in the Add references dialog.
- Brent

"Andy Becker" <x@x.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:eA****************@TK2MSFTNGP10.phx.gbl...
Don't even try to put it in that folder.


Why not? The IDE looks for assemblies there, and it can make things a lot
simpler if one does not use strong naming.

Best Regards,

Andy

Nov 21 '05 #4
AA
If I do want to put it into GAC, how strong should it be named?

Do you have any reference for me?

Thank you very much!
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:eA****************@TK2MSFTNGP10.phx.gbl...
Don't even try to put it in that folder.

.net assemblies are referenced from two places. #1 the folder in which the
application is stored and #2 the Global Assembly Cache or GAC.

If you're DLL is specialized for your application and unlikely to be useful to other applications and deploy it into the folder where the executable is to be stored. If your DLL is likely to be shared by several applications or requires some strict version management then put it into the GAC. The
assemblies placed into the global assembly cache must be strongly named.

Your control probably falls into the latter category.

--
Bob Powell [MVP]
Visual C#, System.Drawing

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml


"AA" <aa@hotmail.com> wrote in message
news:uC**************@TK2MSFTNGP10.phx.gbl...
Hi all,
I have created a .Net control for myself, and put it inside the folder
"framework\v1.1.4322".
Then, I create a new project, reference the dll and draw the control on

the
window form.
I am fail running the project and the error is encountered at the line
"InitializeComponent" in the form, claiming that some dependency is

missing.

However, once putting the dll outside the folder "framework\v1.1.4322",
everythings go normal.

Do anyone have idea for that?

Thanks in advance!
Richard


Nov 21 '05 #5
"Brent Clark" <Br*********@sungard.com> wrote in message
news:OS**************@tk2msftngp13.phx.gbl...
You can add a new key under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio \7.1\AssemblyFolders to
point to your own folder for things to appear in the Add references dialog.

- Brent


Nice tip! Thanks.

Best Regards,

Andy
Nov 21 '05 #6
The assemblies in that folder are also duplicated in the GAC. To my
knowledge, none of the .NET assemblies are copied local and all run from the
GAC copy. The references made to assemblies in that or any other folder will
do one of two things. #1 If the assembly is strongly named a copy will be
assumed to be distributed to the GAC of any target machine and the assembly
will not be copied local to the application. #2 If the asssembly isn't
strongly named a local copy of the referenced assembly will be created and
that will be assumed to be distributed along with the application.

There are articles in MSDN pertaining to strong-naming of assemblies.
http://msdn.microsoft.com/library/de...Assemblies.asp

--
Bob Powell [MVP]
Visual C#, System.Drawing

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml


"Andy Becker" <x@x.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:eA****************@TK2MSFTNGP10.phx.gbl...
Don't even try to put it in that folder.


Why not? The IDE looks for assemblies there, and it can make things a lot
simpler if one does not use strong naming.

Best Regards,

Andy

Nov 21 '05 #7

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

Similar topics

1
by: student | last post by:
while compiling on: SunOS 5.8 Generic_108528-27 sun4u sparc SUNW,Sun-Fire-280R I get the following error: Undefined first referenced symbol ...
10
by: Tony Archer | last post by:
Gentlemen, your urgent help is needed in solving a STRANGE problem. I have two servers a dev box, and a production box. On the dev box everything works fine, in production it hoses: One of...
4
by: Ola Tuvesson | last post by:
I'm having a really weird problem. When running the SP below in query analyzer the calculated column "Subscribed" is returned as expected: ------------- CREATE PROCEDURE get_mailinglists( ...
5
by: aualias | last post by:
I am getting the following error: Warning: The dependency 'ShoppingCart, Version=1.0.1895.27037, Culture=neutral' in project 'www.sitename.com' cannot be copied to the run directory because it...
10
by: Florian G. Pflug | last post by:
Hi I installed a postgres-application (which was developed on debian woody) on red hat 9 today, using the postgres 7.3 rpms from redhad. One of my the triggers uses the pg_settings table (more...
4
by: Daniel Reber | last post by:
I have an exe that serializes one of it's classes to disk. I also have the exact same .cs file that contains the class that was serialized, in a Windows service application. I am trying to load...
2
by: pei_world | last post by:
can anyone help me with these problem, code written correctly except those with * mark. //========================================================================== ===============================...
4
by: Ned Balzer | last post by:
Can anyone explain why in the following code, where btnCancel1 is a Button inside the itemTemplate of the formview, the first call to change the text of the button, in the Page_Load sub, works...
2
by: sqlgirl | last post by:
Hi, We have 2 servers. Server1 is a 2000 box, with SP3 (yes I know it is not up to date). Server2 is a 2005 box, SP2. I set up Server1 (2000) to have a linked server to Server2 (2005). The...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.