Upgrading IIS Web site or application to ASP.NET 4.0

I want to upgrade a Web site from ASP.NET 2.0 to 4.0 without resetting IIS because it is running on a production server. The tool to do this is the ASP.NET IIS registration tool, aspnet_regiis.exe, which comes with ASP.NET 2.0 and 4.0. This tool doesn’t come with ASP.NET 3.0 and 3.5 because they’re both based on CLR 2.0. In fact, you don’t set a Web site or application to use ASP.NET 3.0 or 3.5, as IIS only knows about CLR version. See Scott’s Hanselman’s article for an excellent explanation. The .NET Framework version 4.0 comes with the new CLR 4.0 and so a new version of the tool is available.

Since I want to upgrade the Web site to ASP.NET 4.0, I’d run the 4.0 version of aspnet_regiis.exe, which is found under %systemroot%\Microsoft.NET\Framework\v4.0.303319. According to MSDN, to avoid interrupting IIS, I should use the -s switch to specify only the desired site or application as well as the -norestart switch to inhibit a restart. The value for the -s switch should be the path to the site; however, it may not be clear what this value should be.

To get a list of the paths and their registered ASP.NET version, I executed aspnet_regiis -lk and got the the following: Continue reading Upgrading IIS Web site or application to ASP.NET 4.0

Configuring SSL Bindings Directly for Http.sys

I ran into an issue today with how the IIS 7.0 admin GUI deals with SSL certificates when assigning bindings to web sites. I had two websites that I was binding to the same IP address, but I was using different ports for each (including different ports for SSL). Even though I was using a different SSL port for the second website, it was telling me that my certificate was already in use by another website and that changing the setting would affect the other site. The strange thing was, I was using two completely different certificates. Why in the world would it tell me my certificate was in use on the other website, when it clearly was not? Changing the SSL settings on one site would end up deleting the settings on the other site. After searching online, I found out that there are some known bugs with how the admin GUI deals with bindings and SSL in general. By settings the bindings on the command line, I was able to work around the issue.

Below are some useful command line commands that can assist in creating SSL bindings manually.

To list SSL certificates in use, with their bindings: Continue reading Configuring SSL Bindings Directly for Http.sys

Static Initialization in the BlackBerry JVM

The Problem

I was investigating some odd behavior on the BlackBerry recently to try to diagnose a problem. Along the way, I discovered a bug in BlackBerry’s JVM, as a result of which static initialization can occur multiple times – and even static final variables can change.

Consider the following code:

public class App extends Application
{
	public static void main(String[] args)
	{
		System.out.println(BaseClass.class.getName());
		System.out.println(Subclass.class.getName());
	}
}

public class BaseClass
{
	static
	{
		System.out.println("Static initialization called");
	}
}

public class Subclass extends BaseClass
{

}

Continue reading Static Initialization in the BlackBerry JVM

Running ASP.NET 1.1 on Windows Server 2008 R2

Although this configuration works on Windows Server 2008 R2, it is unsupported by Microsoft. Use at your own risk.

Use these steps to install ASP.NET 1.1 on either Windows Server 2008 x64 SP2, or Windows Server 2008 R2.

Short version:

  1. Follow all of the steps in How to install ASP.NET 1.1 with IIS7 on Vista and Windows 2008
  2. Then implement this workaround for an acknowledged bug: Workaround: Running ASP.NET 1.1 on Vista SP2/WS08 SP2

My summary:

  1. Ensure that the “IIS Metabase Compatibility” Role Feature is installed in IIS
  2. Download and install:
  3. Make sure ASP.NET 1.1 is enabled under ISAPI and CGI Restrictions
    • In my experience, this has already been enabled after installation
  4. Add this IgnoreSection handler to the <configSections> element on the .NET 1.1 machine.config, located in %windir%\Microsoft.NET\Framework\v1.1.4322\CONFIG

Using IE to Connect to a Keberos Enabled Non-Default Port SharePoint Site

So that title may be a bit to swallow…. Basically, Internet Explorer does not handle authenticating to a Kerberos enabled website running on a non-default port..

