Can Surface SDK run on Visual Studio 2012?
Asked Answered
A

2

7

I need to create a WPF app using the Surface SDK. I am using Visual Studio 2012, and according to this SO post, VS2012 doesn't allow that. However, since this was posted before it was officially released, I want to make sure I'm not missing something.

I just need a few of the touch/swipe controls that come with it. Is there a different option for VS2012? The other developer is using 2010, so it needs to be able to still run on his machine. It's a very simple app that I just need to hammer out, so I'm looking for the fastest, easiest method. Both of us and the end application is to run on Windows 7.

Abutilon answered 8/1, 2013 at 22:41 Comment(4)
The system requirements don't state that 2012 is supported, only 2010.Parsec
@vcsjones, If not, then how are you supposed to create touch-enabled apps with VS2012?Abutilon
I would think you have to use Visual Studio 2010 (it says even the express editions are fine) - which you can have installed at the same time as 2012.Parsec
possible duplicate of how can I use MicroSoft Surface SDK with Visual Studio 2012?Pedi
R
4

I found an easy solution by which it seems to work. It does expect you to have Visual Studio 2010 installed. Following the following steps I managed to compile in Visual Studio 2012 using .NET 4.5. TouchDown events work. I tried it out on some small projects and they seem to work perfectly fine.

  1. Use Visual Studio 2010 to set up a Surface project.
  2. Safe and close Visual Studio 2010.
  3. Open the solution using Visual Studio 2012.
  4. Change the target framework under project settings to .NET 4.5.
  5. Save as a new solution file.
  6. Compile, ... everything works!

This method prevents you from having to set up all the configuration files/references yourself. The only downside is you don't have any of the Surface tools integrated into the IDE. E.g. the toolbox, project templates, ... This of course doesn't prevent you from writing plain XAML yourself.

If for some reason this doesn't work in the long run I will update this post.

Recurrence answered 11/4, 2013 at 19:39 Comment(3)
Let me know how it goes, I can update the answer for the question.Abutilon
@Abutilon All seems to work perfectly. I added my previous comment in the answer since it's relevant information.Recurrence
thanks for updating. Good to know for anyone else in this bind.Abutilon
H
3

The easiest way will unfortunately be for you to run VS2010.

Currently the SDK is not supported in VS2012, for a few reasons. Notably, the way that touch works in Win8 is a lot better than in previous versions of Windows. This unfortunately meant a rewrite of the touch layer that the Surface SDK uses. The new controls are written to adapt dynamically based on mouse/touch input, making the Surface SDK controls a bit redundant.

Microsoft might make the SDK available for VS2012 in the future, but this is kind of debatable.

If you are still dead set on giving it a shot, download an application called Orca (http://msdn.microsoft.com/en-us/library/windows/desktop/aa370557(v=vs.85).aspx) and edit the SDK installer file, removing the dependency on VS2010.

This is how I got the Surface 1 SDK to work with VS2010, since it was targeting VS2008 (note that it still has not been updated to work with VS2010)

Let me know how you go.

Hispidulous answered 21/1, 2013 at 5:13 Comment(3)
You say "The new controls are written to adapt dynamically based on mouse/touch input, making the Surface SDK controls a bit redundant." The main reason for me using the Surface SDK though are controls like ScatterView / ScatterViewItem, which, on top of handling touch events and manipulations, also provide a simple physics simulation for shoving objects around, by simulating mass, inertia, friction etc. That's precisely the part that is missing when you just use the Windows 8 touch layer.Heckle
The OP was referring to "a few of the touch/swipe controls that come with it", so that's what my answer it tailored towards. If you want a ScatterView you will indeed need the Surface SDK.Hispidulous
I tried Orca but I was not able to make installer work. It says: DEBUG: Error 2356: Couldn't locate cabinet in stream: Surface.cab. The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2356. The arguments are: Surface.cab, , MSI (s) (C8:30) [17:22:25:581]: Product: Microsoft Surface 2.0 SDK -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2356. The arguments are: Surface.cab, ,Ancon

© 2022 - 2024 — McMap. All rights reserved.