haacked / Encourage

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

Makes the project compatible with 2012 #8

Closed jbubriski closed 10 years ago

jbubriski commented 10 years ago

I just changed all the refs to version "12.0" to "11.0". Seems like it works fine in 2012 now, but I don't have 2013 to test with to make sure it still works there.

If this isn't a good way to do this, is there a better way to manage extensions across different versions of VS? A separate project for each version with the files linked in? Just thinking out loud.

Thanks, John Bubriski

jbubriski commented 10 years ago

Thanks @jaredpar, I've made that change.

madskristensen commented 10 years ago

That's similar to what I tried, but I couldn't make it work

jbubriski commented 10 years ago

Did this work with 2013 for you? Unfortunately, I don't have 2013 handy to test with. I'll later if I can.

madskristensen commented 10 years ago

no, it would break in VS2013 if I moved the dll versions to 11, and it would break in VS2012 if I kept them at version 12.

jaredpar commented 10 years ago

Moving the DLL versions to 11.0 should be fine here. All of these DLLs are in the supported / versioned SDK. Hence the 11.0 versions will work in either.

This does create a build time issue. You won't be able to build in 2013 unless the 2012 SDK is installed. Or more simply just copy the reference DLLs into the repository. The latter is how I keep VsVim usable in every version of VS (2010 and beyond)

jbubriski commented 10 years ago

I'll defer to you guys on this one since you're experience with this is way above mine. Should we:

madskristensen commented 10 years ago

Something else. This won't work. You can create 2 separate VSIX - one for 2012 and one for 2013. That would be easy, but slightly annoying.

You should set the min vs version property to $(VisualStudioVersion) instead of "11".

jaredpar commented 10 years ago

@madskristensen can u elaborate on what u feel won't work? Having a fully round trippable VSIX project (both project file and constructed VSIX) is doable and fairly easy to maintain.

madskristensen commented 10 years ago

that part is easy, it's the part where the same .vsix generated would work on both VS 2012 and 2013 that's the issue

haacked commented 10 years ago

I don't have VS 2012 installed. Will any solution work for me? Or if we make this roundtrippable will I be required to install 2012 SDK?

jaredpar commented 10 years ago

@madskristensen usually that is the easy part (the project file can be quite frustrating) . Unless I'm missing one all of the dlls used here are properly versioned. Sure 2013 doesn't install the 11.0 assemblies but it does include the proper redirects in the app.config file.

jaredpar commented 10 years ago

@haacked to really test this u need a Machine that has only 2012 or 2013 installed. With both u can get false positives because of the existence of the DLLs in the GAC. I have a few VMs setup that I use for this type of testing. I'll give them a roll this weekend.

haacked commented 10 years ago

@jaredpar but in theory it's possible? I defer to you on this one. :smile:

jaredpar commented 10 years ago

@haacked it's definitely possible and not just in theory. VsVim has one code base which is editable in 2010-2013 and produces a single VSIX that loads in all of them as well.

I actually wrote a sample github repo that demos commit by commit how to get from the default VSIX project to this state

https://github.com/jaredpar/RoundTripVSIX

It's a pain to get there but once you're there it's rather easy to maintain.

haacked commented 10 years ago

@jaredpar ah cool! And just to be clear, it's editable in VS 2013 without VS 2012 installed, right?

Also, are you volunteering to do this for Encourage? Or suggesting the author of this pull request do it?

jaredpar commented 10 years ago

@haacked that's correct. Will work with just a single version of VS installed.

This PR should actually be correct. I was going to fire up a VM later this weekend and double check. If there are any issues though then I will clean it up.

jbubriski commented 10 years ago

I just tested on a Windows 8 VM with only VS 2013, and the 2013 SDK. I just had to fix a single strong reference and it seems to builds/run great. I haven't tested that latest change on a VS 2012 only machine yet. I'll do that Monday if someone else doesn't beat me to it.

jbubriski commented 10 years ago

Just tested on my VS 2012/2012 SDK machine. Seems to work great. What's the next step? Someone else test it?

jaredpar commented 10 years ago

@jbubriski have you tested it on a machine with only 2013 installed? I'm pretty sure in it's current state it will not build. The references specify the 2012 assemblies which won't be present in that case.

To fix this we need to check in the reference assemblies for 2012. Essentially it needs to mirror this change

https://github.com/jaredpar/RoundTripVSIX/commit/12003ab6a13c2fa3d017863f2f11496b7cb04425

Note: I'm finally back from vacation and was planning on testing this out this morning. Unfortunately I found I deleted my old VMS for this. In the process of recreating them in azure. So later today I will be in a state to try this out

jbubriski commented 10 years ago

I did test on a machine that had 2013... it may be possible I had upgraded a while back...

jaredpar commented 10 years ago

I verified that @jbubriski is indeed correct and works on machines with only 2012 or only 2013 installed.

My confusion about whether or not reference assemblies needed to be checked in stemmed from my personal practice of always referencing the editor DLLs with strong names (makes it much easier to detect certain kinds of versioning breaks). This change explicitly removed the strong name and hence it will freely bind to whichever version of the SDK is installed. This removes the need for reference assemblies to be checked in.

There is some risk with this change that a 2012 build will bind to 2013 assemblies on a machine with both installed. That risk is fairly low though (enough to be ignored). If it becomes an issue I can fix that up.

Sorry for the delay in verifying this. I usually have a couple of 2012 / 2013 only VMs handy to do this work but forgot my main VM box recently died. Took me a few minutes to rebuild everything in Azure.

haacked commented 10 years ago

Thanks @jaredpar. So at this point, do you give the :shipit: to this PR?

jaredpar commented 10 years ago

@Haacked absolutely. Looks good to me!

haacked commented 10 years ago

Thanks a lot Everyone!

haacked commented 10 years ago

Ok, I uploaded this to http://visualstudiogallery.msdn.microsoft.com/1f3afebb-06c7-4b77-a54f-eb2f0784008d

But it still shows it as only supporting VS 2013. Was there anything else I need to do?

jaredpar commented 10 years ago

@Haacked in all of the discussion about getting the build setup correct we just forgot to update the manifest file :( Will fix that up in just a few

jaredpar commented 10 years ago

Blarg we do have to use strongly named references because of the following scenario. When both 2012 and 2013 are installed the 2013 SDK assemblies are considered before the 2012 SDK assemblies. Hence building in 2012 will bind to 2013 assemblies and fail the assembly load. I thought this only happened when using MsBuild from the command line but confirmed it does happen from IDE builds as well.

Working on a fix.