Subscribe: Phil Scott's WebLog
http://weblogs.asp.net/pscott/rss.aspx
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
app  database  file  firefox  good times  good  header  install  net  new  page  people  running  site  sql  system  web 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Phil Scott's WebLog

Phil Scott's WebLog



Quite exciting this computer magic



 



Workaround to Install .NET 3.5 on Windows 2012 R2 in Azure

Sun, 12 Oct 2014 22:04:00 GMT

Fought this error for an absurdly long time today. Found a few error codes after some hunting - 0x800F0906 and 0x800F081F. Seems something is broken in the current image for Windows 2012 R2 DataCenter (version release date of 9/8/2014). Upon trying to add the .NET 3.5 Feature I kept receiving this error

(image)

After fighting all kinds of options including reconfiguring my network to use Google DNS services, I finally simply went to Windows Update and added the latest updates. 

Jackpot. That seems to have been it.  Per this blog post it seems there are a handful of hotfixes causing this corruption so the other option would be to go the other way and uninstall the hotfixes listed to get the install to go through too. I tried it out on a new image, and uninstalling KB2966828 let me get .NET 3.5 up and running too.

Hopefully this is resolved in the next image, but until then hopefully this helps someone else save themselves a few hours on a Sunday




And We're Back!

Wed, 11 Jun 2014 03:46:00 GMT

With help from Terri from Neudesic I've revived my blog. With the blogging new platform, ASP.NET vNext and my move leading to Phil Scott vNext this seems like as good as time as any to hot-link a new theme from Bootswatch and get publishing some more. It's been around for over 11 years now, and looking back on some of my old posts I'm cringing at what I wrote and kind of proud of the other stuff. Go 2013 Phil and your bad-self. 

Glad to be back.




Booting Windows 7 and VS 2010 on SSD in 18 seconds

Fri, 06 Nov 2009 22:17:00 GMT

I've been doing quite a bit of work with VS2010 recently as we've prepared for our launch of our free ASP.NET 4 hosting, and I had a fresh install of Windows 7 without the typical cruft that comes with our environment. So I wanted to show how quick booting off of a SSD is. There are two pieces of hardware EVERY developer must have - multiple monitors and a SSD. I've said it over and over again, I have never seen a single upgrade improve the performance of a PC more than my X-25M drive since I first saw what the Voodoo2 could do.

I took this video to show how quick the sucker is because until you have used it, you probably think I'm full of crap. But this sucker FLIES. My previous OS partition was running on a couple of 10,000 RPM drives running RAID 0, and there is simply no comparison. I skipped the BIOS and went right to the boot loader. It boots Windows 7, and then I dumped VS2010 Ultimate and Firefox 3.6 in my start up folder. I'm ready to rock and roll in 18 seconds.

(object) (embed)

Oh, and one more thing - this is a VHD hard drive that I'm booting off of so it's actually slightly slower than my typical install. I just didn't want to mess around with that on video due to all the logins and junk I gotta do by hand when logging onto our network.

I know a bunch of people are waiting for the prices to go down, but don't! You may get it $100 cheaper a year from now, but this thing is well worth the extra $2 a week to have it right now.




404 Errors with FileUpload with IIS7

Thu, 26 Feb 2009 18:16:00 GMT

I was getting some 404 errors while using the FileUpload control. I tested it out on my local machine and  using


       

worked fine. But once I moved it onto IIS7 everything started freaking out. Turns out IIS7 look for a different setting:

    
       
           
       

   

My searches really only directed me to modifying the system.web, so hopefully this will help someone out.




Watch Out for Request.Browser.MajorVersion in ASP.NET 2.0

Wed, 07 Dec 2005 15:01:00 GMT

