Memoization using generics – Part 2
This is Part 2 of my series on Memoization. In Part 1 I described the basic principles behind memoization, and showed some examples on how to create an effective generic method to do memoization of methods with zero and one parameter. In this post I will show how to do memoization of methods with two parameters
Patching or updating a single dll in a release
Ever had the need to update a release with a minor change to one dll? These steps allow you to update a single dll in a installation from msi etc. Note that all steps are necessary to avoid problems with mismatch in dll references, manifests etc. Trying to update a single dll without these steps normally results in the following error:
Could not load file or assembly MyAssembly, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
To avoid these kind of problems you have to make sure your dll's have the correct versions, and that all references are to the correct versions of all the assemblies (Normal problem whene using "1.0.*" as AssemblyVersion"
- Open you Visual Studio solution for the point of the release or todays date if there are no or few changes in the dll you want to update.
- Add you fix or change to your source code
- Go to references in the project you want to update (called project A)
- Delete all the references to projects in your solution (remember the names)
- Copy the same dll's from step 3 som programfiles or wherever you have the release installed. Copy the dll's to the bin/release folder of project A.
Missing designer support for XAML and WPF in Visual Studio
Today I came across the following error opening a WPF XAML file in Visual Studio:
There is no editor available for 'xxx'. Make sure the application for the file type (.xaml) is installed
You could get the same kind of error for aspx:
There is no editor available for 'xxx'. Make sure the application for the file type (.asxp) is installed
I tried upgrading to Service Pack 1 of Visual Studio, but it didn't help at all! For some strange reason there seems to be some VSPacakges that suddenly got a SkipLoading tag. You can easily solve this through the Visual Studio command prompt by typing:
devenv /resetskippkgs
This clears all SkipLoading tags added to VSPackages, normally added by users wanting to avoid loading problem VSPackages.
ISA Server error
Struggled with following error yesterday:
Error
The request failed with HTTP status 407: Proxy Authentication Required (The ISA Server requires authorization to fulfill the request. Access to th Web Proxy filter is denied)
Double-clicking Visual Studio solution files in Windows 7
I guess I am not the only one annoyed by the fact that I could not open Visual Studio by double-clicking a solution file. Finally I looked into this problem and first found a simple, but not satisfying solution:
By setting Visual Studio to not run as an administrator. But if you ever tried running Visual Studio on Windows 7 without admin rights, you know this is not a satisfying solution!
Memoization using generics and lambda expressions
Memoization is a hidden treasure of programming techniques. Most developers has a good understanding of caching and use it to optimize queries, but why even do calculations on cached or live data, when you don’t need to calculate at all?
Adding C# and ASP.Net code to Blogger
Many developers ask, how can I paste C# code in my blog? I have looked into several ways of doing this, my verdict: Use Windows Live Writer!
