Download

Error when packaging project

I am trying to test my game as a standalone application and when packaging I get the following error:

LogPlayLevel: Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
LogPlayLevel: at Microsoft.VisualStudio.Setup.Configuration.ISetupPackageReference.GetId()
LogPlayLevel: at UnrealBuildTool.WindowsPlatform.FindVSInstallDirs(WindowsCompiler Compiler) in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Platform\Windows\UEBuildWindows.cs:line 931
LogPlayLevel: at UnrealBuildTool.WindowsPlatform.TryGetMsBuildPath(FileReference& OutLocation) in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Platform\Windows\UEBuildWindows.cs:line 1372
LogPlayLevel: at UnrealBuildTool.WindowsPlatform.GetMsBuildToolPath() in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Platform\Windows\UEBuildWindows.cs:line 1419
LogPlayLevel: at UnrealBuildTool.WindowsExports.GetMSBuildToolPath() in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Platform\Windows\WindowsExports.cs:line 34
LogPlayLevel: at AutomationTool.WindowsHostPlatform.GetMsBuildExe() in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\AutomationUtils\WindowsHostPlatform.cs:line 17
LogPlayLevel: at AutomationTool.CommandEnvironment.SetupBuildEnvironment() in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\AutomationUtils\CommandEnvironment.cs:line 202
LogPlayLevel: at AutomationTool.CommandEnvironment…ctor() in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\AutomationUtils\CommandEnvironment.cs:line 147
LogPlayLevel: at AutomationTool.CommandUtils.InitCommandEnvironment() in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\AutomationUtils\CommandUtils.cs:line 94
LogPlayLevel: at AutomationTool.Automation.Process(String] Arguments, StartupTraceListener StartupListener) in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 456
LogPlayLevel: at AutomationTool.Program.MainProc(String] Arguments, StartupTraceListener StartupListener) in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\Program.cs:line 176
LogPlayLevel: at AutomationTool.Program.<>c__DisplayClass1_0.<Main>b__2() in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\Program.cs:line 88
LogPlayLevel: at AutomationTool.InternalUtils.RunSingleInstance(Func`1 Main) in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:line 731
LogPlayLevel: at AutomationTool.Program.Main(String] Arguments) in D:\Build++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\Program.cs:line 88
LogPlayLevel: Completed Launch On Stage: Build Task, Time: 4.782110
LogPlayLevel: BUILD FAILED
PackagingResults: Error: Launch failed! Unknown Error

I tried packaging another project and this problem is still occurring. I tried looking this up and I found nothing related to UE4. Can anyone help?