Category Archives: english

All the posts written in English

Migrating a Visual Studio 2005 Guidance Package to Visual Studio 2010

Visual Studio 2010 has brought the concept of extensions, a brand new set of tools to extend and adapt the software to the needs of each developer.  This is great for Visual Studio users, for having a shiny new Gallery with lots of extensions, but also for addin developers as it makes the development process much easier.

But how about Guidance Automation (the way to go in extending Visual Studio 2005 and 2008)? To have all those guidance packages out there Microsoft released Guidance Automation Extensions and Guidance Automation Toolkit 2010, that allows to building and deploying existing projects as a VSIX package in Visual Studio 2010. But putting an existing guidance package to work in Visual Studio 2010 isn’t a seamless process and requires to migrate it manually, described thoroughly in this guide:

How to Update a Visual Studio 2008 Guidance Package to Visual Studio 2010

Although it’s aimed for Visual Studio 2008 guidance packages it also works for 2005, even if not out of the box. The main glitch is in step 4d while running the UpdateGuidancePackageToVSIX recipe: it won’t update the Version and PublicKeyToken of .vstemplate files because it expects a different version of the Microsoft.Practices.RecipeFramework.VisualStudio assembly, we must edit the WizardExtension element in all .vstemplate files manually (or replace in all files using a an editor like Notepad++) so in the end it each of them looks like this:

<WizardExtension>

<Assembly>

Microsoft.Practices.RecipeFramework.VisualStudio, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

</Assembly>

<FullClassName>

Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate

</FullClassName>

</WizardExtension>

Along the process some other issues might happen that could make the migrate more complicated:

  • The classes of namespace Microsoft.Practices.WizardFramework.Configuration exist in two assemblies (Microsoft.Practices.WizardFramework and Microsoft.Practices.RecipeFramework.VisualStudio) and if any of these classes is used we’ll have to use an extern alias to resolve the ambiguity,
  • If “The “GenerateMenuResource” task failed unexpectedly (…)” happens double check that the properties of each .vstemplate file are set to Build Action=Content , Copy To Output Directory=Copy if newer, Include in VSIX=True and also that there aren’t any .vstemplate files not included in the project (either include or delete them).

Sent from my iPhone/Droid/BlackBerry/(…)

Photo by catherinemariegriffin

People are  disliking the “Sent from my iPhone/Droid/BlackBerry/put-mobile-device-here”, myself included, because they’re obnoxious and have no real use. And the truth is when you read it the real meaning to what the sender is saying is either:

  1. Hey, I got a brand new iPhone/Droid/BlackBerry/put-mobile-device-here!! (this is the default from most device manufacturers)
  2. You’re not important enough for me to write a proper response to your email

So what’s yours?

Toodledo Web App for Google Chrome

Use Toodledo as your to-do list? Are you already using a Google Chrome’s development build with support for Web Apps (if you want to know how to do it read this first)? Now you can add Toodledo Web App for your Google Chrome.

Download it here!

15 Facts About Net Neutrality

15 Facts About Net Neutrality [Read Write Web]

What does mean loosing Net Neutrality

via reddit

Block noise with noise

Noise is a huge issue at workplace, the modern trend of open-space offices too often means you end up having a noisy environment. Some people deal with noise much better than others, but unfortunately I’m not one of them and usually I’ve a fair amount of time, and money, searching for the best way to block, trying several combinations of noise isolating headphones and earplugs with different kinds of music.

Amazingly, at least for me, one of the most effective methods I’ve found was using a white-noise generator, and the theory is simple: our brain can easily filter and ignore flat, constant sounds (like a fan working in the same room or rain pouring outside). I ended up using SimplyNoise, a real simple web-based generator that plays white noise, pink noise and brown noise (more on noise colors here) with a few other tweaks. Usually work better with the more “rain-ish” sound brown noise.

Injecting properties in Ninject 2 without “[Inject]” attribute

