Setting up ASP.Net 2 Stuff…

Posted 30 June 2006, 15:25 | by | Perma-link

Couple of notes to self mostly:

I had a couple of problems with an ASP.Net 2.0 site on Windows XP Pro, namely I first received errors like:

Failed to execute the request because the ASP.NET process identity does not have read permissions to the global assembly cache. Error: 0x80070005 Access is denied.

As you'll probably have found out, you need to ensure that the local user ASPNET has access to the GAC, and for that you need the command line tool cacls:

cacls c:\windows\assembly /E /T /G ASPNET:R

/E - Edit the ACL instead of replacing it
/T - Change files in this directory and all sub-directories
/G user:perm - Grant the user a permision.

The recommendation I'd seen used /P instead of /G, I found that /G was more reliable.

On top of that, I then had to ensure that both the user ASPNET and the user IUSR_MachineName had read access to the website's files - so run the cacls command with those directories, and you should be away (you need to do it for IUSR_ as that's the account that non .Net pages are called under - .css, .js, .html, etc).

The other problem I had was with ATLAS (ajax to non-softies):
I was setting up some admin pages that shared a master page, and wanted the pages to asynchronously call the server every now and then to keep the session alive during prolonged edits. I initially tryed to add a public method on the page decorated with a [WebMethod] attribute, but to no avail, the PageMethods JavaScript class wasn't being generated. Turns out if you want to call an ATLAS server side method from a master page, you need to call it through a webservice. Enjoy...

Filed under: ASP.NET, Fixes

Trials with .Net 3.0 Framework

Posted 27 June 2006, 17:00 | by | Perma-link

Or, "Quick hack to get Windows Presentation Foundation running with Firefox".

I have FF installed on my desktop, it's my default browser, and this is, in general "a good thing". However, I've just installed the latest bits of the .Net Framework, and things are not all well in the world.

Attempting to debug (or even open) an .xbap or .xaml file resulted in FF starting up, and asking if I wanted to open this file with the "Windows Presentation Foundation Host". Well, of course I did! So FF asked me again, and again, each time opening a new tab - Don't check that little box "Don't ask me about this file type again", FF will just keep opening new tabs.

To get around this for now, as a quick fix I did the following:
Tools | Options | Downloads
View & Edit Actions
Scroll down in the list, and select the XBAP, and change the action to Internet Explorer, and the world's all happy again.

Filed under: .Net, Fixes