0

Scenario:

Let's say I have four very similar applications (i.e. most of the functionality is the same, but they are different enough to justify each being seperate applications).

What is the best way to re-use the common functionality code between them? COM+? Web services?

In general I'd typically just have the code in a seperate project (dll), but anytime that's updated, the file has to be updated for each ASP.Net application, and wasn't sure if there was a better way of going about it.

Thanks!

3 Answers 3

4

If possible, you can create a Visual Studio solution with a DLL Project and a number of Web Application or Website projects. The web projects would have a "project" type reference to the DLL project, and everything would build at the same time. Then you could use the "Publish" tool for each of your web projects as needed.

Sign up to request clarification or add additional context in comments.

Comments

2

If all the apps are on the same virtual server, consider placing the shared assembly in the GAC. This allows you to diverge versions should the need arise, and keeps everything in the same place as a bonus. Downsides: this assembly runs with full trust and you should use policy and CAS to ensure there are no elevation of trust leverage points for external untrusted assemblies. You'll also need to learn about the [AllowPartiallyTrustedCallers] attribute.

As for the other choices, COM+, meh, a bit heavyweight. Good for transactional stuff. Web services, not so good for data heavy services, but if done right, can be fairly maintainable. The more it's shared, the better the pay off.

Comments

1

You can have your project, but instead of adding the common dll to the project reference add the common project to all solutions and then add a reference to the common project.

This way you can have one project on any number of solutions and you have your problem solved ;)

1 Comment

Yeah, but each project referencing the DLL may still need to be recompiled unless each app using the DLL has thier own copy of the DLL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.