Subversion Global Ignore Pattern

I’m slowly building up this default Subversion global ignore pattern for my Windows & Xamarin Development on Windows & OSX.  Nothing too fancy but I’m going to keep this one up to date so others may find this useful as a default pattern or as a base for their specific requirements.

*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo __pycache__ *.rej *~ #*# .#* .*.swp .DS_Store *bin *obj *_ReSharper.* *.user *.suo *.pdb *.svn *_dotCover.* *_TeamCity.* *.vs *.psess *.vsp *.vspx *.userprefs
Share

OSX & Parallels Visual Studio Debugging – F11 / F12

If like me your using Parallels on a mac for your development you’ll find that debugging can be a pain in the ass.  Lots of the keyboard shorcuts you use on a regular basis in Windows needs a bit of configuring in OSX in order to get them to work correctly.

I use the function keys a lot so the first task is to get the function keys to work as function keys, this will be applied in OSX as well as any VMs you’re running.

In OSX go Apple -> System Preferences -> Keyboard and select the Keyboard page, make sure the following option is checked:

“Use all F1, F2, etc. keys as standard function keys”

With that option set all the nice little Apple functions need to be accessed using “fn + F8”, the default is great for casual users and pain for anyone else.  Anyway …

Next you need to remove the default functions for the F11 and F12 keys so that OSX doesn’t “intercept” the key press and do it’s function rather than letting that make it’s way to Parallels and then consequently your Windows Vm.  So swith to the “Keyboard shortcuts” page and make sure the following two options are deselected:

“Show Desktop – F11”

“Show Dashboard – F12”

Now you should be able to use these keys as you would F11 and F12 in Windows.  Yay.  I don’t understand why F12 is still mapped by default to show the dashboard in OSX considering it’s fairly unused these days.

Anyway, happy debugging!

Share

MEF, IoC & Visual Studio Suppress Compiler Warnings

If you’re even slightly like me I’m a bit anal about my build processes and codebase.  I like to switch on “Treat warnings as errors” in my builds.  Yes that can be a pain but like StyleCop it can have it’s advantages as well.  I don’t use StyleCop much as I prefer to use Resharper which can provide a lot of the same benefits without the pain.

Anyway, if you use a lot of dependency injection (IoC) or Managed Extensibility Framework (MEF) kinda trickery then you’ll get lots of 0649 errors like:


[Import]
private IDateService _dateService;

"Field '_dateService' is never assigned to, and will always have its default value null"

Well … NO, it won’t thank you very much.  Anyway, cut to the chase, do this …


#pragma warning disable 0649
[Import]
private IDateService _dateService;
#pragma warning restore 0649

Nice.  This works with any error code BTW.  I’ve seen some people just suggest to make the fields public which frankly outrageous, anyone working on my team that wants to design their code around damn compiler warnings can find another job as far as I’m concerned.

Share