haacked / Encourage

A bit of encouragment added to Visual Studio
75 stars 32 forks source link

Fixes 2012 + 2013 support #10

Closed jaredpar closed 10 years ago

jaredpar commented 10 years ago

This fixes a couple of issues around the ability for Encourage to support Visual Studio 2012 and 2013

The first issue is updating the manifest file to include support for both versions. This is straight forward and just includes adding the necessary version numbers to source.extension.manifest.

The second is around ensuring the VSIX is built correctly. The previous solution reference all of the SDK DLLs using a weak name. This allowed them to bind equally well to 2012 and 2013 SDK versions of the DLLs. This works great if only 2012 or 2013 is installed on the machine. This is a problem however if both are installed.

When both 2012 and 2013 are installed the DLLs in the 2013 SDK are preferred over those in the 2012 SDK in MsBuild. The weak naming provides no preference between the two choices and hence the 2013 SDK wins. This means that building Encourage in 2012 would bind to the 2013 SDK which is wrong. We need Encourage to always bind to the 2012 SDK (else it will fail to load in VS 2012).

Fixing this comes in 2 parts

  1. Use a strong name reference for the SDK DLLs. This prevents accidental binding to future versions of the SDK. The build will bind to the 2012 SDK assemblies or it will fail.
  2. Include the reference assemblies in the depot. This allows us to build no matter which version of Visual Studio is installed.

I tested this setup on machines with 2012 only, 2013 only and 2012 + 2013. Building and running from source worked on all 3 machines. I also took a build from the 2012 + 2013 machine and installed it from VSIX on the other two. Worked in all cases. If you want to play around with the built VSIX before uploading it's available here

https://onedrive.live.com/?cid=3B71B08E0FE95FC7&id=3B71B08E0FE95FC7%21128

CC'd @jbubriski

haacked commented 10 years ago

So if I build on my VS 2013 machine only and upload it, will that be fine? Or do I need to build it from a machine with both?

jaredpar commented 10 years ago

@Haacked it will work fine if built on a 2013 only machine.