473,671 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1426
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.co m

"Donal McWeeney" <ma****@newsgro up.nospam> wrote in message
news:Oy******** ******@TK2MSFTN GP15.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&di splaylang=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&di splaylang=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
10542
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 these languages had to hit against a SQL Server database
2
1781
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 dynamically loaded (.Load(byte)) assembly. Can I set programmatic brekapoint, if yes how ? Thanks Boni
1
2920
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 my Dlls are located give the ASPNET user full control, and all Dlls used by the Assembly in question are in the local folder with the rest of the web application Dlls. Could someone take a look at my error and shed some light on this?
10
3438
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 somewhere that each folder under the "web site" is compiled in separate assembly. I however, did not find that the "web site" creation in vs.net 2005 created any AssemblyInfo.cs file.
2
1874
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 been taken away from us! I also don't agree with the logic behind a web site not having a project file, but I'll save that for another thread! Here's our scenario: We have a web project that runs in a non-managed sharepoint directory. The web...
5
1205
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: I have two shared assemblies, each references the other. This tends to cause build difficulties since DLL 1 needs DLL 2 to build, and DLL 2 needs DLL 1 to build. I suspect this scenario might reflect a fundamental flaw in the design of the...
2
151645
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 application, which contains a button and a label. When the button is clicked, some message is shown on the label. That's it. The AJAX works great on my development machine, but on the production server, I got the typical error as follows:
1
8325
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. The error is pointing to the Web.Config of my application. System.Data.Entity was missing from the server, but was on the dev system. I tried to add, but didnt help: C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5
10
9667
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 and copyright information (the word "CopyRight" with company name and year) is filled in automatically once a new project is created. However, I have no idea where I can configurate it in my new VB 2008. Thanks for your kindly advice!
0
8392
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
8912
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
8669
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
7428
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...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5692
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4403
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2809
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
2
2049
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.