Brownsblogging

kelly brownsberger's blog
posts - 71, comments - 18, trackbacks - 0

Sunday, February 14, 2010

Cleaning up after a rough week with Oracle

I had a pretty rough week attempting to get the Oracle client installed on my Windows 7 – 64bit machine.  I’m going resist the temptation to throw stones, but let’s just say it was a frustrating week.

Today I went to the Server Explorer in Visual Studio 2008 to do some work with the ADO.NET Entity Framework.  When attempting to connect the designer to my local SQL Server, I immediately received this

An unexpected error occurred in the Oracle Data Provider for .NET.  Please contact the provider vendor to resolve this problem.

image

Siiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiigh

Even though I’ve uninstalled every trace of Oracle from my machine from the Add/Remove Programs dialog, Oracle seems to have failed to cleanup after itself and it’s still left some damaging residue in my registry.

It took a while and some googling to figure this out, but the solution is to find all occurrences of the following GUID in your Windows registry and delete each one.  I found about 25 of these.  After deleting them all and restarting Visual Studio, it looks like I’m back in business.

D601BB95-E404-4A8E-9F24-5C1A462426CE

posted @ Sunday, February 14, 2010 5:18 PM | Feedback (0) | Filed Under [ visual studio ]

Tuesday, February 09, 2010

Restoring Base Image of my Dell Latitude E6400 from my WHS and NIC driver pangs

My company issued me a new Dell Latitude E6400.  It’s a fine machine, and I like it very much.  Yesterday our system tech hands me the machine brand spanking new with our base company image on it (Windows 7 Enterprise – 64 bit).  My plan was take the image on this machine and copy it to the solid state hard drive that I have in my personal laptop.  I don’t need this Lenovo T61, but it’s got a blazing fast SSD in it and I want to use that – not this old school SATA thing that came w/ my dell.  So my plan was this:

  • Get the machine completely up to date in terms of Windows Updates
  • Install all of the common stuff that I require on all machine.  Basically, all of this stuff, minus the developer tools – this is what I call a “base image” for myself
  • Back up this “base image” to my Windows Home Server – this should give me a restore-able snapshot in time that essentially hardware agnostic.
  • Remove the solid state hard drive from my T61 and install it as my main hard drive on my E6400
  • Restore the base image onto this solid state drive and… presto – new machine running on my solid state hard drive and using my “base image”
  • Install all of my other software, take another backup at that point, and then happily go on about my life

For those of you who are not familiar with Windows Home Server, the above scenario is not magic.  This is a pretty common thing – I’ve done this many times before.

The problem I had today was I could not for the life of me getting the WHS Restore Disk to recognize my network adapter.  I’ve never had this issue before with other machines I’ve restored.  I simply booted up w/ the restore disk, it found the hardware it needed (essentially the NIC and your hard drive(s)) and it just worked.  This time, when I reached the “Detect Hardware” screen, the WHS Restore software couldn’t find my network adapter.  Without connectivity, there’s no way to restore from the WHS.  Luckily, the Restore software gives you the option to insert a USB Flash Drive or Floppy at the Detect Hardware screen.  It will let you provide drivers if you have them.  That’s nice, but you have to find the right drives that will work w/ the Restore software.  I spent several hours last night working on this with no success.  This morning I found the solution.  But first, the things I tried that didn’t work:

  • I put the original hard drive (issued from my company) back in, and cherry picked the drives from C:\Windows, copied them to a USB Flash Drive, rebooted into the Restore software, and let it scan the flash drive.  Result:  Still couldn’t find the NIC
  • With WHS you can “open” an image.  In other words, when I backed up my Dell in bullet 3 above, WHS will let me open this open and copy files from it.  This is a pretty wicked feature.  It essentially creates a mapped drive on the PC you’re using to talk to the WHS, and lets you copy from it.  In my case, it looked like this:
    image 
    So, following the advice in this forum, I tried copying the drivers from this image (because I know those drivers worked w/ this hardware before I got into all this restore stuff).  I did the same copy-to-flash-drive-then-reboot-then-scan-for-drivers dance, the result:  Still couldn’t find the NIC

I gave up for the night.  After a good night’s sleep and mentally shifted back to the basics.  I know the NIC works when running under Window 7 64bit Enterprise.  What’s different now?  Well, it’s not Window 7 64bit Enterprise that’s trying access the NIC, is it?  This is the WHS Restore software.  Ok, what is that?  It’s obviously some tiny little version of Windows.  Then it dawns on me, I’m barking up the wrong tree.  This probably has nothing to do with 64 bit.  I highly doubt this tiny little version of Windows is 64 bit.  It’s most likely a little version of Windows XP if I had to guess.  The Restore disk doesn’t have default drivers for my hardware.  That’s a shame, but it happens from time to time.  And, I’ve been trying to feed this this thing 64 bit drivers, which it doesn’t like.  This forum I referenced early eluded to this a bit by advising to copy both System32 (32 bit drivers) and SysWOW64 (64 bit drivers).  For whatever reason, it didn’t like those drives (32 bit or 64 bit).  I’m guessing it didn’t like them because these are the Windows 7 versions of the drivers.

