473,408 Members | 2,832 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,408 software developers and data experts.

Assembly and source - design question

I have a big Visual Studio class library project from which I create an
assembly. This assembly for example might contain 100 public entry points
(for example custom server controls) and a load of shared back-end library
code that they use.

I now have a need to create 2 new separate small assemblys from the same
code base, with one public entry point in each. For example I want to bundle
2 public server controls, each into their own individual assemblys. These
assemblies will also be obscured and installed as standalone components.

So the question - what is the best way to go about achieving this:
- from the perspective of visual studio project structures
- visual sourcesafe code sharing
- assembly merging
- usage of #idef directives etc

Thanks

Donal
Nov 17 '05 #1
8 1414
Donal,

From my perspective, you should not be sharing code files between
assemblies. What you should be doing is creating an assembly with the logic
you desire, and then referencing that assembly from the new assemblies you
want to use. That being said, here are your answers:

- from the perspective of visual studio project structures

You will add another project with one class in it, and reference the
original class library.

- visual sourcesafe code sharing

Not an issue, since you will not be sharing the code, you will be
referencing the assemblies that have the functionality you need.

- assembly merging

Do you mean using multiple modules, or actually merging two assemblies
(which is not possible, AFAIK).

- usage of #ifdef directives

Don't do it. I've seen very few situations where ifdefs lead to more
clear/concise/easily-maintained code. You are only asking for trouble here.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Donal McWeeney" <ma****@newsgroup.nospam> wrote in message
news:Oy**************@TK2MSFTNGP15.phx.gbl...
I have a big Visual Studio class library project from which I create an
assembly. This assembly for example might contain 100 public entry points
(for example custom server controls) and a load of shared back-end library
code that they use.

I now have a need to create 2 new separate small assemblys from the same
code base, with one public entry point in each. For example I want to
bundle 2 public server controls, each into their own individual assemblys.
These assemblies will also be obscured and installed as standalone
components.

So the question - what is the best way to go about achieving this:
- from the perspective of visual studio project structures
- visual sourcesafe code sharing
- assembly merging
- usage of #idef directives etc

Thanks

Donal

Nov 17 '05 #2
Hi Nicholas,

Thanks for the answer - I agree in principle with what you say...

However one big issue I have is all the code in my "main" class library
assembly will be obscured, so anything I want my external assembly to see
will have to be made public - otherwise it will be renamed - and I dont
really want to do this as it defeats the process of the obscuring.

The second issue is that for 90% of installations my "main" assembly gets
installed in the GAC - I dont want to have to install an additional number
of smaller assemblies to the GAC also. Splitting the code into smaller
assemblies also has a slight performance impact.
Do you mean using multiple modules, or actually merging two assemblies
(which is not possible, AFAIK).


I thought I had read somewhere that you could merge assemblies!!! Must have
been a delusional moment...

Thanks

Donal
Nov 17 '05 #3
Hi Donal,

You can try to merge assemblies using ILMerge. Please check the following
link for more information.

http://www.microsoft.com/downloads/d...587-b4ad-4eae-
87cf-b14ae6a939b0&displaylang=en
http://www.codeproject.com/dotnet/mergingassemblies.asp

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #4
Hi Donal,

You can try to merge assemblies using ILMerge. Please check the following
link for more information.

http://www.microsoft.com/downloads/d...587-b4ad-4eae-
87cf-b14ae6a939b0&displaylang=en
http://www.codeproject.com/dotnet/mergingassemblies.asp

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #5
Hi Kevin,

Thanks for the pointers - I knew I came across them somewhere...

Thanks

Donal
Nov 17 '05 #6
Hi Kevin,

Thanks for the pointers - I knew I came across them somewhere...

Thanks

Donal
Nov 17 '05 #7
You're welcome, Donal.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #8
You're welcome, Donal.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #9

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

Similar topics

26
by: nospam | last post by:
Just wondering, What do you think the difference in performance would be between (1.) Compiled C# (2.) Compiled C++ (3.) and Assembly Language And how would the mix be if some if any of...
2
by: Boni | last post by:
Hi all, I dynamically load assembly and call invoke. But in this case I can't set a breakpoint in the source code of the assembly. So my question is: I need a way to break somehow in the...
1
by: Brian | last post by:
I've looked through the previous posts on this one and have verified permissions and location of my Dlls, but I am still getting an exception when I try to Load an assembly. The directory where...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
2
by: john | last post by:
Maybe I haven't had that "a-ha" moment yet, but I think the new approach to web projects is a step in the wrong direction. My main beef is that control over the assembly generation process has...
5
by: Doug Kent | last post by:
Sorry if this isn't really the proper group to which to post this topic, but ..NET is my development community, and I'm sure a lot of you might have something to say about this. :-) Scenario: ...
2
by: antonyliu2002 | last post by:
I am testing AJAX. I've downloaded the AJAX Extension and the CTP December package and installed on BOTH my development machine and the production server. Then I created a very very simple web...
1
by: Steve Wofford | last post by:
I am recieving the following. This happens when I moved it from my development system to our production SBS 2003 w/ latest .net frameworks and service packs . I developed under XPSP2 and VS2008. ...
10
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Hi everybody, I'm trying to use the new VB 2008 right now and I want to know how to preset the company name and copyright informtion in Assembly Information. In my current VB 2005, company name...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
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,...

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.