Home
About
Color Tool
 

Share Wonders is proudly powered by WordPress
Entries (RSS) and Comments (RSS).
11 queries. 0.310 seconds.
Valid XHTML

Archive for the 'ASP.NET' Category

add/edit application extension mapping ok button is grayed out

Sunday, February 4th, 2007

If you are trying to map a new file extension in IIS 5.0, you may notice that the OK button is grayed out and that you cannot select it, and therefore you cannot add a new file extension mapping. There may be two reasons for this:

1) You may be trying to add a new extension mapping at the directory level and adding a * to the extension as in *.newxt - don’t do that. IIS 5.0 won’t tell you why it’s not letting you add the extension (IIS 6.0 will). Just remove the * and add .newxt where newxt is the name of your extension.

2) You have encountered a Windows XP User Interface bug. The button should not be grayed out it’s a well known bug. Just click the first textbox or click around the dialog and the ‘Ok” button should become active.

The type or namespace name ‘IHttpModule’ could not be found

Saturday, February 3rd, 2007

If you received this error while working with ASP.NET in Visual Studio (probably 2005) to create an assembly or HttpModule you’ll need to add a reference to System.Web.

You probably think you did this already when you added ‘using System.Web;’ to the top of the of the page like this:

Using System.Web imports namespace

But that is not adding a reference, that importing a namespace. To add a reference in Visual Studio to a non-web project, highlight the project in the Solution Explorer, right click and select “Add Reference’ from the context menu. A window will appear on which you’ll have to select the System.Web dll. You’ll have to find it by scrolling down the list.

In Visual Studio you should now see this in the Solution Explorer:

System.Web as reference

You can open up your myProject.csproj (This file is wherever you store your projects, usually in My Documents/Visual Studio…) in notepad to see the reference has been added:






If you’re not using Visual Studio you add the reference as a parameter when compiling with csc using the command line.

When working with a website, you can follow the same procedure to add a reference (you wont have to add one for System.Web), using the context menu or you can alter your Web.Config:





You can also use the main application menu in your toolbar. Project (or Website)>Add Reference.

Failed to update database because the database is read-only

Sunday, January 28th, 2007

Did you get that error while working with ASP.NET 2.0? Something about aspnetdb.mdf or something? Here’s the solution:

(I’m assuming you’re on Windows XP)

1) Open up My Computer or any folder in Windows Explorer.
2) Go Tools -> Folder Options
3) Select the View Tab
4) Scroll down to the bottom and un-check the box that says ‘Use simple file sharing (Recommended)’ - it’s recommended to be checked for your grandma, not a ASP.NET developer like yourself.
5) Go to your website in Windows Explorer, probably C:/Inetpub/wwwroot/yourVirtualDirectory
6) Copy all the files and directories there to some other place, like your desktop.
7) Delete all the files in that directory/website. If it says not allowed, it’s because some process is accessing the file. Try shutting down the website, closing any windows you have open, and as a last resort restart your computer.
9) Delete the virtual directory/website in IIS, and then recreate it, giving it the same permissions - read, write, script, whatever.
8) Cut all the files you copied before you deleted them, and put them back in that directory.
9) View the physical directory in windows explorer, probably in C:/Inetpub/wwwroot/
10) Right click on it, select ‘properties’ and then select the security tab. Add the IUSR and ASPNET users and give them write access. If you don’t know what those users look like, check one of your other applications/virtual directories/websites, by selecting the properties window and clicking on the security tab and seeing what users have access.
11) Rebuild and view site. It should work now.

If you’re like me you probably just copy and paste the error in Google Search and now you’ve found this site and you’re pissed and maybe you’ve spent an hour or two searching and you still haven’t figured it out.

You’re probably ready to never use ASP.NET again.

You’ve probably already been to this site, and this one, and they didn’t help. Maybe you also hit up some forums like this one.

They probably said something like ‘change security settings’ and you’re running around the properties window for your files and directories finding nothing.

Hopefully my steps have helped. If not, good luck with your search.

Stay Away from Microsoft Press’s ASP.NET 2.0 Step By Step

Saturday, January 20th, 2007

ASP.NET 2.0 Step By Step I have ever encountered. It is written terribly, there are tons of spelling mistakes in the example code.

The official list of corrections names only seven errors, but I have found that many in just one example. Every chapter is populated with them. Some of them are just really sloppy like extra quotes in strings and who knows what. If you type the code in examples as is, often it wont compile. I have spent hours debugging code in the book. The CD comes with example code (first of all, it doesn’t even install to where the book says it will install), but that code is the finished code, and yes it works, but you don’t get the step by step from it.

It’s just very poorly done, and the writer should really never write another programming book again. Had I been smart and read it got on Amazon.com, maybe I would have bought a Wrox book instead.

 

Share Wonders

Look out honey, because I’m using Technology