Dependency Injection is a great way to remove dependencies while having an lightweight container (a “service locator”) wiring up the application’s components and resolving instances and relationships. But Ninject, one of the dependency injection solutions for .Net, adds another unwanted dependency: to the container itself.
A dependency to Ninject is needed when initializing the container and obtaining entities, although the latest can be minimized using the Common Service Locator library to create an abstraction to most of the currently available dependency injection implementations. But Ninject also adds a dependency to the classes that will be initialized by the container, this is not desired and should be avoided at all cost and these classes shouldn’t be aware how they’ll be instantiated.
Ninject defines an attribute (Inject) used as an hint by the Ninject kernel to know where to inject the instantiated objects; although this attribute is optional for Constructor Injection is mandatory for Property Injection and Method Injection.

// My class where Ninject
// will create and inject
// an instance of IWeapon
public class Samurai
{
    //  This is a Ninject attribute,
    //  if we switch to another
    //  DI container the code will break
    [Inject]
    public IWeapon Context { get; set; }
}

Fortunately Ninject is highly customizable and allows to change that behavior, the plan is to create a custom attribute and configure it so that Ninject can use it the same way it uses the Inject attribute. The usage will be similar but all the dependencies will be to local classes, the custom attribute can be something as simple as this:

public class InjectHereAttribute : Attribute
{
}

The class will now look like this:

public class Samurai
{
    //  Now there's no external dependency,
    //
    //
    [InjectHere]
    public IWeapon Context { get; set; }
}

Now Ninject must be configured to use the custom attribute, this can be done by creating an implementation of IInjectionHeuristic that recognizes the custom attribute:

public class CustomInjectionHeuristic : NinjectComponent, IInjectionHeuristic, INinjectComponent, IDisposable
{
    public new bool ShouldInject(MemberInfo member)
    {
        return member.IsDefined(
          typeof(InjectHereAttribute),
          true);
    }
}

And finally add this behavior to the Ninject Kernel using the Components collection, it will run along the existing components, namely the default implementation of IInjectionHeuristic, which means either the default or the custom attribute can be used.


// Add custom inject heuristic
kernel.Components.Add<IInjectionHeuristic, CustomInjectionHeuristic>();

Avoid social noise in your timeline

Lately I’ve been growing a “pet hatred” towards applications that automatically post updates to Twitter or Facebook, specially those that do it often, I’m thinking in “I’m in [some place]” kind of posts of location-based services like Gowalla and Foursquare or the “Just listened to [some song]” updates of media players, just to name a few. The problem with these updates is that there’s no added value, nothing really relevant to share; while sometimes generated updates are useful, posting blog updates is the best example, in most cases a automated tool can’t add content, can’t share what’s so cool about that song or place, can’t share the context for that update. This often means a noisy timeline that people want to avoid and that’s why automated update services should be used sparingly, prefer sharing items explicitly and really sharing something rather that dumping stuff the timeline.

My current photographic to-buy list

[Update] Only one more to go!

I’m waaay over my budget for photographic gear this year, with a handful of new cameras and lenses bought recently, but I still have some “special needs” I need to take care of.

  1. A light, portable and yet relatively sturdy tripod – I’m not a real nature photographer so I don’t want a “put any kind of lens with any camera, whatever the weight, whatever the weather conditions” tripod, I’m thinking in those neat carbon fiber Induro’s, I keep hearing good things about them. A brand new Induro tripod with an Novoflex head, a light tripod with a very compact and solid ballhead.
  2. A photographic monitor – Nuff said, a bigger monitor that uses an LCD technology with full color reproduction. A new monitor is on its way.
  3. Some kind of centralized storage, other than external hard disks, to have a bullet-proof backup strategy of my photos and the rest of my documents; something with redundant storage and smart enough to automatically back them up to my online storage, and certainly not a Drobo: I tend to avoid solutions using proprietary formats.

52 Photographic Projects

Kevin Meredith (a.k.a. lomokev), one of the most original photographers of the flickr universe and a favorite of mine, has a new book about to hit the shelves. It’s called 52 Photographic Projects and it contains, you guessed, 52 techniques to try out with lots of good photos to look at, judging by Kevin’s gallery I bet the book is full of cool ideas (it’s already on my wishlist).

And the best thing is you can browse it below, almost all of it! Although you may not have time to read the small print.

52 Photographic Projects [Kevin Meredith]

Switch to our mobile site