Walt Ritscher: Thinking about code

Thoughts about .Net - Thoughts about code

  Home :: Contact :: Syndication  :: Login
  171 Posts :: 0 Stories :: 80 Comments :: 23 Trackbacks

Archives

Post Categories

Image Galleries

About Me

Interesting Blogs

My other blogs

Resources

Wednesday, November 01, 2006 #

Tonight I was converting an ASP.NET 2.0 Website to a Web Application Project.  There is a nice step-by-step guide that I was using to walk me through the process.   I ran into troubles as soon as I ran the “Convert to Web Application” menu. 

I tracked  the trouble down to four files in the project.  All of them were failing with this message.

Generation of designer file failed:  The expression prefix “ConnectionStrings” was not recognized.  Please correct the prefix or register the prefix in the <expressionBuilders> section of configuration.

The first place I looked was a dead end.  I looked in the web.config, thinking that was the configuration file in the error message.  Wrong!

Next I looked at the html on one of the problem pages.

 <asp:SqlDataSource ID="dsUsers" runat="server" ConnectionString="<%$ ConnectionStrings:aspnetdbConnectionString %>"

There was the ConnectionStrings text!

The Fix

  1. Cut everything between the quotes for value of the ConnectionString attribute.
  2. Do the same for any other ConnectionString attributes on the same page.
  3. Run the  “Convert to Web Application” for the current page.
  4. Restore the ConnectionString value and save the file.
posted @ 11:59 PM | Feedback (0)