I awoke to 1500 exceptions published to me this morning from our public site running ASP.NET 2.0.  Not good times.  "Luckily" they were all the same: Value cannot be null.  It seems one of the components that we are using is calling Request.Browser.MajorVersion and blowing up on goofy user-agents.  In this case the user-agent of doom is "YahooSeeker/1.2 (compatible; Mozilla 4.0; MSIE 5.5; yahooseeker at yahoo-inc dot com ; http://help.yahoo.com/help/us/shop/merchant/)".  For whatever reason ASP.NET 2.0 cannot parse the MajorVersion out of that and tries to call int.Parse on a null value, causing an error.

Luckily we own the source code to this particular component, so I just wrapped the calls to MajorVersion in a try block so that the entire site doesn't blow up on bogus error codes, so hopefully if you run into that particular error you'll be able to track it down.  I haven't tried any of the other properties of the Browser class, but if you are relying on them for anything you might want to first test them out with a rediculous user agent and see what blows up. 




Installing Ubuntu on Virtual PC 2004

Thu, 13 Oct 2005 23:08:00 GMT

I decided to give Ubuntu a try in Virtual PC to see how this distro works.  So far, I'm pretty damn impressed.  But getting it up and running in a Virtual PC wasn't quite as obvious as I hoped it would be.  Here are the steps if anyone else wants to try out this distro.  I basically just went through a default install, and when the thing booted up it freaked out on the display.  This is actually quite common with Linux distros that I've tried in Virtual PC.  Keep in mind, I'm not even too terribly sure how to pronounce Linux, so I just kinda faked my way through the steps.  You might know a really cool way to do some of these steps, and that would be great if you let me know

So after booting up in messed up graphics land, I was able to click the giant ass Reboot button on my 160x120 screen.  When it was rebooting, I hit ESC during Grub and booted into the recovery console.  This gave me root access (is this secure?  Sure as hell didn't seem like it to me...).  Once I was in there, I found the configuration file for the graphics card in /etc/X11.  Sso type in cd /etc/X11, although I certainly hope even the most harden of MScentric people can figure that out :).  Once in there I opened up xorg.conf using pico (so type in pico xorg.conf - isn't this fun?).  Browse down to the screen section.  Opps, looks like the defaultDepth property is 24, which VirtualPC doesn't support.  I changed this to 16 and hit CTRL-X to exit (saving when prompted of course).  Typed in reboot and awaaaaaaay we go.

Once I was logged in, I wasn't able to hit the internet but this was an easy enough fix.  Just go to System | Networking and enable the Ethernet connection.  At this point I was good to go.  I don't think I have sound yet, but I really could care less.  But if a wise soul would like to enlighten me, I wouldn't mind either.

So there we go.  I'm impressed with how easy this was to get up and running (besides virtual pc graphics snafu), and it looks great too.  I'm tempted to throw this on my laptop that I keep in my living room just because so many people use it.  You'd be surprised what my friend's girlfriends manage to install while we are watching football.  Stupid yahoo games.  But I digress.  So why all this trouble to post this on an ASP.NET site?  I've been tagged with doing a lot of the design work for my companies new site, and well, the old version didn't exactly work in Linux, i.e. the menus and some content doesn't show up at all.  Remember folks, Verdana isn't installed on everyone's PC.  It looks like the default sans-serif font is pushing some of the content around, which was dumb of me not to anticipate, so I'll have to fix this.  Good times.  Good times.




Accessing the Html Header in ASP.NET 2.0

Tue, 30 Aug 2005 16:01:00 GMT

I feel a bit silly for not figuring this out quicker, so hopefully I can redem myself by posting this to help people out.  Taking a look at the Page class there is a Header property that looks tempting to be able to do something like dynamically add a stylesheet.  The problem is that when you type in Page.Header it doesn't appear that you have full control over the header, even though there is the ever so tempting System.Web.UI.HtmlControls.HtmlHead class.  What I had been doing is throwing an id and a runat="server" onto the head tag in my HTML, which I really didn't like because an id tag on the head tag isn't valid XHTML 1.1. 

