Using aspnet_regbrowsers results in "Object reference not set to an instanace of an object"

Feb 23, 2010 at 6:03 PM

Should the mobile.browser file work with aspnet_regbrowsers.exe?  I was hoping it would, but keep getting the following error:

"ASPRUNTIME: Object reference not set to an instance of an object."

After removing the mobile.browser and trying again, the exe works fine, and installs the resulting assembly in the GAC as expected.

While I dig in some more, anyone else come across this?

Feb 23, 2010 at 6:22 PM

Ok, in case anyone else is wondering, here is how I got it to work...

1) In C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727\CONFIG\Browsers directory, add a new directory Devices, and copy mobile.browser there.

2) I then removed all the .browser files from within \Browsers, leaving only the Default.browser file behind (aspnet_regbrowsers.exe wants at least one browsers file in the root)

3) Then run the command %SystemRoot\Microsoft.NET\Framework\v2.0.50727\aspnet_regbrowsers /i

This generates the ASP.BrowserCapsFactory.dll file in the \Browsers directory, and registers in the GAC as well.  I opened this dll in .Net Reflector. and everything seems to be in order.  Quick test using Request.Browser.IsMobileDevice before and after running aspnet_regbrowsers seems to indicate that it worked fine as well.  I think others have posted the same here, and I guess I don't get the need for the "Devices" directory either.