Posts

Using WCF with non-microsoft clients

The default wsdl that WCF creates isn't very friendly for human's and other non-microsoft clients to read. To remedy this you can intsall WCFExtras: http://wcfextras.codeplex.com/ To use it, in your endpoint declaration add a " behaviorConfiguration " element with a name something like " WsdlRedirect ". Then add an endpointBehaviors declaration something like this:       < behaviors >        < endpointBehaviors >          < behavior name =" WsdlRedirect " >            < wsdlExtensions location =" https://testwebservices.website.ca/SomeService.svc "                            singleFile =" True " / >          < / behavior >   ...

"An attempt was made to load a program with an incorrect format.” in IIS 7

Was working on an old website dev region that hadn't been used since we upgraded to IIS 7 and a 64-bit web server, and was getting this error: "An attempt was made to load a program with an incorrect format."   After some research I found the answer here: http://stackoverflow.com/questions/41449/i-get-a-an-attempt-was-made-to-load-a-program-with-an-incorrect-format-error-o The solution that worked for me was to enable 32-bit applications in the AppPool.

Apple iPad Facebook crash

My wife likes Apple she has an iPhone and she wanted something like the iPhone except a little bigger so she could manage her business social media content easier. So we got her a first generation iPad. It worked great until she went to share a link in Facebook using Safari and it would crash.  The crash log said it was a memory issue.  I did some research and tried the "disable all the iCloud stuff" and the problem continued.  Then I discovered this is a problem that started in Sep 2012 and it even happens with the newer iPad's so it can't be a memory problem. It is a problem with Safari on Facebook. So I tried a bunch of other browser's like Dolphin, and Opera and still the same problem.   Finally was about to start selling her on an Android tablet when didn't I find a fix.  Almost sort of wished I hadn't found a fix because I like Android. It's what I have for my phone. But here it is: the Atomic Lite browser(or pay for the full blown ve...

Visual Studio 2010 with TFS can't edit source code

Once in a while when I open a project in Visual Studio and get latest version of source from TFS and I go to type in a source code file it will not auto check out and will not let me type anything.  The quickest way I have discovered to fix this is to click on another source code tab(or open another source code file if there is only one tab available) then go back to the original source code and you should be able to start typing.

Viewstate MAC failed

When you deploy your ASP.NET website to production you may get an error saying the "Viewstate MAC failed" This happens if your production environment is a web farm.  To fix it you need to add a machineKey entry to the system.web section of your web.config as described here by jnet: http://www.nopcommerce.com/boards/t/9548/system-logs-what-does-the-error-mean-.aspx

How to fix branches in TFS after an upgrade

We upgraded our TFS servers to 2010 but our branch information was lost. Fortunately +Richard Banks  provided an excellent post on how to rectify the situation.  You can read all about it here: Richard Banks - Agile and .NET: How To Fix Branches After Migration to TFS2010

.NET Enums

Image
I like Enum . I love how you can define an Enum like this: Enum ColorType Red Green Blue End Enum Then use it as a parameter type like this: Public Sub ProcessColor(color As ColorType ) End Sub And when you go to use it in a method you get intellisense like this: Every so often I come across a data model that uses strings to signify types. Like an 'R' for Red and 'G' for Green and a 'B' for Blue. I would love to use my good friend Enum  and go: Enum ColorType Red = "R" Green = "G" Blue = "B" End Enum But unfortunately this is not possible.  If you are like me and wish you could do this please go here:  http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2161129-string-enum-for-both-c-and-vb  and Vote now. Until we get enough votes to get this implemented my current favorite alternativ...