Perfil de PaulioIT BytesBlogListasScraps Ferramentas Ajuda

Blog


26 de junho

Cross Domain Policy file gotcha on a development environment

I hit a little gotcha today when using Silverlight to talk to a Service. My solution has a separate web and wcf projects. So, without thinking, it didn't suprise me that the Silverlight app running in the web site moaned about security when trying to talk to the service (http://projects.nikhilk.net/WebDevHelper is a great add-in for IE if you want to inspect the http requests on a development machine). So I placed a clientaccesspolicy.xml in the service and everything worked fine. Later it struck me that in this instance (for various reasons) the service should actually exist in the web site rather than a separate project. So I moved the service over and didn't bother to move the policy file, after all I will no longer be going cross-domain. So I was initially puzzled as to why I was getting the security faults again. The problem stems from my use of a virtual directory on my dev machine. So my web site is at something like; myBox.myCompany.com/devSite/default.aspx. However, when Silverlight looks for the domain policy it looks for at the root of the domain so; myBox.myCompany.com and unsurprisingly it cannot find the policy file there. So I just had to copy the file to the root of default site and everything was fine.
23 de junho

MacBook with broken case...fixed!

My little white MacBook has been through the wars...well not really. I look after it very well, so I was very angry with the case started to split apart. Also about the same time the machine would often refuse to go to sleep and would sometimes just switch off with no warning. All of which seemed to be down to the Bluetooth module playing up. Basically it was looking like time for the knackers yard for this little PC. So it was with some interest that a collegue told me that Apple had actually admitted that the case problem was a design fault and would fix it out-of-warranty. So after a long, if polite, conversation with Apple Support (complete with dictating various Forum URLs saying about Apple relenting) they gave me a ticket number and a number to call for repair. When I took it in I asked if they could check that the Bluetooth module was correctly seated. Today I got the Macbook back complete with new case part AND a new bluetooth module, which was nice. So far the machine seems to working as good as new. So for once, thank you Apple for making me feel like you actually care about your customers. Thanks again, keep up the good work.


"Bad class token" when running (N) unit tests with TypeMock

Had a strange problem today, some of the automated build tests were failing with "Bad class token". However, when I went onto the build machine and ran them via NUnit GUI they worked fine. The difference is that we'd normally run the tests via Type Mock to ensure all the mocks work correctly. When I ran NUnit GUI via TypeMock the tests would fail...well actually sometimes they'd work, sometimes they wouldn't. Yes that's a lovely position to be in <gulp>. The obvious cause to these problems was that I'd just upgraded Visual Studio 2008 to SP1. So I manually rebuilt the whole solution and everything seemed to spring back to life again. Odd problem but hopefully now someone else won't have to sit around scratching their head like I had to!
 
[Edit]
I blogged too soon. Turns out I still have the problem, but only with automated builds, if I build by hand (on the build server) then everything runs fine...weird.

[Edit]
Turns out I "just" needed to upgrade TypeMock to the latest version.
 

22 de junho

How to add a Silverlight project to an existing Web Project

Whenever you play with Silverlight via Visual Studio you soon learn about the link between the Silverlight application and the web site's ClientBin folder. However, what happens if you already have a web site project and want to add a new (or existing) Silverlight project to it? Well you either manually copy the xap over after every build (no thanks) or just go the web site's properties and select the Silverlight tab and add your project to it. Easy...I hope that's not tempting fate.
06 de junho

How to make Vista shutdown when you press the big “off” button

I finally cracked today and had to find out how to change Vista’s default go-to-sleep when you press what looks like the off icon. I’d dismissed the Power Options because when it talks about the, “power button” it literally means the physical power button. However, if you customize the power options and select advanced you can change it…

image

The button then goes a very dark red.