Disconnect with Application Block Factory Documentation

Topics: Building and extending application blocks
Jul 30, 2007 at 7:00 PM
We are struggling with the necessary guidance for creating a custom application block because the documentation available does not seem to sync up with what is produced via the recipes. The best application block example we could find was from July 2006. This does not align with the files generated by the factory. In addition there’s no guidance on how to complete and fill out the classes generated by the recipes.

The provider assemblies we can work out but we're struggling to get a handle on the factory classes that are generated and the configuration they use.

Is there an updated example of a simple block built via the factory that we can use for guidance?
Jul 30, 2007 at 7:55 PM

While there are a few differences, the generated code should be very similar to the actual code from the blocks. Can you provide additional details about the kind of inconsistencies you're experiencing?

Regarding the guidance on how to complete the code, although the documentation is limited the generated code includes TODO comments that should show up in VisualStudio's task list with quite detailed instructions; these comments should work well as a starting point. You can also take a look at this webcast, which includes a section on the app block factory http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&EventID=1032331980&CountryCode=US.

The block factory doesn't generate code for the actual configuration properties, but there are couple of VS code snippets that should make this task quite easy; these snippets are indicated in the TODO comments for the configuration classes.

Aug 1, 2007 at 12:40 AM
Edited Aug 1, 2007 at 12:41 AM
I'm not sure what Marty has run into exactly, but I'm finding the ABSF in 3.1 is actually generating wrong code. Has anyone created a successful block using ABSF in EntLib 3.1?

Here are a couple things I encountered when trying to use ABSF to create a new application block:

  • many documentation and links in the 3.1 release point to locations from the April 2007 (3.0?) release, and hence are broken. Perhaps this is a configuration issue on my end, but I did completely uninstall the April release and install the May (3.1). For example the main link for creating app blocks that appears in visual studio when using ABSF: ms-help://ms.vscc.v80/MS.VSIPCC.v80/ms.EntLib.2007Apr/EnterpriseLibrary/html/10-030-DevelopingApplicationBlocksandProviders.htm

  • the generated appblocknameSettingsNode class derives from ConfigurationNode, but after some investigation it appears this should have derived from ConfigurationSectionNode. The other blocks derive from this, so I'm not sure why the Factory generated code doesn't?. Also without this you don't seem to get the great "requirepermission" and "protectionprovider" features for configuration.