ASP.NET Home  Home RSS 2.0 Atom 1.0 CDF  

Manuel Abadia's ASP.NET stuff - Web Application Projects vs Web Site Projects - Subtle differences (Part 2)

 
 Monday, August 27, 2007

One cool thing in ASP.NET 2.0 is the concept of build providers. A file extension can be associated with a build provider that parses it and generates the associated code.

For example, the .XSD files have an associated build provider that generates a strongly typed dataset.

The bad news is that build providers only work for web site projects and not for web application projects. I don’t know what the exact reason is for Microsoft not having them working on web application projects but at the moment, we have to manually generate the associated code files and add them to our project. I hope they will fix this at least for VS 2008.

For now, they recommend creating a custom tool in order to handle the file creation. I don’t know very much about Visual Studio internals and I don’t have free time at the moment so I won’t try it.
 
If someone has some free time and can give it a try it will be cool to create a custom tool that reads the configured build providers from the web.config and generates code based on the file type and build provider.

There is a nice article that explains how to create something like the build providers for windows forms that can be a good starting point:

http://msdn.microsoft.com/msdnmag/issues/06/02/CuttingEdge/

Monday, August 27, 2007 5:44:35 PM (Romance Daylight Time, UTC+02:00)  #    Comments [1]    |   | 
Copyright © 2009 Manuel Abadia. All rights reserved.