Today, a break through.  This has always bothered me, so I took a deeper look and it turns out that Page.Header is defined as IPageHeader.  Perhaps, just maybe I could cast Page.Header into System.Web.UI.HtmlControls.HtmlHead.  And sure enough, it worked great.  Anyways, I feel a little silly about not figuring that out sooner but now that I've gotten this working I feel much better.  Anyways, here's some example code to add a stylesheet to a page:

        Dim header As Web.UI.HtmlControls.HtmlHead
        header = TryCast(Me.Page.Header, Web.UI.HtmlControls.HtmlHead)
        If header IsNot Nothing Then
            Dim link As New HtmlLink
            link.Attributes.Add("href", "~/whatever.css")
            link.Attributes.Add("media", "screen")
            link.Attributes.Add("rel", "stylesheet")
            link.Attributes.Add("type", "text/css")
            header.Controls.Add(link)
        End If




The Curious Incident of the App_Offline.htm in your ASP.NET 2.0 App

Wed, 27 Jul 2005 15:22:00 GMT

I've gotten more than three issues sent to me recently regarding why an ASP.NET 2.0 app suddenly starts throwing up 404 errors, and each time there is a single culprit: app_offline.htm.  I'd point towards some documentation, but honestly I just can't find any out there, so hopefully this will help people figure out what is going on.  When ASP.NET 2.0 sees this file, it basically shuts down the process.  This is useful if you need to over write a MDB file for example.  

Strangely, each time I've encountered "issues" with 404 errors being thrown by applications when the file exists, this file exists and the customer doesn't know how it got there.  I'm not sure if they were just going through some demos and missed a step or something, or perhaps something in VS2005 or Web Dev Express is creating the file automatically.  Perhaps one of the publishing tools sends the file up, and fails to clean it up.  So there you go.  Hopefully this helps someone out there figure out why they are suddenly getting 404 errors on pages that exists, or maybe it helps people manage deployments easier by using app_offline.htm for what it was designed for.




Deploying the ASP.NET 2.0 Personal Site Starterkit

Thu, 30 Jun 2005 15:36:00 GMT

I've seen quite a few questions regarding how to deploy the Personal Site Starter Kit to a hosting account, so I thought I'd write up some guidelines on how to do this.  These directions have really only been tested with the MaximumASP's free beta account, but they should work with any of the other providers assuming they give you some type of SQL Server as the backend.The main problem with deploying the Personal Site Starter Kit is that by default it assumes that 1) you have SQL Express running on the webserver and 2) you are using the configuration settings provided in machine.config for the membership / role providers.  Unfortunately, SQL Express is simply not meant to be ran on shared webservers, so obviously we are not going to be able to use this as our backend.  Luckily, Microsoft has recently released some generic scripts for creating the database for the Personal Site Starter Kit, so we can use those to create the tables needed on our SQL 2000 database.Step one is going to be creating the support tables for the membership / role providers.  The .NET Framework SDK includes a tool called aspnet_regsql that will create the tables / sprocs needed.  On my machine it is located at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\aspnet_regsql.exe.  Run this program and it pops up a wizard to create the tables.  Choose "Configure SQL Server for Application Services", and click next.  We are now presented with a dialog asking for your login information.  Enter your SQL Server credientials and choose your database.  Note: you may get an error on the drop down.  That's fine, just type the database name in instead.  Finish running the wizard and you should have a bunch of shiny new aspnet_ tables in your database.Step two is getting the Personal Web Site Starter kit or the Club Site Starter Kit generic sql scripts.  The ASP.NET Starter Kit page has links for both of these files.  Download these files, and extract the .SQL file.  Now it's just a matter of opening up Query Analyzer or SQL Express Manager, connecting into your database and executing the script. Now that we have the database ready, it's just a matter of updating web.config to point towards the proper database.  There should be two connection strings, Personal and LocalSqlServer.  Update both of these to point towards your database. You can now connect into your site via the ASP.NET Configuration page to create yourself an admin user, or if you just want to see if it worked, fire up the website.  Feel free to delete the MDF files in your app_data folder.  We don't need them anymore. Now, for a little rant.  Yes, we are now using a connection string called LocalSqlServer to connect into a remote sql server.  And some might wonder why we had to remove a connection string that doesn't look like it had been defined yet.  And who knows how the providers are configured.  Here's the secret:  To make things "easier," Microsoft has created a default Connection String and Providers in machine.config.  I would highly recommend not using these at all costs in your application.  They are there simply for people who want to go "hey, i just created a website in three steps!"  Relying on those default providers will simply make development, maintence and deployment a pain in the butt (who knows if your host will even have those entries in their machine.config, or that they have the same values that you are using on your server).  If left up to me, Microsoft would not include these entries in machine.config and assume people will configure their membership / role providers on an application basis, not on a machine wide basis.  Makes sense to me.So, my long running, rambling point:  Take some time to look at the documen[...]



