# Packaging Plugin Calls Wrong Version of Visual Studio

**URL:** <https://forums.unrealengine.com/t/packaging-plugin-calls-wrong-version-of-visual-studio/483625>\
**Category:** Plugins\
**Tags:** unreal-engine, unrealbuildtool, packaging-projects, Visual-Studio, Plugins, question\
**Created:** [May 19, 2021, 3:20pm UTC](https://forums.unrealengine.com/t/packaging-plugin-calls-wrong-version-of-visual-studio/483625 "2021-05-19T15:20:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CoolNamesGone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/coolnamesgone/32/247999_2.png) [@CoolNamesGone](https://forums.unrealengine.com/u/CoolNamesGone)\
**Post date:** [May 19, 2021, 3:20pm UTC](https://forums.unrealengine.com/t/packaging-plugin-calls-wrong-version-of-visual-studio/483625/1 "2021-05-19T15:20:11Z")

</div>

I’ve got a working blueprint function library plugin written in C++. I’ve got Visual Studio 2019 installed, although the development environment is in C:\Applications rather than C:\Programs (x86). When I try to package the plugin, I see this in the Output Log:

UATHelper: Package Plugin Task (Windows): Building plugin for target platforms: Android, IOS, Linux, LinuxAArch64, Win64, Win32  
UATHelper: Package Plugin Task (Windows): Running: C:\Unreal4.26\UE\_4.26\Engine\Binaries\DotNET\UnrealBuildTool.exe UE4Game Win64 Development -Project=C:\UnrealProjects\FileIOPlugin\BPFileIOPlugin\HostProject\HostProject.uproject -plugin=C:\UnrealProjects\FileIOPlugin\BPFileIOPlugin\HostProject\Plugins\BPFileIOPlugin\BPFileIOPlugin.uplugin -iwyu -noubtmakefi  
les -manifest=C:\UnrealProjects\FileIOPlugin\BPFileIOPlugin\HostProject\Saved\Manifest-UE4Game-Win64-Development.xml -nohotreload -2017 -log=“C:\Users\couvilliw\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Unreal4.26+UE\_4.26\UBT-UE4Game-Win64-Development.txt”  
UATHelper: Package Plugin Task (Windows): ERROR: Visual Studio 2017 must be installed in order to build this target.

Summarizing what’s weird about that:

- It’s attempting to package for a bunch of platforms, although in the .uplugin and .uproject files, I’ve whitelisted only Win64
- It’s attempting to call Visual Studio 2017. In my AppData\Roaming\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml file, I’ve specified MSVS2019 as the Version in the VCProjectFileGenerator section

How do I make sure UnrealBuildTool uses the right version of Visual Studio?

---

<div class="post-metadata">

**Author:** ![CoolNamesGone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/coolnamesgone/32/247999_2.png) [@CoolNamesGone](https://forums.unrealengine.com/u/CoolNamesGone)\
**Post date:** [February 1, 2022, 5:11pm UTC](https://forums.unrealengine.com/t/packaging-plugin-calls-wrong-version-of-visual-studio/483625/2 "2022-02-01T17:11:35Z")

</div>

I never really figured out the problem, but came up with this work-around:

- Attempt to package the plugin from the editor
- When the packaging fails, click “Show Output Log” in the popup
- Find the last call to UnrealBuildTool.exe, which should be just above error message about Visual Studio not being installed
- Copy the UnrealBuildTool.exe command into a .bat file
- Change the -2017 command line argument to UnrealBuildTool.exe to -2019
- Run the batch file (don’t ask me why this didn’t work from the command line, but it didn’t for me; I needed to make it a batch file)
- Inside your package destination directory, there will be a directory PluginName/HostProject/Plugins/PluginName. The Content and Resources folders and the .uplugin file are your packaged plugin.

I don’t think it’s really different than just compiling your project with the new plugin, and copying the Content, Resources and .uplugin file.

---

<div class="post-metadata">

**Author:** ![phil123456](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@phil123456](https://forums.unrealengine.com/u/phil123456)\
**Post date:** [April 22, 2023, 8:11pm UTC](https://forums.unrealengine.com/t/packaging-plugin-calls-wrong-version-of-visual-studio/483625/3 "2023-04-22T20:11:21Z")

</div>

there is no -2017 in the command line, no idea where this is configured

changing the toolchain does not work either

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/e/20e533c5215f1501b06c4f26ba48ba4a9e228cc4.png)