Here’s what I did to fix this.  According to Dell, my NIC is a Intel 825xx Gigabit Platform LAN Network Device.  I googled around for drivers, and the normal shady sites came up. Then I realized that Dell.com had versions of these drivers for both Win 7 and Win XP/Vista and 32 and 64 bit versions of each.  This supported my theory and made good common sense.  So, I did the following:

I rebooted into the WHS Restore software, let is scan my Flash Drive, and it found one of these drivers!  After loading these drivers it was on my network and it could find my home server.  I’m not sure which driver it ended up loading, but it found one it like and I was able to continue with the restore wizard.  Within 13 minutes, my base image was restored to my solid state hard drive and my company laptop was ready for business.  The problem is solved, but now I’m late for work… gotta get in the shower!

I hope this helps somebody else out there

posted @ Tuesday, February 09, 2010 7:49 AM | Feedback (0) | Filed Under [ tools windows home server ]

Sunday, February 07, 2010

Using Fiddler - No connection could be made because the target machine actively refused it

Fiddler is a great tool for inspecting HTTP traffic.  If you’re building a web services based application or AJAX intensive web application, you’ll need to check this out.  Fiddler has been around for a long time and there’s a lot of good content out on the net about how to use this.  There are several gotchas with this tool – like how it behaves with local addresses (i.e. localhost, 127.0.0.1, etc.).  Be sure to read up on all of that if you’re new to Fiddler.

One lesson I learned today while playing with the latest CTP of ADO.NET Data Services, is disable IPv6 in the Fiddler options.  Having this enabled seems to result in “Connection to localhost failed. Exception Text:  No connection could be made because the target machine actively refused it” errors for local addresses.  Like so:

image

image

Disable IPv6 in the Fiddler options seems to solve this.

image

Looks good now:

image

Hope this helps someone else out there

posted @ Sunday, February 07, 2010 9:58 AM | Feedback (1) | Filed Under [ tools ]

Wednesday, February 03, 2010

Please Vote: ChannelFactory Support in Silverlight

http://silverlight.codeplex.com/WorkItem/View.aspx?WorkItemId=5008&ProjectName=Silverlight

posted @ Wednesday, February 03, 2010 2:05 PM | Feedback (0) |

Monday, February 01, 2010

Deploying ASP.NET MVC Apps to Shared Hosting Providers – Webhost4life.com

Are you getting 404’s on your deployed site when it works perfectly on your development machine?

There’s a number of hidden gotchas when deploying an ASP.NET MVC application to a shared hosting providers.  My provider of choice is Webhost4life.com.  Here’s a list of issues I ran into and the solutions for each.

IIS 6.0 vs IIS 7.0

There’s a number of issues you need to be aware of here.  If you using IIS 6 -- and if you’re on Webhost4life there’s a good chance you are – then you need to make sure you’re virtual directory is configured w/ the “Wildcard application map” ISAPI setup that Phil talks about in his ASP.NET MVC on IIS 6 Walkthrough post.  The short answer is – you have to contact Webhost4life to do this.  As of this writing, this is not available through their Control Panel.

MVC Binaries

As of this writing, Webhost4life.com does not have ASP.NET MVC installed on their servers and therefore none of the assemblies are installed in the GAC.  At a minimum, you need to bin deploy System.Web.Mvc.dll assembly.  Follow the instructions from Phil on how to do this in his post Bin Deploying ASP.NET MVC – the abbreviated version is:  mark the references to MVC assemblies in your project as CopyLocal=true.

Route Setup

Make sure that your routes our setup in a way that jives with your domain.  In other words, make sure that http://www.yourdomain.com/ will go to the proper route.  This is easy to overlook since your Startup Page in Visual Studio is set to something like /Site/Home while debugging. However, this isn’t how people are going to navigate to your site on your hosting provider.  In my case I setup routes with the code below.  This allows folks coming into my site via http://yourdomain.com and http://yourdomain.com/Site/Home to all end up in the same place

    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute("Default", "{controller}/{action}/{id}",  new { controller = "Site", action = "Home", id = "" });
            routes.MapRoute("Root", "", new { controller = "Site", action = "Home", id = "" } );
        }

        protected void Application_Start()
        {
            Global.RuntimeSettings = new RuntimeSettings {MachineName = base.Context.Server.MachineName};
            RegisterRoutes(RouteTable.Routes);
        }
    }

Link Round Up

Here’s a list of things I found helpful when debugging this stuff

posted @ Monday, February 01, 2010 6:18 AM | Feedback (0) | Filed Under [ .net ]

Thursday, January 14, 2010

Using XPath to select nodes with a missing attribute

