5

I am testing my desktop application on a Windows 8 machine and I noticed there is a new column in the Task Manager details view called "Operating system context". This shows my application running under the "Windows Vista" context.

I haven't specified anything in the application manifest to force the application to run under this context in Visual Studio. The application is a Visual C++ App and was built in Visual Studio 2010.

Don't get me wrong, the application runs smoothly on Windows 8 so I am not looking to solve crashes or bugs. It just annoys me to see such a thing and would like to fix it.

So my question is how can I make my application run under the "Windows 8" context under Windows 8?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Zaid Amir
  • 4,727
  • 6
  • 52
  • 101
  • Don't quote me, but my investigations show that only Windows Store Apps show up in the Windows 8 context. I've no idea why some are Windows 7 or Windows Vista though ;-) – Roger Rowland Apr 04 '13 at 11:57
  • @roger_rowland well most of them does, and as you said some run as Vista and some Run as 7. Chrome, when run in desktop mode, runs under Windows 8 context. So I just want to know how this is specified, does it have something to do with the executable signature? or is it a build option – Zaid Amir Apr 04 '13 at 12:17
  • I honestly don't know, but I'm now intrigued to find out! If I discover anything I'll post back so keep this question alive if possible. – Roger Rowland Apr 04 '13 at 12:22
  • not sure how I'm supposed to keep it alive, but will try :) – Zaid Amir Apr 04 '13 at 12:30

1 Answers1

9

Ok, I think I've found the answer here. It says:

Applications without a Compatibility section in their manifest will receive Windows Vista behavior by default on Windows 7 and future Windows versions

So if you don't have anything in your manifest, Vista is what you get. Reading the rest of the article, it seems the best you can do is get Windows 7 rather than Windows 8, so maybe that's something specific to Store Apps?

EDIT

Ok, I finally found the entry you need for Windows 8:

<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>

So try putting that in the compatibility section of your manifest.

I know you're using VS2010, so this may be different, but with VS2012, I did the following:

  1. Created a new WPF application
  2. Right-click on project in Solution Explorer and choose Add New Item
  3. Select Application manifest from the list

A new manifest is added to the project with compatibility settings commented out. A cut-down example with everything uncommented is as follows:

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
  <application>
    <!-- A list of all Windows versions that this application is designed to work with. 
    Windows will automatically select the most compatible environment.-->

    <!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
    <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>

    <!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
    <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>

    <!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
    <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>

  </application>
</compatibility>
</asmv1:assembly>

After rebuilding, the application shows as expected in Task Manager:

enter image description here

Roger Rowland
  • 25,885
  • 11
  • 72
  • 113