It's been a while since I've had to setup a Windows 2003 server to test Asp.Net apps on so i was a bit baffled when when i couldn't get the website to serve aspx pages. Navigating to the site would result in "The page cannot be found" http 404.
Did all the usual googling, checked the logs at %WINDIR%\System32\Logfiles\W3SVC* which contained lines similar to:
2002-11-25 05:46:15 127.0.0.1 GET /default.asp - 80 - 127.0.0.1 - 404 2 1260
Right, just need to lookup what the "404 2 1260" error means. Despite the detail on that page there's no concrete answers.
Anyway long story short, i had forgotten to register Asp.Net 2.0 with IIS using the old chestnut: aspnet_regiis -i. Allow Asp.Net 2.0 in IIS->Web Service Extensions and away we go.
I'll just slink back to my cave now :(
Friday, May 29, 2009
Sunday, May 24, 2009
Shaping Entity Framework Results
In order to comply with an interface I needed to write code similar to the following:
Which results in:
LINQ to Entities does not recognize the method 'EhrAdmin.Services.MSSQL.DTO.RuleExpressionDTO[] ToArray[RuleExpressionDTO](System.Collections.Generic.IEnumerable`1[EhrAdmin.Services.MSSQL.DTO.RuleExpressionDTO])' method, and this method cannot be translated into a store expression.
I'll revisit this when i get a chance but the fix at the moment is to convert ObjectQuery<actionrule> to List<actionrule> using the ToList() method.
Which results in:
LINQ to Entities does not recognize the method 'EhrAdmin.Services.MSSQL.DTO.RuleExpressionDTO[] ToArray[RuleExpressionDTO](System.Collections.Generic.IEnumerable`1[EhrAdmin.Services.MSSQL.DTO.RuleExpressionDTO])' method, and this method cannot be translated into a store expression.
I'll revisit this when i get a chance but the fix at the moment is to convert ObjectQuery<actionrule> to List<actionrule> using the ToList() method.
Friday, May 22, 2009
Visual Studio Tip - Hiding Toolbars
I had a funny realization a couple of days ago that I don't actually use any of the default toolbars in Visual Studio. For someone who normally developments on a 24" 1920*1200 monitor it hasn't really been an issue in the past. However I'm currently doing all my development on a 1024*768 laptop, (yeah i know, lame huh?) so I really need all the space I can get.
Funny thing is I don't think I've one needed to reinstated a toolbar yet. Keyboard shortcuts seem to be sufficient for just about everything, ReSharper obviously helps though :)
I'm even tempted to generate the list of Keyboard Shortcuts I currently have enabled.
Funny thing is I don't think I've one needed to reinstated a toolbar yet. Keyboard shortcuts seem to be sufficient for just about everything, ReSharper obviously helps though :)
I'm even tempted to generate the list of Keyboard Shortcuts I currently have enabled.
Html.ActionLink gotcha
For some reason I keep getting tripped up by the following sort of code:
Seems simple enough but you end up with a link like :
http://localhost:5825/ActionRule/Details?Length=10
Easy fix is to add a null parameter to the end of the list. Why? Well the compiler treats the first call as:
Obviously the parameters are resolved incorrectly as there is no method signature such as:
I really should write an extension method to cover this (fairly common for me) scenario. Who cares you say? Well to this point it seems that this is the only situation using ASP.Net MVC where I've had to add a null parameter on the end of a call to get the desired result. Not saying it's a bug...just interesting none the less.
Wednesday, May 13, 2009
The view 'Logon' or its master could not be found frustration
Ran into this one again today:
The view 'Logon' or its master could not be found. The following locations were searched:
~/Views/Account/Logon.aspx
~/Views/Account/Logon.ascx
~/Views/Shared/Logon.aspx
~/Views/Shared/Logon.ascx
of course all the files were present because it was working 5 minutes ago (and the 2 weeks or so before that).
I had been using the ASP.Net MVC source project to debug a few things, but reverted to the GAC dll before checking in so that the other devs didn't end up with some phantom project reference. Hence I thought I had not reverted my web.config (and ~/Views/web.config) changes properly.
Anyway half an hour later and a lot of head scratching later I thought I'd see if setting the System.Web.MVC reference to "Copy Local =True" would make any difference
...
it did.
End of story.
The view 'Logon' or its master could not be found. The following locations were searched:
~/Views/Account/Logon.aspx
~/Views/Account/Logon.ascx
~/Views/Shared/Logon.aspx
~/Views/Shared/Logon.ascx
of course all the files were present because it was working 5 minutes ago (and the 2 weeks or so before that).
I had been using the ASP.Net MVC source project to debug a few things, but reverted to the GAC dll before checking in so that the other devs didn't end up with some phantom project reference. Hence I thought I had not reverted my web.config (and ~/Views/web.config) changes properly.
Anyway half an hour later and a lot of head scratching later I thought I'd see if setting the System.Web.MVC reference to "Copy Local =True" would make any difference
...
it did.
End of story.
Monday, February 23, 2009
HTML Engine Automatic Tag Expanding
Well this one had me stumped for a little while...
I'm using the JQuery UI library for an ASP.NET (MVC) project. I was trying something quickly using FireBug I grabbed this piece of markup and pasted it into my .aspx page:
Easy i thought. I was expecting some CSS conflicts so it was no surprise that my aspx version didn't look the same as the example.html version. But for the life of me couldn't work out which attribute/element combinations were different. They looked identical, they actual CSS was identical.lt span class="ui-icon ui-icon-info" / gt Hey! Sample
After much hair pulling I discovered a mysterious closing span tag that wasn't present in my pasted code??? Seems most HTML rendering engines (IE, FF, Chrome) don't like to output inline closing tags for elements that should obviously have content e.g . Unfortunately for me, instead of converting:
to:span / ...
they decide to "fill out" the element within its parent, such that:...
and hence destroyed the CSS rules :(...
Examing the network request/response in Firebug reveals that the HTML that comes down from the server is in fact the same as the .aspx file.
Note to self: to blindly copy/paste example code even when it really should work :)
Edit: I use Syntax Highlighter to format my code, but again the HTML engines seems to insist on messing up my inline lt span / gt tags for this post, grrr....
Tuesday, October 14, 2008
Bug fix bingo
In case you have seen this before I recommend you print it out and stick it over the top of one of your Dilbert comics or something :)
Bug Fix Bingo
Better still it's from a Queensland company!
Subscribe to:
Posts (Atom)