For example, I created the SharePoint central administration site on host computer MOSS (port 1000) to use Kerberos authentication. I add the service principle name (HTTP/MOSS:1000, HTTP/MOSS.domainname:1000), required for Kerberos authentication, to the central administration site’s application pool account in Active Directory. When I attempt to browse to the central admin site from another computer in the domain (my host running ie 8) I get an unauthorized message after several failed attempts to login to the site with the farm administrator’s credentials. If you go back to the the central admin site’s host (MOSS2007) and tweak the local security policy to audit failed logins then you should see Kerberos 529 events in the security log (if you attempt to reach the page again). Continue reading Using IE to Connect to a Keberos Enabled Non-Default Port SharePoint Site

SSL Certificates, Blackberries, BES, and SilverDust

Introduction

Potential connection issues can occur between the SilverDust server, BES, and SilverDust blackberry client if SSL encryption is used. We recommended SSL be used in every production SilverDust environment to encrypt SharePoint content between SD Server and the BES/blackberry.

This post also serves as a general guide for accessing any SSL enabled website from the blackberry.

The Handshake

There are two ways a blackberry can complete a SSL handshake. The first option, called proxy mode, allow’s the BES to complete the handshake on a blackberry’s behalf. The second option, called handheld mode, allows the blackberry to directly complete the handshake.

Handheld Mode

To enabled handheld mode change the TLS default setting on the blackberry. This setting can be adjusted on the handheld by navigating to options->security options->advanced security options->TLS Default->change the setting between proxy and handheld. The default is proxy mode or set an IT policy value to force handheld mode. Continue reading SSL Certificates, Blackberries, BES, and SilverDust

Targeting a SharePoint Site in a Custom Action

In my initial attempt to create a custom action for a SharePoint list, I specified it as follows:

<CustomAction
    Id="SoftArtisans.Tutorial.MenuItemExcel"
    GroupId="ActionsMenu"
    Location="Microsoft.SharePoint.StandardMenu"
    RegistrationType="List"
    Sequence="1000"
    Title="Export to SoftArtisans OfficeWriter for Excel"
    ImageUrl="/_layouts/images/softartisanstutorial/actionicon_excel.gif">
    <UrlAction Url="/_layouts/SoftArtisansTutorial/ExcelWriter.aspx?ListId={ListId}"/>
</CustomAction>

WSS replaces the special {ListId} token with the actual id of the list. In the application page I tried to retrieve the list from which the action had originated as follows:

SPWeb web = SPContext.Current.Web;
string listId = Request.QueryString["ListId"];
SPList list = web.Lists[new Guid(listId)];

However, I found that SPContext.Current.Web always returned the root-level Web site, even if the action was activated from a child site. So I modified the URL of the action to include the URL of the site: Continue reading Targeting a SharePoint Site in a Custom Action

Adding a View When Provisioning a Custom List

When creating a custom list, you need to provide a list definition in the form of a schema.xml file. Rather than creating a schema.xml file from scratch, a recommended approach is to copy an existing list definition. The out-of-the-box SharePoint custom list is a good starting point as it provides the barest minimum of features required. Armed with a stock list definition, you need to modify it for the list you want to create. If you want to use a specific content type, you can specify it in the <ContentTypes> section. You need to specify the columns of the list in the <Fields> section. Finally, you will want to modify the view definition to specify the columns to be included in the view.

Modifying an existing list definition is a quick way to create a custom list. Often, however, you will want to have more control over the view definition other than what fields are included in it. The view definition is the largest section in the schema.xml and can be rather daunting. Here is where SharePoint Manager comes in. Continue reading Adding a View When Provisioning a Custom List

Blackberry Swallowed My Error

In some peculiar cases there will be an error thrown somewhere in the Blackberry modules that were invoked from your coed, but the error will never return to you, even with a try-catch block set. The stack trace of the error will be printed to the console, your process will be terminated and an error message will pop up on the device/simulator screen with: Uncaught exception: and the exception name.

An example for this is the Controlled Access Exception. When trying to open a file that is access controlled, even a specific catch for this error it will not matter, the process will be killed and the error window for uncaught exception will pop up. The best practice is of course to check for access control before reaching for the file, but it still doesn’t make sense to have it swallow the error and kill the process instead of bubbling it up. Also, for the access control it’s pretty straight forward, but now I have encountered it again, with a java.lang.Error exception and the process gets killed… java.lang.Error is slightly less informative than ControlledAccess Continue reading Blackberry Swallowed My Error

Blogged