ShowUsYour<Blog>
Irregular expressions regularly
-
More on privates...
< Snip />
-
Reader as a performer
Here's a link to my latest ramblings about consuming version 1.1 generated assemblies from version 1.
-
Able to work with structs
-
Doing things hueristically
Okay, before you read this, you might just like to wind-down a bit by doing some small limbering excercises:
- First roll your head from side-to-side - ONE,.... TWO,.... (ouch!) .... THREE
- Next, roll your shoulders from side-to-side - ONE,.... TWO,.... .... THREE
- Finally, interlock your fingers with your palms facing outward and stretch your arms out in front of you.
Right, that's better, nice-n-relaxed, now for my piece:
The other day I mentioned about a problem that I encountered while trying to consume an assembly which had been compiled using Visual Studio .NET 2003 in an application that I was writing with Visual Studio .NET 2002.
As we all know, assemblies are fully self-describing, which means that information about all Types that are required by the application is included in the assemblies manifest.
Probing
When the application is first run, the .NET runtime goes about the task of building the assembly on the local machine. To do this it reads through the manifest a bit like a factory worker running through a stock picking list...
- "Lemme see now", - [checks order list]
- "I'm gonna need one System.Xml, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
- "I know where that is, it's in the application \Bin\System.Xml folder", scratches head, and looks around...
- "That's right, we moved 'em over to the application \Bin", scratches head again...
- "Oh, now I remember, the boss asked us to shift 'em across to C:/WINDOWS/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/"... still scratching head...
Anyways, that process continues and the runtime "probes" through several more "known" paths until it decides that it cannot locate that particular assembly. At that point it throws it's hands in the air, raises an exception and cries out:
"File or assembly name System.Xml, or one of its dependencies, was not found."
Visual Studio .NET
If you are using Visual Studio .NET 2002 crank it up and add the System.Xml assembly to the local references of a Project. Done it? Good!
Now right click on that assembly at view its properties. Note the Identity property - System.Xml - and the version - 1.0.3300.0. Note the version number is different to the version number that we probed for (1.0.5000.0)!
The Runtime and probing again
Notice the 3rd path that our ficticious factory worker took when trying to locate the assembly? He looked in the version folder that the assembly had been built with "v1.0.3705". It's important to note that Assemblies built with VS.NET 2002 will always probe via that path and the Framework does not install version 1.1 copy of the System.Xml assembly into that path. Assemblies built with VS.NET 2003 on the other hand will always probe via the correct, known path. After all, they installed it, they should know where it is, right? And how could version 1 of the framework possibly have known where version 1.1 would install it's files - version 1.1 hadn't even been invented back then!
Binding redirects
Fortunately you can tell the runtime where to look for a particular assembly by placing the redirect details into the configuration file for your application. Here is the redirect information that is required if you tried the ConeOfSilence challenge the other day...
-
Lawful Good Elf Bard Ranger
-
More WinForms blues to sing about
Windows Forms are great! The reason that I've started to use them over Web Forms is because of the rich controls that they support. You can also easily build in cool functionality such as the drag-n-drop support that Duncan displayed in his latest article - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncodefun/html/code4fun02282003.asp
-
Email validation - Part 1 : DEFINING A RECIPIENT
After stumbling across the RFC 2822 e-mail spec I thought that I'd take a shot at defining an e-mail address and along the way attempt to create a regex to validate it. I'll attempt it over the next week or so, so, bear with me:
-
Team Development Guide
[ per ScottW ]
-
Your mission, should yoo choose to accept it...
The other day I posted a piece about a problem I had consuming an assembly in ASP.NET Version 1 that had been built with Version 1.1. I also offered some links to information that explained how to solve the problem.
-
I am the Framework. I run managed code. I am without flaw. (repost)
Had an interesting experience today; a friend sent me an assembly and asked me to check it out. I referenced the assembly in my application and starting writing some elite code that consumed it. Project compiled fine but when I executed the app. it blew up and complained that assemblies couldn't be found - System.Xml in particular.