473,499 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

shared assemblies and distribution

Dan
Here's a scenario I'd like to discuss in order to setup my VS.NET IDE
properly and be able to prepare a distribution:

a) I have a windows forms C# app using 3 shared assemblies I developed to
include various functions. The 3 shared assemblies are strongly named, and
some of them are also used by others of them. Let's call them A, B, and C:
now, B references A, while C references A and B.

b) there is a distinct solution for each of the assemblies (A,B,C) and
another for the client application (let's call it D). Each shared assembly
solution has a post-build event in its project so that gacutil is first
called to uninstall from the GAC any previous version and then to install
the new one.

c) to be able to debug into the referenced assemblies (A,B,C), each
project referencing the shared assemblies has a reference to the DEBUG
version of the DLL, with "copy local" set to false (as the DLL will reside
in the GAC). Thus:

-- A (strongly-named assembly) references nothing
-- B (strongly-named assembly) references A-debug
-- C (strongly-named assembly) references A-debug and B-debug
-- D (client EXE) references A-debug, B-debug, C-debug

My questions are:

1) is it possible to differentiate the post-build event for debug and
release versions? It seems this is not possible, but this carries the
disadvantage that whenever I build a release version of a shared assembly
this is also installed into the GAC, so that I can no more debug into it (it
is the RELEASE version) and the client program does not longer start, as its
references to the DEBUG version seem broken. Or is there a more correct way
of handling references so that they are not affected by such debug/release
changes?

2) given a relatively complex scenario with 3 shared assemblies A,B,C and
a client D, where B references A, C references A and B, and D references
A,B,C, whenever I want to build a release to be distributed I'll have to
manually replace all the references so that they are linked to the RELEASE
version instead of DEBUG, then recompile all, then restore all the
references to the DEBUG versions and recompile so that I can continue
developing and debugging... This does not seem very smart! I suppose this is
my fault, but then, what's the correct way of doing these things?

Thanks to all!
Nov 15 '05 #1
1 1643
Dan,

See inline:

1) is it possible to differentiate the post-build event for debug and
release versions? It seems this is not possible, but this carries the
disadvantage that whenever I build a release version of a shared assembly
this is also installed into the GAC, so that I can no more debug into it (it is the RELEASE version) and the client program does not longer start, as its references to the DEBUG version seem broken. Or is there a more correct way of handling references so that they are not affected by such debug/release
changes?
I don't believe that it is possible. The post build step doesn't have
access to the flags passed to the C# compiler (I believe, or I don't know or
they are undocumented), so you can't differentiate between setup
configurations.

2) given a relatively complex scenario with 3 shared assemblies A,B,C and a client D, where B references A, C references A and B, and D references
A,B,C, whenever I want to build a release to be distributed I'll have to
manually replace all the references so that they are linked to the RELEASE
version instead of DEBUG, then recompile all, then restore all the
references to the DEBUG versions and recompile so that I can continue
developing and debugging... This does not seem very smart! I suppose this is my fault, but then, what's the correct way of doing these things?
I think that to make this easier, you can always have two separate
solutions, one for debugging, and one for building. Then, you can set the
post build steps on each to unregister/register as you wish, as long as you
have the correct solution file open. You would just have to add all the
projects to each solution, and make sure you don't change the properties on
the solution.

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

Thanks to all!

Nov 15 '05 #2

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

Similar topics

0
2259
by: Phil | last post by:
I realize this is the php group, but I have a question that recurses back to my php install. My objective is a pure 64 bit shared object installation of php 5.0 on UltraSparc Solaris 9 compiled...
1
1504
by: Gary Varga | last post by:
I have an application which runs on both CE.NET and the full framework. To allow for a shared code base the following describes the assembly structure: 1) There is an executable binary for each...
0
1883
by: RadekP | last post by:
Hi Gurus .. I would really appreciate some insights for the problem that bugs me for quite some time. I keep my custom controls in their own shared (private/public key signed) assembly. I need...
9
4161
by: Invalidlastname | last post by:
Hi, We developed some assemblies which use EnterpriseServices queued components. In order to use EnterpriseServices, these assemblies need to be installed into GAC. I used the pre-build and...
4
1621
by: Wayne P. | last post by:
I'd like to embed some dependent assemblies in my exe as not to worry about distribution. I have come across a few examples in C# (http://weblogs.asp.net/jdennany/archive/2003/09/24/29035.aspx),...
7
3594
by: tony | last post by:
Hello! Can somebody tell me exactly when do I use GAC where shared assembly dll is stored. //Tony
3
185
by: Tony Johansson | last post by:
Hello! I just want to check with you if .NET assemblies consist of only shared assemblies ? It must be shared assemblies because you never copies these assemblies to the folder where your...
16
3368
by: MA | last post by:
Hi, We have added a shared assembly in GAC so that our multiple solutions can use use it. We use the publisher policy to controls the different versions of the assembly. This shared assembly...
4
2329
by: stuntgoat | last post by:
Hi, I want to start using Python 2.6 and 3000. I have several questions. What, in your experiences, is a functionally elegant solution to installing 2.6 and 3 from source without breaking...
0
7131
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
7007
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
7174
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
7220
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
7388
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...
0
4600
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...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
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 ...

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.