Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install XNA 4.0 under Microsoft Visual Studio 2017

This guide will provide you with a workaround for using XNA in Visual Studio 2017. This will solve problems with the target files and Microsoft.Build.Framework.dll such as: Error loading pipeline assembly "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Microsoft.Build.Framework.dll"

  1. Download a modified version of the XNA vsix: https://mxa.codeplex.com/
  2. Unzip XNA Game Studio 4.0.vsix and replace the <Installation /> tag in extension.vsixmanifest with this:
 <Installation InstalledByMsi="false">
    <InstallationTarget Version="[12.0,16.0)" Id="Microsoft.VisualStudio.VSWinDesktopExpress" />
    <InstallationTarget Version="[12.0,16.0)" Id="Microsoft.VisualStudio.Pro" />
    <InstallationTarget Version="[12.0,16.0)" Id="Microsoft.VisualStudio.Premium" />
    <InstallationTarget Version="[12.0,16.0)" Id="Microsoft.VisualStudio.Ultimate" />
    <InstallationTarget Version="[14.0,16.0)" Id="Microsoft.VisualStudio.Community" />
    <InstallationTarget Version="[14.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" />
  </Installation>
  1. Place everything in a zip file again and change the extension to vsix. Now run the the vsix file. It should give a warning message but other than that install for VS2017 without problems.

  2. Copy everything from C:\Program Files (x86)\MSBuild\Microsoft\XNA Game Studio to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\XNA Game Studio

  3. Open the Visual Studio 2017 developer command prompt by searching for Developer command prompt for VS 2017 as administrator and execute the following code: (this will add the new version of Microsoft.Build.Framework to the Global Assembly Cache).

cd C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
gacutil /i Microsoft.Build.Framework.dll

Note that the bug is tracked here: https://github.com/Microsoft/msbuild/issues/1831

After this you should be able to work with XNA in Visual Studio 2017 without problems. Remember that you can upgrade the .Net version XNA uses by manually editing the csproj files in notepad :).

@wldevries

This comment has been minimized.

Copy link

@wldevries wldevries commented Mar 10, 2017

You probably want to remember this and remove the dll at a later point in time. It should not be in the GAC.

@Habush

This comment has been minimized.

Copy link

@Habush Habush commented Mar 22, 2017

@wldevries, can you please explain your comment? Which dll should be removed?

@roy-t

This comment has been minimized.

Copy link
Owner Author

@roy-t roy-t commented Mar 27, 2017

@Hubush, if you install an updated version of Microsoft.Build.Framework and a file lists its as a dependency without specifying the exact version number that program will load the version you've added in the GAC, not the newer version.

@SimonDarksideJ

This comment has been minimized.

Copy link

@SimonDarksideJ SimonDarksideJ commented Mar 30, 2017

That seems to work to solve the Dependancy issue but building projects still causes an
"Your installation of XNA Game Studio does not support this project (XNA Platform = 'Windows', XNA Framework Version = 'v4.0'). " error

Seems something is amis or not recognised @roy-t Any ideas?

@xNWDD

This comment has been minimized.

Copy link

@xNWDD xNWDD commented Apr 6, 2017

@DDReaper that should be fixed by step 4 (+5 as said @CaptainOachkatzl), double check you did copy to the path where you installed vs2017 (which may differ from C:\Program Files (x86)\Microsoft Visual Studio\2017\ ) and ensure you ran 5 in an administrator console

@CaptainOachkatzl

This comment has been minimized.

Copy link

@CaptainOachkatzl CaptainOachkatzl commented May 4, 2017

@xNWDD its fixed by step 4+5 actually.
works with VS2017 RC and windows 10 professional.
thanks for sharing your solution!

@korenb

This comment has been minimized.

Copy link

@korenb korenb commented May 18, 2017

use particular zip format instead of 7zip, otherwise installing doesn't work.

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 8, 2017

