Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heat.exe : error HEAT0001 : Exception has been thrown by the target of an invocation. #4853

Closed
wixbot opened this issue Aug 12, 2015 · 6 comments
Assignees
Milestone

Comments

@wixbot
Copy link

wixbot commented Aug 12, 2015

The latest 3.10 beta (June) resolved issue #4597 but when I retargeted .NET 4.6, (HEAT) stopped working again, and I'm now getting the below error results and cannot build the WiX project:.

heat.exe : error HEAT0001 : Exception has been thrown by the target of an invocation.

D:\XXXX\Installer>"C:\Program Files (x86)\WiX Toolset v3.10\bin\heat" project D:\XXXX\Service.Windows.ApplicationServer\Service.Windows.ApplicationServer.csproj -configuration Release -pog Content -projectname Service.Windows.ApplicationServer -ag -template fragment -o D:\XXXX\Installer\Service.Windows.ApplicationServer.wxs
Windows Installer XML Toolset Toolset Harvester version 3.10.0.1823
Copyright (c) Outercurve Foundation. All rights reserved.

heat.exe : error HEAT0001 : Exception has been thrown by the target of an invocation.

    Exception Type: System.Reflection.TargetInvocationException

    Stack Trace:
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at Microsoft.Tools.WindowsInstallerXml.Extensions.VSProjectHarvester.ConstructMsbuildWrapperProject(String projectFile, HarvesterCore harvesterCore, String configuration, String platform, String shortVersion)
       at Microsoft.Tools.WindowsInstallerXml.Extensions.VSProjectHarvester.GetMsbuildProject(String projectFile)
       at Microsoft.Tools.WindowsInstallerXml.Extensions.VSProjectHarvester.GetProjectBuildOutputs(String projectFile, String[] buildOutputGroups)
       at Microsoft.Tools.WindowsInstallerXml.Extensions.VSProjectHarvester.Harvest(String argument)
       at Microsoft.Tools.WindowsInstallerXml.Harvester.Harvest(String argument)
       at Microsoft.Tools.WindowsInstallerXml.Tools.Heat.Run(String[] args)

Originally opened by jaans

@wixbot
Copy link
Author

wixbot commented Aug 17, 2015

The only way I could reproduce this was to not have the specified version of MSBuild installed on my machine. I only had MSBuild 14.0 on my machine, but set the ToolsVersion in the csproj file to 12.0. For now, Heat requires that the version of MSBuild specified in the ToolsVersion attribute is installed.

Pull request to log the real error message: 289.

Originally posted by rseanhall

@wixbot
Copy link
Author

wixbot commented Aug 17, 2015

Thanks for the update.
Would it be a workaround then with v3.10 to edit the .wixproj file and change the ToolsVersion="12" to ToolsVersion="14", or would there be a problem with that?

Is there some .wixproj upgrading required when going from VS2013 to VS2015?

Originally posted by jaans

@wixbot
Copy link
Author

wixbot commented Aug 17, 2015

The ToolsVersion of the wixproj isn't relevant to Heat. Heat reads in the ToolsVersion of the target project (in your case D:\XXXX\Service.Windows.ApplicationServer\Service.Windows.ApplicationServer.csproj) and loads that version of MSBuild to process it.

Originally posted by rseanhall

@wixbot
Copy link
Author

wixbot commented Aug 17, 2015

Ah... that's good to know. Should I just update the ToolsVersion of the projects to 14 then? Is that a workaround?

Originally posted by jaans

@wixbot
Copy link
Author

wixbot commented Aug 18, 2015

I wouldn't call it a workaround, that's how it works. The ToolsVersion attribute is for specifying which version of MSBuild to use to build the project - Visual Studio, msbuild, and heat all behave differently depending on the value. If you want to build the project with MSBuild 12, then set the ToolsVersion to 12.0 and make sure MSBuild 12 is installed. If you want to build the project with MSBuild 14, then set the ToolsVersion to 14.0 and make sure MSBuild 14 installed.

Originally posted by rseanhall

@wixbot
Copy link
Author

wixbot commented Aug 18, 2015

wixtoolset/wix3#289

AssignedTo changed from bobarnson to shall
Resolution set to fixed
Status changed from Untriaged to Resolved

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

No branches or pull requests

2 participants