Premature Jubilation

Tue, 26 Apr 2005 19:12:00 GMT

Oliver Sturm sent along a couple of links to his blog where he's taken a much deeper look than my "oooooooh, pretty!" reception to the new image library that is shipping with VS2005.  And after taking a deeper look at these images, I've come to the same conclusion:  ugh.

Like Oliver said, if you want an app that looks good (or aren't creating VS2005), then you might want to venture over to glyFX or my favorite Glyfz.  It looks like Glyfz is even offering their alpha-blended PNG images for free when you buy the Office 2003 style image set.  That's a deal in a half.  Now all I need is an excuse to throw away our UI to get my boss to buy the set...



New Graphics with VS 2005

Tue, 26 Apr 2005 17:46:00 GMT

Holy crap, just found these things in my Visual Studio 8\Common7\VS2005ImageLibrary folder.  In there you will find a zip file with about 800 images to use in your apps.  Unfortunately these all look to be 16x15 in bitmap format and not png or gif for the web, but hey, it's a start.  This is something I've been complaining about for years.  Should be great for winform toolbars, but not so useful for the web.

No new icons though.  It looks like giving applications the rocket ship icon will still trendy.

Post Script:  As I finished typing this up, this movie popped up in my RSS reader as an introduction to the VS 2005 Image Library.  Sweet!



Validating XHTML with ASP.NET 2.0

Thu, 21 Apr 2005 16:28:00 GMT

With the go-live of ASP.NET 2.0, I've been actually using it at a level of more than "ooh, pretty new feature." I'm kinda of a standards nerd, so naturally I've been messing around with the XHTML output and making sure I like what I'm seeing.  So far, so good. But I ran my page against the W3C's validator and it freaked out, complaining about form tags having names and the such. So I take a look at the source, and it looks good to me. So I go back to the validator, and run it one more time, this time enabling "Show Source." Ah, there's the problem. ASP.NET thinks that the validator is some ghetto browser from 1996 so it is sending it invalid markup.

The fix was pretty easy once I tracked it down. Simply update the browseCaps section of your web.config to tell ASP.NET about the W3C's user-agent. Here's the code I'm using:


   browser=Netscape
   frames=true
   tables=true
   cookies=true
   javascript=true
   javaapplets=true
   ecmascriptversion=1.5
   w3cdomversion=1.0
   css1=true
   css2=true
   xml=true
   tagwriter=System.Web.UI.HtmlTextWriter

Now when you validate your page, ASP.NET will send out the same HTML as it would if Firefox or IE were requesting the page. Now what I'd really like to do is tell ASP.NET to shove it, and spit out XHTML on unknown browsers. Anyone have any ideas?




Bug or Not?

Wed, 02 Feb 2005 19:34:00 GMT

Hmmm, I forget how the box model is supposed to do things in CSS, but this seems a little off to me.  What I had was a div tag with a width of 500px.  Within that I have a nested div with a margin of 25px.  I WAS trying to avoid having to do a box model hack to make sure things look OK in IE 5.x. 

So everything is hunky dory until I take this layout and put it into a masterpage in VS2005.  I drop the ContentPlaceHolder and suddenly my 500px div is 550px large.  It seems VS2005 is trying to figure out how wide to make the ContentPlaceHolder "container," and forgetting about the margins (or padding (or borders)).  This also happens when you have a panel or anything else set to a width of 100%.  So it is just pushing it wider.  And since I'm using floats to do the layout, in VS2005 it is pushing my sidebar down because it is too wide to fit into the container.  IE 6.0 and Firefox seem to be getting this "right," but honestly I'm not too sure when Firefox is immulating bugs in IE or when IE is in compliance mode anymore.

I'm leaning towards bug.  If anyone is curious, here's the fancy code that is screwing stuff up:

       

           

               
                    jyeretjetjetj

           

       

       

            another 500px div
       


Take out the panel and just put normal text (or even just a div with width=100%) and it displays fine.

So, bug or not?



Funny places you see ASP.NET

Thu, 06 Jan 2005 19:23:00 GMT

Even though ASP.NET has been out for quite some time, it still tickles me to see sites with an aspx extension.  I recently checked out one of my favorite bar's site, O'Shea's Irish Pub here in Louisville, and was surprised to see it was running ASP.NET on Windows 2003. 

I know a lot of people are running ASP.NET, but it just doesnt' seem to have the penetration on the smaller sites.  Maybe now that more and more people are getting a hold of it, we'll start seeing more sites using it just because it is just that easy to put together a nice, easy to maintain site.




Want to get rid of spyware? Install this ActiveX control when prompted!

Thu, 06 Jan 2005 16:32:00 GMT

I'm sure you've seen the new Anti-Spyware tool from Microsoft, so I'll spare you the elevator pitch.

What I want to know is what brainiac decided that to install the thing you might want to either install an ActiveX control, or download an EXE file an execute it to continue? Um, isn't this crap the reason 99.9999% spyware gets installed?  Shouldn't that type of behavior be discouraged?  I was hoping that when I clicked next I'd get a screen saying "YOU FOOL!  You could have just installed something that is reporting your bank password to some crazy guy in Canada!  Don't do that crap, and maybe you wouldn't need to install this tool, moron."  But no, it actually popped up a file for me to execute (I'm running Firefox, I assume it would be an ActiveX control for IE).  FANtastic. 

 Thankfully, you can skip that step and just download the thing.  The irony of this product just gets deeper and deeper. 



