HttpCompileException on ASP.NET 2.0 Precompiled Site

29 09 2006

Hmmm, just ran across something interesting.  Twas trying to publish a precompiled site to a 3rd-party host for the first time, and kept getting: ‘Cannot convert type ‘ASP.login_aspx’ to ‘System.Web.UI.WebControls.Login”  At first I thought perhaps it was a permissions thing, I mean it’s worked fine at my day job when deploying on our networks.

As usual, Google is your friend.  Basically don’t name your pages (or perhaps just your Page classes) the same as controls in (at least) the System.Web namespace(s).  Read there for more info.  Renamed my Login.aspx to XXLogin.aspx and presto!





Setting default web browser in VS 2005

23 03 2006

After installing the latest Firefox 2.0 alpha, I realized my VS 2005 no longer could start debugging. It complained with a “Could not start program …\firefox…” message as it couldn’t find my browser anymore after I upgraded it. After a quick Googling, found a blog with the answer. Right-click your web project, and select Browse With…. Presto! The menu you were looking for…

Dunno if this works in previous versions; I rarely used alternative browsers back then, or had to dink with this setting.





How NOT to implement Generics in .NET 2.0!

1 03 2006

Any developer worth their salt sees the problem here:

http://www.thedailywtf.com/forums/62237/ShowPost.aspx

BTW, I highly recommend this site to the techies out there, of all languages, of all roles…only 1 post a day, but well worth the wait :)





MasterPages in ASP.NET 1.x

16 08 2005

A few people have asked me recently if there is a templating approach that works well for ASP.NET 1.x applications, since we have to wait until version 2.0 for MasterPages. Sure, I say, Master Pages.

Ha, and then I wait for the clarification they were talking about 1.x, and reply, so am I. The beauty of .NET is being able to create such powerful mechanisms or approaches before they are even a ’standard’ tool used by a majority of developers. And that’s just what Paul Wilson did in this example of how to use Master Pages in ASP.NET 1.x. I believe this was Paul’s second go-round at Master Pages, improving upon his first version, which was based partially on the ASP.NET team’s reference implementation from awhile back. Back then Master Pages were mainly an experiment as far as I know, but now I can’t wait for them to become a standard tool everyone uses.

I’ve used Paul’s approach from this article at a few client now, and it’s worked extremely well. You won’t get quite the built-in designer (or WYSIWYG) support of 2.0’s version, but it’s more than adequate. Plus you’ll have a head-start on 2.0!





I’m baaaaaaaack! Search-engine safe URLs

8 08 2005

OK, my time off/away from the tech world is over, so non-techies, look away else be blinded by the light…

Contrary to prior promises, I still haven’t gotten organized enough to create articles here. I mean I have alot of ideas, but alot of my stuff fits more into an FAQ, not an article per topic. It’s the same approach I use in the newsgroups; I try to get people the info they need, I’m not going to re-explain how the wheel was created, I’ll help give some introduction, and then let another site do the talking. There’s no need for me to create yet another FAQ, to provide yet another site to monitor to look for perhaps your one question. And sometimes I’ll have plenty of original content of my own, related to some problem I had to solve today, etc.

Which is why this blog fits that so well; I’ll keep posting techie entries, under the appropriate category, and you can always use the search function of this site to see if I’ve ever talked about your question/quandry. Remember, my specialty is the .NET world, although as other topics come up (such as XML, etc.), don’t be surprised if I drop a link here and there.

And feel free to drop me questions; I’ll always try to answer what I can. I can’t be all your R&D, but I can help either answer or direct you to the answer.

OK, enough of the disclaimer/instructions, onto the goods! My first tidbit comes partly from work, but also a question posed by a direct email I received; it’s related to search-engine friendly URLs (aka search-engine safe URLs). URL rewriting with ASP.NET has always been possible, so with a little ingenuity, we can create an HttpModule that supports search-engine safe URLs. It filters/rewrites the URL not only on the inbound request, but within the outbound stream. This way you can still use your ‘normal’ URLs in your pages/code, and not have to recode all of your links…

The ONLY problem with this approach is that you are using an ASP.NET mechanism; unless the request actually makes it to the aspnet_wp process, none of this code can do its magic. Therefore, the request must be mapped to be handled by the aspnet_wp process (i.e. the file extension is handled by aspnet_wp), which is not necessarily ideal for all file types, or if you wish to really mask the URL by making it look like you’re running PHP, e.g., excluding .aspx from the URL.

Therefore, still the most complete (and easiest) method to accomplish this is via an ISAPI rewriter. These dlls are injected sooner into the request handling cycle of IIS, and can therefore influence all incoming requests. But of course they are usually written in C++, making them harder to create/maintain yourself.





Learning .NET 2.0

16 07 2005

Want to learn .NET 2.0 the quickest way possible? I highly recommend the Developer’s Notebooks line of books. Definitely not for the 1.x beginner, as they start out assuming you know 1.x and explain the differences through short lectures (more like a paragraph or 2), and then show through example. There are always plenty of links provided in each section, to find more information or explanation. I found myself doing both (reading this book and following the links), as sometimes the explanations were a little too quick. But they will also serve as a good reference resource down the road, quick intros to topics you can’t remember the details about.

Hence their name….





TechEd info -AND- VS, BizTalk, SqlServer 2005 launch dates announced

7 06 2005

Check out the Press Pass for all the latest from TechEd, which is going on this week. Of most importance, they announced the release dates of Visual Studio 2005 (.NET 2.0), BizTalk 2005 and SqlServer 2005. Look out November!





‘Another’ VS2005 Delay?

23 03 2005

I’m a little confused; according to eWeek, Microsoft is delaying the releases of Whidbey and Yukon again; they will be released simultaneously. Hmmm, I thought it was a given that Whidbey would not be out until September (in a previous post of mine). I know Yukon, last I heard, was shipping in July-ish timeframe.

Anyhow, as there are quotes from Microsoft in this article, I would take this as the latest news…ah, remember when it was supposed to ship last year? :)





VS 2005 Beta 1 Emulator Setup Issue

2 02 2005

Just thought I’d drop the hint: I was installing VS.NET 2005 Beta 1 on a new PC today, and hit an error during the Device Emulator install, which occurs after VS.NET is installed (thankfully).  If you get an error essentially saying ‘…Error 1603…Fatal Error during installation…”, the following blog entry will help immensely:

http://blogs.msdn.com/amit_chopra/archive/2004/07/07/175484.aspx

Their proposed ’solution’ worked perfectly.





2005 Go Live approaching!

30 01 2005

Wow, talk about me falling behind…Microsoft ‘recently’ announced that Beta 2 of VS 2005 will ship around end of March, and at the same time receive Go Live! licensing.  Go Live! was introduced to assure developers that applications being built with a beta version of software would be production-ready.

In addition, the RC will ship around the September timeframe…for those who have been worried by ‘delays’, I would assume Microsoft is doing all it can to deliver this year, and I wouldn’t expect anymore delays.  They haven’t missed a ‘year-branded’ product release yet…