July 2005 Blog Posts
Next up (typical, you wait for one new blog post to arrive, then four come at once) adding a sql server membership database. One of the problems with asp.net configuration tool for the baby web server Visual Studio 2005 supplies is it can't understand you have SQL server installed. It appears to want to create new SQL Express databases. So in order to use SQL server for membership, roles and all the other goodness asp.net provides you need to do the following;
Install the membership databases into SQL by running aspnet_regsql.exe
Add the connection...
Altova, the people behind XMLSpy and a really nice XML editor suite have made their XQuery and XSLT 2.0 objects available for download, complete with .net support. They support XQuery 1.0 and XSLT 2.0 (with or without schema support). This may make up for Microsoft not including XQuery in v2 of the .net framework, although their reasons for removing it were sound.
And finally; xhtml support is wonderful (except when the login box starts using tables; tables? How 90s). Then you go to the w3c validator and plug the address of your site in and validation fails. So you check the error messages against the source for your site and the errors it describes aren't there. It turns out that page rendering is dependant on the browser capabilities. Not good, if I set a DTD I expect it to be honoured. If you must fiddle with the HTML for down level browsers then change the DTD to match. Go comment on this...
The web admin pages don't work when setting up an email provider, instead you get a compilation error; Compiler Error Message: CS0246: The type or namespace name 'MailSettingsSection' could not be found (are you missing a using directive or an assembly reference?)
You have a choice of fixes, either set your mail settings manually in web.config;
<configuration>
<system.net>
<mailSettings>
<smtp>
<network host="mailServerFQDN" password="" userName="" from="fromAddress" />
</smtp>
</mailSettings>
</system.net>
</configuration>
or fix the broken code;
Open the SMTPSettings.aspx file in the 'C:\WINDOWS\Microsoft.NET\Framewor k\v2.0.50215\ASP.NETWebAdminFiles\AppConfig' folder. Your path might be slig htly different, but that should be enough to help you find it.
Change the 2 instances of this line
MailSettingsSection netSmtpMailSection =
(MailSettingsSection)...
You have to love beta environments, especially those were no help text was installed. I'm starting to play with asp.net 2.0, I even have a pet project to work on as a goal (don't expect it any time soon). First up on the learning list was master pages. Except they didn't work, every time I tried to add a master page to my project Visual Studio died with "Object Reference Not Set To An Instance". You have to love that error message, it should really read "Oi! Lazy programmer! You didn't check for null". Lots of searches later, including...