Ben Lowery's HttpCompressionModule and Excluding Paths

Wed, 17 Nov 2004 14:43:00 GMT

We've had a lot of success using Ben Lowery's HttpCompression module in regards to cutting down our bandwidth on text intensive pages.  The only problem we've had with using the compression module has been with existing pages that were using Response.Flush (it would throw up the "Server cannot append header after HTTP headers have been sent" exception) .  Well, no problem, right?  Ben's excellent module supports the ability to exclude paths in web.config.  And this solution works great on our test machines.  The problem was that when we went live, everything broke in regards to excluding paths.  It would start throwing the "Server cannot append header after HTTP headers have been sent" all over again.

After sitting down and tracking down what we thought could be causing the exception, it really came down to our live site being in the root of the web, and during testing it would be in a subfolder of some sort.  Digging into the code we found the root of the evil:

string realPath = app.Request.Path.Remove(0, app.Request.ApplicationPath.Length+1);
if(settings.IsExcludedPath(realPath)){
   // skip if the file path excludes compression
   return;
}

Opps, Request.ApplicationPath is going to be "\" in the root folder, but it would be something like "SubFolder" on our test machines. Darren Neimke has a good write up on the subject.  Anyways, ripping out ApplicationPath.Length + 1 characters isn't going to work in our case. So a quick update and the problem was solved:

string realPath = app.Request.Path;
// if the length is only one character then we are at the root of the web and applicationPath
// has returned "\"  Otherwise, rip out the ApplicationPath
if (app.Request.ApplicationPath.Length > 1)
    realPath = realPath.Remove(0, app.Request.ApplicationPath.Length+1);
else
    realPath = realPath.Remove(0,1);