The only thing worse than my XPath skills are my RegEx skills.  I don’t use XPath all that much these days, but today I needed to.  It took me a while to find a code sample that does this.  After a playing a bit with SnippetCompiler, I found the solution:

 

StringBuilder builder = new StringBuilder();
builder.AppendLine("<foo>");
builder.AppendLine("<bar baz=\"a\">1</bar>");
builder.AppendLine("<bar>2</bar>");
builder.AppendLine("<bar baz=\"b\">3</bar>");
builder.AppendLine("<bar>4</bar>");
builder.AppendLine("<bar baz=\"c\">5</bar>");
builder.AppendLine("</foo>");

XmlDocument doc = new XmlDocument();
doc.LoadXml(builder.ToString());

XmlNodeList nodes = doc.SelectNodes("//foo/bar[not(@baz)]");

if ( nodes == null )
{
    WL("nodes was null");
}
else
{
    foreach ( XmlNode node in nodes )
    {
        WL("Node: " + node.InnerText);
    }
}

 

 

image 

image

posted @ Thursday, January 14, 2010 8:05 PM | Feedback (0) | Filed Under [ cheatsheet development ]

Wednesday, January 06, 2010

Mix10 @ Las Vegas (March 15 – 17)

Registration is up, and I have my fingers crossed that my company will be able to send me this year.  Here’s the sessions that look interesting to me:

posted @ Wednesday, January 06, 2010 12:59 PM | Feedback (0) | Filed Under [ microsoft ]

Thursday, December 10, 2009

ASP.NET MVC - Unhandled Error in Silverlight Application Code: 2104

I’m creating a simple ASP.NET MVC application and on first run I’m getting blasted with this:

image

Google didn’t turn up the solution as fast as I would have liked, so I thought I’d post it here for the next fool to find :)

Solution:

When you add a Silverlight project to a solution, Visual Studio will ask you if you would like to create new web site to host it, or choose an existing one in your solution.  I choose an existing one.  By default, Visual Studio creates this in your HTML markup to host a Silverlight application:

    <div id="silverlight">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2">
                
          <param name="source" value="ClientBin/MySilverlightApp.xap"/>
          <param name="onError" value="onSilverlightError" />
          <param name="background" value="white" />
          <param name="minRuntimeVersion" value="3.0.40624.0" />
          <param name="autoUpgrade" value="true" />
          <param name="initParams" value="page=UserRegistrationView" />

          <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
               <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
          </a>
          
        </object>
        
        <iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
    </div>

 

Visual Studio does not account for the URL rewriting that comes with MVC and by default the path to xap file is wrong.  Change the source parameter to be rooted like so:

          <param name="source" value="/ClientBin/MySilverlightApp.xap"/>

 

One simple slash should fix your problem.  Hope this helps someone else (you’re not a fool :)

posted @ Thursday, December 10, 2009 6:52 PM | Feedback (0) | Filed Under [ silverlight ]

Wednesday, December 09, 2009

How to change an IIS application’s AppPool in IIS 6.1 (Windows 7)

I find Internet Information Services (IIS) Manager v6.1 that ships with Windows 7 extremely difficult to use.  It’s good looking, but the usability is terrible.  I can never find what I’m looking for.

I installed DotNetNuke this morning and wanted to play around.  For the life of me I could not find where to change the application’s App Pool.  This is very straightforward in previous versions, but this seems very hidden to me in v6.1.  The only way I found to do it is to click on the “Basic Settings” in the Actions panel on the far right:

image

From there, you get a familiar dialog

image

Wow that was frustrating.  I was literally spent 30 minutes hunting through the help file and Google’ing but found nothing.  I really wish I could have the old IIS Manager back.  Ever since Vista, this thing has been impossible to use :(

posted @ Wednesday, December 09, 2009 6:26 AM | Feedback (0) | Filed Under [ windows ]

Monday, November 23, 2009

Debugging Silverlight with Silverlight Spy

The debugging experience in Silverlight project using Visual Studio is quite good.  However, there are two things that is doesn’t help much with:  when data bindings don’t work, and when your XAML doesn’t look like you think it should.  Here’s a post about debugging data bindings.  The visual part is a little more involved.  Yes, yes Expression Blend has a nice visual designer, but it’s fairly common for Blend to show a piece of XAML in one way and for it to actually render in the browser differently (sometime significantly differently).  Today I found First Floor Software’s Silverlight Spy.  This appears to be a pretty awesome diagnostics tool that allows you to see and alter Silverlight’s Visual Tree at runtime side by side an embedded browser.

image

You can edit the Visual Studio within Silverlight Spy and see the rendered content change immediately.  This is extremely useful.  This is to Silverlight apps what Firebug is to web apps.

If this is still useful at the end of the trial period, I’ll be buying a copy of this for myself.

posted @ Monday, November 23, 2009 12:47 PM | Feedback (0) | Filed Under [ silverlight ]

Powered by: