xr280xr

Hi, I've got an application designed (by someone else) to be able to totally diconnect the front end from the business logic and database layers. The idea being that I can do a win forms front end for one department, a asp.net front end for another department and use the same data classes and database IO classes on the back. So currently it only has a win forms application running off of it. That application is published to a production server and deployed with click once. Now I want to build a web app that utilizes the data classes and SQL IO functionality. Do I register the assemblies in the GAC and then reference them from the web app If so...

What does registering an assembly with gacutil do Does it copy the assembly, or does it reference the assembly you give it So if I do an updated publish of the assemblies do I need to re-register the assemblies ..Confused what the designer's vision was.



Re: Visual C# General How to re-use my assemblies

Peter Ritchie

You don't need to register them in the GAC, you can simply reference them in your web application and it will copy them to appropriate place when you deploy.

Deploying to the GAC would give you the benefit of being able to share the same assembly between multiple applications. If you only ever have one application on a computer that uses the assembly the GAC doesn't buy you anything other than caching the security check as all assemblies in the GAC a fully trusted. If your assembly needs to be attributed with security permissions and not fully trusted, you don't want to deploy to the GAC.






Re: Visual C# General How to re-use my assemblies

xr280xr

Hi, thanks for your help. My concern is that lets say I add 3 web app and 2 windows app front ends that only reference the assemblies. Then if I change the assemblies (which occurs pretty regularly) I would have to go re-publish all 5 front end applications in order to re-copy those references right I would rather update the assemblies in one place and have the other applications' versions independent of them. Sounds like I need all of the apps on 1 machine and the assemblies in the GAC.




Re: Visual C# General How to re-use my assemblies

Peter Ritchie

xr280xr wrote:

Hi, thanks for your help. My concern is that lets say I add 3 web app and 2 windows app front ends that only reference the assemblies. Then if I change the assemblies (which occurs pretty regularly) I would have to go re-publish all 5 front end applications in order to re-copy those references right I would rather update the assemblies in one place and have the other applications' versions independent of them. Sounds like I need all of the apps on 1 machine and the assemblies in the GAC.
Having an assembly in the GAC doesn't avoid having to update dependant applications when you "change" an assembly. An application is equally as volatile as all it's dependencies. If you want an application to not be volatile you'll have to sever that direct dependency on those volatile dependencies. You can do this with Dependency Injection, Dependency Inversion, or Interface-Oriented Design.




Re: Visual C# General How to re-use my assemblies

xr280xr

If the application is referencing an external assembly rather than its own copy, and then, let's say, a new method is added to the assembly, what needs to be updated in the application(s) that reference it Do they maintain some sort of signature of the assemblies they reference