By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,408 Members | 1,796 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,408 IT Pros & Developers. It's quick & easy.

Setting up Third Party .NET dll in visual studio with C#

P: n/a
I am developing a large application with Visual Studio .NET 2003 using C#. We
recently added a new third party product with a native .NET library. I want
to place this third party product's dll in a VS Project of its own, and then
reference that project from those c# projects in my solution that are
dependent on the third party product.

I created a c# class library project, ThirdPartyDll. Placed the dll file in
question into that project's directory and added it to my project. I removed
all other files in the project, and all references. The dll has the build
action of "content".

So far, so good (well, maybe not)

I go to the project that needs to reference this third party library and add
a project reference to my third party class library project ThirdPartyDll.
But, now I try to find the right "using" statement in my c# for ThirdPartyDll
and can not find a string that Visual Studio will properly resolve?

What am I doing wrong?

What is the "right" way to create a Visual Studio project to wrap an
existing dll such that I can include that project in any projects that must
reference its functionality?
Aug 1 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I am not sure why you want to do it that way, just simply reference this
dll in your project.

m11533 wrote:
I am developing a large application with Visual Studio .NET 2003 using C#. We
recently added a new third party product with a native .NET library. I want
to place this third party product's dll in a VS Project of its own, and then
reference that project from those c# projects in my solution that are
dependent on the third party product.

I created a c# class library project, ThirdPartyDll. Placed the dll file in
question into that project's directory and added it to my project. I removed
all other files in the project, and all references. The dll has the build
action of "content".

So far, so good (well, maybe not)

I go to the project that needs to reference this third party library and add
a project reference to my third party class library project ThirdPartyDll.
But, now I try to find the right "using" statement in my c# for ThirdPartyDll
and can not find a string that Visual Studio will properly resolve?

What am I doing wrong?

What is the "right" way to create a Visual Studio project to wrap an
existing dll such that I can include that project in any projects that must
reference its functionality?
Aug 2 '06 #2

P: n/a
What you are trying to do is senseless. Just add a reference
to those "real" projects that need to use it. You aren't going
to get away from adding a reference in those projects that need it.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Microsoft .NET Search Engine Scoring Analysis
How does your site rate?
http://www.topichound.com


"m11533" <m1****@discussions.microsoft.comwrote in message
news:6A**********************************@microsof t.com...
>I am developing a large application with Visual Studio .NET 2003 using C#.
We
recently added a new third party product with a native .NET library. I
want
to place this third party product's dll in a VS Project of its own, and
then
reference that project from those c# projects in my solution that are
dependent on the third party product.

I created a c# class library project, ThirdPartyDll. Placed the dll file
in
question into that project's directory and added it to my project. I
removed
all other files in the project, and all references. The dll has the build
action of "content".

So far, so good (well, maybe not)

I go to the project that needs to reference this third party library and
add
a project reference to my third party class library project ThirdPartyDll.
But, now I try to find the right "using" statement in my c# for
ThirdPartyDll
and can not find a string that Visual Studio will properly resolve?

What am I doing wrong?

What is the "right" way to create a Visual Studio project to wrap an
existing dll such that I can include that project in any projects that
must
reference its functionality?

Aug 2 '06 #3

P: n/a
I want to include the dll in the solution as it is under source control just
like the rest of the solution. The intended behavior is that when the
solution is "Opened from Source Control", the dll will be fetched/checked-out
along with all of the source files in the "normal" projects.

The technique I've described has been used with other third party products,
but this is the first that I've been responsible for adding, and of course
mine does not work while the others do.

If I just add a direct reference to the file, with the file placed in some
arbitrary location in the source code tree, wouldn't it be omitted from an
"Open From Source Control"?

"Jianwei Sun" wrote:
I am not sure why you want to do it that way, just simply reference this
dll in your project.

m11533 wrote:
I am developing a large application with Visual Studio .NET 2003 using C#. We
recently added a new third party product with a native .NET library. I want
to place this third party product's dll in a VS Project of its own, and then
reference that project from those c# projects in my solution that are
dependent on the third party product.

I created a c# class library project, ThirdPartyDll. Placed the dll file in
question into that project's directory and added it to my project. I removed
all other files in the project, and all references. The dll has the build
action of "content".

So far, so good (well, maybe not)

I go to the project that needs to reference this third party library and add
a project reference to my third party class library project ThirdPartyDll.
But, now I try to find the right "using" statement in my c# for ThirdPartyDll
and can not find a string that Visual Studio will properly resolve?

What am I doing wrong?

What is the "right" way to create a Visual Studio project to wrap an
existing dll such that I can include that project in any projects that must
reference its functionality?
Aug 2 '06 #4

P: n/a
I just figured out what I have wrong and it turns out to be pretty simple.
The problem is that I named the project that contains the dll in question in
such a way that it colides with the namespace defined in the dll. If I rename
my dll project to avoid this collision, everything works properly, just as it
already does for other dlls handled in this way.
"Robbe Morris [C# MVP]" wrote:
What you are trying to do is senseless. Just add a reference
to those "real" projects that need to use it. You aren't going
to get away from adding a reference in those projects that need it.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Microsoft .NET Search Engine Scoring Analysis
How does your site rate?
http://www.topichound.com


"m11533" <m1****@discussions.microsoft.comwrote in message
news:6A**********************************@microsof t.com...
I am developing a large application with Visual Studio .NET 2003 using C#.
We
recently added a new third party product with a native .NET library. I
want
to place this third party product's dll in a VS Project of its own, and
then
reference that project from those c# projects in my solution that are
dependent on the third party product.

I created a c# class library project, ThirdPartyDll. Placed the dll file
in
question into that project's directory and added it to my project. I
removed
all other files in the project, and all references. The dll has the build
action of "content".

So far, so good (well, maybe not)

I go to the project that needs to reference this third party library and
add
a project reference to my third party class library project ThirdPartyDll.
But, now I try to find the right "using" statement in my c# for
ThirdPartyDll
and can not find a string that Visual Studio will properly resolve?

What am I doing wrong?

What is the "right" way to create a Visual Studio project to wrap an
existing dll such that I can include that project in any projects that
must
reference its functionality?


Aug 2 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.