1

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.

yusuf
  • 3,596
  • 5
  • 34
  • 39

2 Answers2

1

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
  • 10,139
  • 5
  • 38
  • 50
  • 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? – yusuf Jan 13 '09 at 19:16
1

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

Rick Rat
  • 1,732
  • 1
  • 16
  • 32