none
Windows.Gaming reference RRS feed

  • Question

  • Hi,

    I am following the below youtube video:

    https://www.youtube.com/watch?v=3N0d6ZMNvOY

    It has instructions on how to add the Windows.Gaming reference to my project although it is not working for me.

    I go into Add References, although under Universal Windows section it just says "No references were found in the Universal Windows SDK"

    Am I missing something, do I need to install anything additional. I have Windows 10 SDK (10.0.18362.0) installed, I thought that would be all that was needed.

    I am using Visual Studio 2019 and the application is for C# Windows Form Application.

    Any help would be appreciated.

    Thanks

    Wednesday, July 31, 2019 10:54 PM

All replies

  • Hi JayWeb,

    Welcome to MSND forum.

    According to your description, please try to open visual studio installer -> download "Universal Windows Platform Development" workload. And please work in Win10 environment.

    If there is update information, please feel free to contact us.

    Best Regards,

    Dylan


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, August 1, 2019 4:28 AM
  • The Windows SDK is enough, but it isn't obvious what you need to do.

    If you are writing a desktop application and you want to get access to one of the objects that are available for desktop application then, as you know, no references to the Windows Runtime are added.

    It is possible to add a reference using the following steps.

    1) Go through the initial steps for adding a reference to your project.

    2) Select Browse at the bottom on the left side.

    3) Click the Browse button. The open window that appears is filtered for expected file types (.dll, .ocx and the like)

    so change the file type filter to All Files (*.*)

    4) Go to the path where the Windows SDK is installed (defaults to %ProgramFiles%\Windows Kits or %ProgramFiles(x86)%\Windows Kits) and go to 10\UnionMetadata\<sdk version> subdirectory. The path that it is installed to by default is shown in the screenshots above.

    5) Select the file Windows.winmd and click the Add button. This will show the Reference Manager window with this file added and selected.

    Now you are able to access the entire UWP namespace. So Windows.Gaming is obviously available.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Thursday, August 1, 2019 10:40 AM
  • Hi JayWeb,

    Any update for this issue? I've checked the tutorial and get the same issue like you.

    So I assume the cause of the issue is the tutorial is a bit out-of-date, it may apply to VS2015 in earlier windows OS using earlier Windows SDK, but it just not work for the latest VS2019 in current Windows OS after some many new updates.

    >>Am I missing something, do I need to install anything additional. 

    It seems that the tutorial is not supported for your current development environment. Then I suggest you can do what Darran suggests, it's a real working approach for your current situation I think.

    So I proposed it as answer since I've checked this approach in Winform app, it really works for this situation. You can follow his answer to solve this issue.

    In addition: Don't worry about if it's a better way to manually add reference to Windows.winmd. I've confirmed with one engineer more experienced in UWP and Xbox topic, and get the hint from him, so it should work and hope it helps:)

    Sincerely

    Lance


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 2, 2019 3:41 AM