Help ! I can't open "Developer command prompt for VS 2017" , i click and it's do nothing ! Help me !

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 8, 2017

Its say
"D:\PST\Glyph\Sources\Glyph Recognition Studio>gacutil -i Microsoft.Build.Framework.dll
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.0
Copyright (c) Microsoft Corporation. Tous droits réservés.

Échec de l'ajout de l'assembly au cache : Le fichier spécifié est introuvable."
Help me !

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 13, 2017

Plz help me i need this today plz :(

@golyalpha

This comment has been minimized.

Copy link

@golyalpha golyalpha commented Jun 25, 2017

So, umm, I ran the vsix, but the files I was told to copy weren't in either the source, nor destination...

@roy-t

This comment has been minimized.

Copy link
Owner Author

@roy-t roy-t commented Jul 18, 2017

@ThundeZZ, sorry I do not get notifications of the replies here. It looks like you're in the wrong folder. Use cd to change to the C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin folder and then run the command.

(Please read the guide extra carefully, these steps were already in there).

@roy-t

This comment has been minimized.

Copy link
Owner Author

@roy-t roy-t commented Jul 18, 2017

@golyalpha. that is weird. I tried to this on all ten developer computers at my work. Was there an error message when trying to run the VSIX file?

@524416027

This comment has been minimized.

Copy link

@524416027 524416027 commented Jul 21, 2017

Hello, I have a problem with step 5, after I copy and execute the code, it says " 'gacutil' is not recognized as an internal or external command, operable program or batch file". What I do about it?

And for now, there is no solution on new project under XNA Game Studio 4.0 can be select at Visual Studio.

Please give a little help, thanks!!!

@ctkat

This comment has been minimized.

Copy link

@ctkat ctkat commented Aug 13, 2017

Hi, I am missing something here; I downloaded the modified XNA zip, unzipped to new folder. Than I dont understand; do I need to unzip the vsix file?, Guess not, however when I take the vsix file to a normal editor, this is some sort of compiled code, that I can not edit, searching that file for one of the replacements did not result in anything. What am I missing here?
Thanks you.

@junwatu

This comment has been minimized.

Copy link

@junwatu junwatu commented Sep 16, 2017

@golyalpha you need to install XNA Framework and XNA Game Studio separately before run vsix. Those files already on the zip file.

@rlundy

This comment has been minimized.

Copy link

@rlundy rlundy commented Sep 26, 2017

I just tried this, and it worked! A few tips:

  • The .vsix is indeed a .zip file, something I never knew before. You'll need to unzip it, make the changes, and re-zip it.
  • As korenb mentions above (thanks, korenb!), if you're using 7-Zip, make sure you re-zip the .vsix as a .zip file, not a .7z file.
  • Also, make sure you zip the contents of the .vsix, not the folder containing them. If you unzip the .vsix to a "VSIXStuff" folder, you should zip back the stuff inside that folder, not the folder itself.
  • Don't forget to open the Developer Command Prompt as administrator.
  • Check your file paths carefully!

Thanks, roy-t, for posting this guide.

@PabloHorno

This comment has been minimized.

Copy link

@PabloHorno PabloHorno commented Sep 29, 2017

I have the instalation of the visual studio in the HDD, and I don´t have the directory in C,
I can´t use gacutil because i can´t accest to the D unit.
D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
Any ones knows?

@eepromm99

This comment has been minimized.

Copy link

@eepromm99 eepromm99 commented Oct 23, 2017

Followed the steps and still getting the pipeline error. Any ideas how I would debug this? This is trying to run an xna sample.
I followed the guide and installed for vs2017 from https://mxa.codeplex.com/releases/view/630357 (XNA 4.0 Refresh (Visual Studio 2017))
I've also run (and it executed no problem)
gacutil /i Microsoft.Build.Framework.dll
in folder:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin

Getting this error: (nothing to do with monogame, it just happens to be in a subfolder below that)
1>------ Build started: Project: BillboardPipeline, Configuration: Debug x86 ------
1> BillboardPipeline -> D:\monogameProjects\XNAGSSamplesAndArticles\XNAGameStudio-master\ExtractedSamples\Billboard\BillboardPipeline\bin\x86\Debug\BillboardPipeline.dll
2>------ Build started: Project: BillboardWindows, Configuration: Debug x86 ------
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\XNA Game Studio\v4.0\Microsoft.Xna.GameStudio.ContentPipeline.targets(78,5): error : Error loading pipeline assembly "D:\monogameProjects\XNAGSSamplesAndArticles\XNAGameStudio-master\ExtractedSamples\Billboard\BillboardPipeline\bin\x86\Debug\BillboardPipeline.dll".
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Ideas?

@Jofairden

This comment has been minimized.

Copy link

@Jofairden Jofairden commented Oct 23, 2017

This is broken? At step 4:
Copy everything from C:\Program Files (x86)\MSBuild\Microsoft\XNA Game Studio
This folder does not exist at all, where is it coming from?

@AlbaMustafaj

This comment has been minimized.

Copy link

@AlbaMustafaj AlbaMustafaj commented Oct 28, 2017

@Jofairden After installing everything it should be there. Make sure you have followed all the above steps correctly.

@mrhaboobi

This comment has been minimized.

Copy link

@mrhaboobi mrhaboobi commented Oct 29, 2017

Have you tried changing the binding information

The 99.9.9.9 includes its self.. wouldnt that be better being 15.0.0.0 so that it redirects everything up to 15 to 15.1?

Any way around this without gacing?

@pbachman

This comment has been minimized.

Copy link

@pbachman pbachman commented Nov 29, 2017

I've tried to get my WP Game Project opened with VS2017 Community on Win10, but it doesn't work.

Your installation of XNA Game Studio does not support this project (XNA Platform = 'Windows Phone', XNA Framework Version = 'v4.0').

@thaumatrope

This comment has been minimized.

Copy link

@thaumatrope thaumatrope commented Dec 3, 2017

Same problem here, step 4+5 were done succesfully.

Warnung Your installation of XNA Game Studio does not support this project (XNA Platform = 'Windows', XNA Framework Version = 'v4.0').

Sorry, works!!!

Copied files from wrong directory.
C:\Program Files (x86)\MSBuild\Microsoft\XNA Game Studio
(I took accidentally C:\Program Files (x86)\Microsoft XNA)
===>
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\XNA Game Studio

That is wonderful! Thank you very much!

@Wings-12

This comment has been minimized.

Copy link

@Wings-12 Wings-12 commented Dec 11, 2017

Unzip XNA Game Studio 4.0.vsix and replace the tag in extension.vsixmanifest with this:

↑ I don't know how to replace the tag in extension.vsixmanifest with that.
Please help me. I'm a beginner about programming.

@davidhesselbom

This comment has been minimized.

Copy link

@davidhesselbom davidhesselbom commented May 11, 2018

I skipped step 5, but everything still appears to work (I can create new XNA projects as well as build and run them). Why is step 5 necessary?

EDIT: Turns out that while I can create new projects and build them, I cannot build existing (old) projects (created with VS 2013):

Error loading pipeline assembly "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\Microsoft.Build.Framework.dll".

The same thing happened to OP here. I guess this is because I skipped step 5.

But, this also leads me to believe that there's something in the .sln or maybe the .csproj files that causes this error, and that these files can be modified somehow to work with VS 2017 without step 5.

Will update this post if I figure out how.

@C00lzer0

This comment has been minimized.

Copy link

@C00lzer0 C00lzer0 commented May 16, 2018

Nice guide (thx 4 that) but for me it also doesn't work :(

I got the same error after loading my old xna project as SimonDarksideJ:
"Your installation of XNA Game Studio does not support this project (XNA Platform = 'Windows Phone', XNA Framework Version = 'v4.0')"

Also creating a new project does not work (same error here too).

The interesting part is that the content pipeline importers are working:
image

Is it possible to switch back to the "old" Microsoft.Build.Framework ?

Edit:
After a lot of reading an testing i finally switched to MonoGame (3.7 development version) to get it work with VS 2017 and it runs now on my WP10 (needs only some adjustments for scaling XD).

@wldevries

This comment has been minimized.

Copy link

@wldevries wldevries commented Dec 12, 2018

To revert to the old dll you need to unregister the assembly from the GAC.

With the following command you can list the dlls that are currently registered:
gacutil /l Microsoft.Build.Framework

The entry that I registered from my Visual Studio 2017 installation is the following entry:
Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL

To uninstall it you need to pass the entry you found above to gacutil /u as a parameter and remove all the spaces:
gacutil /u Microsoft.Build.Framework,Version=15.1.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a,processorArchitecture=MSIL

To fix Visual Studio after an upgrade you need to register the updated dll in the GAC
I've found that Visual Studio 2017 often stops working or weird behavior starts to occur after I upgrade it. The reason is that with each update to Visual Studio the Microsoft.Build.Framework.dll is potentially updated and VS relies on it. To fix it you need to reregister the dll in the GAC. To do this you repeat step 5 in the guide above and if you are using Visual Studio 2017 Pro like me the commands are:

cd C:\Program Files (x86)\Microsoft Visual Studio\2017\professional\MSBuild\15.0\Bin
gacutil /i Microsoft.Build.Framework.dll

The Visual Studio 2019 path has changed slightly:

cd C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin
gacutil /i Microsoft.Build.Framework.dll
@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 22, 2019

On the download site, it only gives me the ability to "download archive." Where is the .vsix file I want to unzip and edit in there?

@roy-t

This comment has been minimized.

Copy link
Owner Author

@roy-t roy-t commented Jun 23, 2019

@Nalonnariek unfortunately this file was hosted at CodePlex, which has shut down. I'm not sure if the file is hosted anywhere else. I'm afraid it is really time to move to MonoGame, which is API compatible with XNA.

You can also try sending a message to @SimonDarksideJ (https://github.com/SimonDarksideJ) he has archived a lot of XNA stuff, and I think he said he would also archive this VSIX file somewhere).

@SimonDarksideJ

This comment has been minimized.

Copy link

@SimonDarksideJ SimonDarksideJ commented Jun 23, 2019

This is my xna archive site, with the entire xna catalogue and more.
https://github.com/SimonDarksideJ/XNAGameStudio
Can't recall if I did put the xna studio stuff on there, but I'll check, and if it's not I will

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jun 24, 2019

Ok, thanks to both of you for your help.

@Eversor

This comment has been minimized.

Copy link

@Eversor Eversor commented Oct 19, 2020

I don't know why "Error loading pipeline assembly "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\Microsoft.Build.Framework.dll". happens, but i found out you can solve it by creating a new c# project to "warm up" VS. It will then behave and the error should not happen again.

@jordiserres0

This comment has been minimized.

Copy link

@jordiserres0 jordiserres0 commented Nov 20, 2020

Thank you so much for posting. After a re-installation of Visual Studio, this bug left me frozen, since I couldn't compile my solutions anymore.

@Eversor

This comment has been minimized.

Copy link

@Eversor Eversor commented Nov 20, 2020

Funny i had this problem again 5 days ago and was able to solve it by dropping on my own solution :D Happy to know it helps someone else <3

@intelligentvending

This comment has been minimized.

Copy link

@intelligentvending intelligentvending commented Mar 5, 2021

I have it running happily in VS2019 following all of these steps, with the addition of needing to install these extra items to the GAC for it to work in step 5:

gacutil /i Microsoft.Build.Framework.dll
gacutil /i Microsoft.Build.dll
gacutil /i System.Collections.Immutable.dll
gacutil /i Microsoft.Build.Utilities.Core.dll

Hope this helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment