views:

284

answers:

2

I was going to try Subsonic, you can generate DAL with buildProvider element in an ASP.NET website project. But I get curious why Web applications or windows applications do not support BuildProvider.

PS: I know for Subsonic there is one other option to use it with other than BuildProvider, but I just get curious.

+1  A: 

It doesn't work because of the different way things are compiled in web application projects vs. website projects. From what I read on MSDN, it has to do with the fact that in web app projects, all your code files are compiled into a single assembly using MSBuild before deployment, but Build Providers are used to generate code that is compiled at runtime (from your App_Code folder).

In website projects, all of your code is compiled at runtime so it all plays nicely together.

patmortech
yes, but I realized that generating code at runtime and compiling it is a nice feature, why cant we use for a windows app? Is there a secret reason behind this?
erdogany
+1  A: 

You could possibly hook it into your pre-build event, and call the sonic.exe with the proper command line.

Rick Ratayczak