vrijdag, december 30, 2005

Installing IIS After .NET Framework

If you install IIS after .NET framework or if you removed and reinstalled IIS on a server that has .NET framework, then your ASP.NET pages will not work.
This is because you are missing the IIS mappings associating the ASP.NET file extensions.

To fix IIS mappings for ASP.NET, follow these steps:

1. Click Start -> run -> cmd - ENTER
2. At the command prompt, type the following, and then press ENTER:
"%windir%\Microsoft.NET\Framework\version\aspnet_regiis.exe" -i

In this path, version represents the version number of the .NET Framework that you installed on your server. You need to replace with the actual version number when you type the command.

3. Register the Aspnet_isapi.dll by clicking start -> run
4. In the Open text box, type "regsvr32 %windir%\Microsoft.NET\Framework\version\aspnet_isapi.dll" and then press ENTER

SOURCE

woensdag, december 14, 2005

IIS Virtual Directory Bug, VDir in VDir sometimes hidden (invisible due security?)

The VDir (in another Vdir) will be correct created with no errors, but most of the time the VDir isn't visible in IIS?!?
Although it isn't visible, you can reach it! (example): http://localhost/VDIR/VDIR/something.aspx no error!!!
It looks like there is an User interface bug that hides the VDIR for some reason (security issue?)

So if you want to change options of that VDIR, you have to install MetaEdit (Tool for editing the IIS Metabase)
(install-link + more info)

Some other people had the same problems (source-url)

donderdag, december 08, 2005

Adding a Visual basic (vbs) script into a web setup project to add a virtual directory in ISS

Beneath there is a possible solution for the problem, but visual basic scripting is not good for using in setup projects (sometimes virusscanners block it!)

Because of the strange bug in IIS (look here), I used vbs to make the virtual dirs. But there is a better way, create & configure the Virtual Directory's
in a class that will run during setup:

< RunInstaller(True)> Public Class WebInstaller Inherits System.Configuration.Install.Installer
' Some Component Designer generated code
Public Overrides Sub Install(ByVal state As IDictionary)

' Write here code to do during setup (creating Vdirs, .....)

End Sub


Look at the url below to read about "Customizing Windows and Web setup projects"

All about Installers - Customizing Windows and Web setup projects &
Conditional Install of Desktop and Quick Launch Shortcuts



You must create a virtual directory linked to a path in a script, because in a web setup project it isn't possible to create a virtual dir linked to a path

Also I had to set some options of that directory:

Set Directory Settings to Integrated Windows authentication (without Anonymous access):
IIsWebVDirObj.Put "AuthFlags", 4
(All the AuthFlags" options:

http://msdn.microsoft.com/library/en-us/iissdk/html/14b96ff9-94e6-49f4-8d61-160111041bd5.asp)
(Tip: if you want to combine security setting, like Integrated Windows authentication AND Anonymous access, set

the AuthFlags to 4+1 , the 1 from Anonymous authentication)

IIsWebVDirObj.Put "Path", "C:\Program Files\Unique World Software\InfoView"
This is the path where the virtual directory is referenced to

Set the Read Access to true
IIsWebVDirObj.Put "AccessRead", True

Set the Script Access to true
IIsWebVDirObj.Put "AccessScript", True


More info:
Creating Sites and Virtual Directories Using ADSI
IIsWebVirtualDir (ADSI)
IIS ADSI Provider Overview
Remove IIS Anonymous Access
IIS ADSI arguments info for create,delete,.... of virtual dir

woensdag, december 07, 2005

ASP.net error: "The resource cannot be found" because of a stupid "/" in IIS configuration (home directory, local path ) !

When I was testing a Web Setup project I always get a strange error (after the installation):


Server Error in '/TEST' Application.
--------------------------------------------------------------------------------
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested Url: /TEST/Index.aspx
-------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032



The /TEST/Index.aspx file exist in the right path on my hard disk, so I went on searching and I found out that there were several people which had the same error-problem!

I find the solution (link) :

Under the root path in IIS configuration, under "Home Directory"
under the field "local path". "c:\inetpub\mywebsite\" is not the same
as "c:\inetpub\mywebsite" apparently now. My site came back alive as
soon as I removed the trailing backslash so that the path now says
"c:\inetpub\mywebsite"!

So you see that a stupid backslash can do harm!

woensdag, november 30, 2005

Javascript helps you, to go to an anchor on your webpage

This function (VB. NET) uses javascript to navigate to a specific anchor on your webpage,
This function is only for navigating to #convert, but you can easy change the function offcourse:



If anybody knows how this is possible in ASP.NET, let me know, I'm not a freak yet

Setting the description of a Windows Service isn't possible? [UPDATED: yes it is!]

When I did my first Windows Service, everything was going smooth.

Only stupid thing that I didn't find out was how to set the description text (visible in service overview).....
Something I find was the ServiceProcessDescriptionAttribute, but I didn't find out how to link it with the service

Blogs that also mention this problem:
http://www.jasonbock.net/JB/Default.aspx?blog=entry.b36451aa549f4e238a7aafa18b770aa6
http://www.jasonbock.net/JB/Default.aspx?blog=entry.c0ca31947dcc48278600834533ee16ea

Finally I found a solution on The Code Project:
Adding a description to a .NET Windows Service:http://www.codeproject.com/dotnet/dotNETSCMDescription.asp

dinsdag, oktober 18, 2005

Hello World

I had a dream....