if(settings.IsExcludedPath(realPath)){
   // skip if the file path excludes compression
   return;
}

Hopefully this helps those of you that have seen this exception popup. Oh, and a special shout out to Ben for making a great module, and including the source too.




Firefox 1.0 Released

Tue, 09 Nov 2004 14:53:00 GMT

Firefox 1.0 has been released today.  Good times.  Right now the link is being hammered, but some peeps at slashdot have posted mirrors.  Btw, here's the default homepage when you install Firefox - hosted on google.com.  Interesting...

Personally, I've been using the moox builds of mozilla, which are the official Firefox builds, but compiled with  optimization flags that hopefully optimize the builds for your particular processor (e.g. the M3 build contain code optimized for SSE2 and the M2 build is optimized for SSE).  I feel it's a little snappier than the regular release and I've been quite happy with it.  The only downfall is that it doesn't include the snazzy installer that you get with the official releases.  Moox already has compiled the optimized Firefox 1.0 bits and posted them on his site.




High Five to the MSDN Folks

Sat, 18 Sep 2004 01:15:00 GMT

I just accidently went to MSDN in IE, and wow!  I say accidently because normally I'm running Firefox and MSDN used to be all jacked up in non-IE browsers.  So, I just got in the habit of using IE for MSDN.  But, my habit slipped and I hit the MSDN page in Firefox.  I had to actually checked to see what browser I was using because I was so surprised to see the MSDN logo, and the bullet points not do crazy stuff.  Good times, good times.

So, I salute you MSDN team and whoever had the guts to say "you know, maybe our website should look OK in something other than IE." 




Hactoring in Real Life

Thu, 12 Aug 2004 21:50:00 GMT

If you haven't checked out the Metasploit Framework yet, check it out.  If you haven't heard of the thing, it's basically a tool for testing exploit code.  But it comes with a bunch of exploits and payloads set up and ready to be ran against machines.  I'm far from a hax0r, but I was able to open up a VNC connection to some random machine in my classroom that hadn't been patched in the last few weeks.  Very impressive.

It's almost like watching actors on TV hacking.  Of course, I'm not advocating using this tool for evil.  But ignoring the thing would be down right silly.  Plus, an up to date copy with the latest exploits sure would make testing things out a lot easier for security type folks.  But for people like myself, it definitely makes you check to see that windows update is set to run automatically




wmdmlog.exe is dirty, dirty spyware

Sun, 11 Jul 2004 20:12:00 GMT

I rarely use IE anymore except to go to my banks site, because I guess their site developers are idiots and can't manage to create a simple four page site that works in Firefox. Anyways, while I'm on their site, I decided to browse on over to some other banks to see how friendly they were to Firefox. I'll repeat that because I think it bares repeating: I'm thinking of switching banks because my bank requires IE. Anyways, I accidently searched for 5/3 (actually, +5/3) in google from IE. When I load the page it briefly displays 5/3 bank at the top, but quickly a "IntelliMover Business Edition 3.5 - 5-Pack - Dell" pops up, along with "Jurlique - 3.5 Hour Relaxation Retreat." Not good times. So I run Spy Boy. I run Adaware. Nothing. Nada. Zilch. So I start going through my processes and BHOs. Nothing out of the ordinary in the processes, but I run across wmdmlog in my process list. I do a search on the ol' web, and I learn that wmdmlog is a support file for Media Player. Let me rephrase that, wmdmlog.dll is a support file for Media Player. Time to die wmdmlog.exe. Sure, enough, problem solved.

What's amazing is that in a given week I probably spend all of 30 minutes in IE, I have a Computer Science degree and am a Microsoft Certified Solutions Developer. I'm not supposed to get his. But somewhere in the past few days, something got loaded up. I guess I can install the XP SP RC, but should I do that on my mom's machine? Probably not.

Anyways, since there are only two results for wmdmlog.exe in google right now, hopefully this post will help other people fight the good fight against the asshats of the spyware world.