开发者

Can you have a web application project produce multiple DLLS?

I have a VS 2008 web application project that is getting 开发者_Go百科large. My structure looks like:

- WebRoot
  - Common/
  - Foo/
  - Bar/
  - Baz/

so I end up with a single Webroot.dll that contains the code for common, foo, bar, and baz. Is it possible to set it so that I end up with common/ in webroot.dll, and code in foo ends up in foo.dll, bar in bar.dll, etc?

Update:

A couple of suggestions to move some stuff into class libraries. We already have a dozen or so separate class library projects as part of the solution; Foo, Bar and Baz contain nothing but web forms and the associated code-behinds, so moving them into separate class library projects is not feasible.


You could "move out" some code into class libraries. That will easily get you separate DLLs.

Technically there is a possibility to output "multifile assemblies", but I'm not sure if Visual Studio has any built-in options for doing that out-of-the-box. You could probably specify extra parameters for the csc.exe somewhere in the settings and see if it works for you.


Yes, but you have to create multiple web application projects in Visual Studio. (That is, you can't configure a single Visual Studio project to emit multiple dlls.)

You can do it by breaking your application up and hosting the sub-applications within a single virtual directory.

Omar Khan has written a nice series of articles about this:

  • Part 1 (Creating sub-projects in IIS with Web Application Projects)
  • Part 2 (Creating shared user controls and master pages with sub-projects)
  • Part 3 (Creating sub-projects using the Visual Studio Development Server and Web Application Projects)


You just need to separate your solution into multiple projects. Create a Common class library project, Foo, etc. and reference them from the web project.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