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

Harvesting project from VS2010 generate errors for .resx #3757

Closed
wixbot opened this issue Sep 4, 2012 · 19 comments
Closed

Harvesting project from VS2010 generate errors for .resx #3757

wixbot opened this issue Sep 4, 2012 · 19 comments
Milestone

Comments

@wixbot
Copy link

wixbot commented Sep 4, 2012

I update to Wix 3.6.3303 from 3.6.2221. And now I get problem to compile merge module project wich harvest C# project output with .resx files.
All works fine if i run the same heat.exe from command line but get errors when compile VS2010 solution

Using "HeatProject" task from assembly "C:\Program Files (x86)\WiX Toolset v3.6\bin\WixTasks.dll".
Task "HeatProject"
Command:
C:\Program Files (x86)\WiX Toolset v3.6\bin\Heat.exe project D:\TFS2010\Ranet\Xafari\trunk\Xafari\Xafari\Xafari.csproj -configuration Release -directoryid INSTALLFOLDER -platform AnyCPU -pog Binaries -pog Symbols -pog Sources -pog Content -pog Satellites -pog Documents -projectname Xafari -ag -sfrag -out obj\Release_Xafari.wxs
Windows Installer Xml Toolset Harvester version 3.6.3303.0
Copyright (C) Outercurve Foundation. All rights reserved.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "Actions\AggregatedAction.resx". Could not find a part of the path 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\Actions\AggregatedAction.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "Actions\AggregatedActionsController.resx". Could not find a part of the path 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\Actions\AggregatedActionsController.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "Actions\HideActionsViewController.resx". Could not find a part of the path 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\Actions\HideActionsViewController.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "CustomAppearances\CustomAppearanceRuleController.resx". Could not find a part of the path 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\CustomAppearances\CustomAppearanceRuleController.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "CustomAppearances\CustomAppearanceViewController.resx". Could not find a part of the path 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\CustomAppearances\CustomAppearanceViewController.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "AutoRefreshViewController.resx". Could not find file 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\AutoRefreshViewController.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "DefaultValueViewController.resx". Could not find file 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\DefaultValueViewController.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "ListViewCriteriaObjectCreatingController.resx". Could not find file 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\ListViewCriteriaObjectCreatingController.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "Module.resx". Could not find file 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\Module.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "MultipleHierarchyViewController.resx". Could not find file 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\MultipleHierarchyViewController.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "MultipleLookupViewController.resx". Could not find file 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\MultipleLookupViewController.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "XafariShowHelpViewController.resx". Could not find file 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\XafariShowHelpViewController.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "XafariShowHelpWindowController.resx". Could not find file 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\XafariShowHelpWindowController.cs'.
heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(67,9): Unable to create a manifest resource name for "Utils\MessageObjectViewController.resx". Could not find a part of the path 'D:\TFS2010\Ranet\Xafari\trunk\Xafari\Setup\MergeModule1\Utils\MessageObjectViewController.cs'.
heat.exe(0,0): error HEAT5307: Build failed.
The command exited with code 5307.
Done executing task "HeatProject" -- FAILED.

Originally opened by sergezaitsev from http://sourceforge.net/p/wix/bugs/3074/

@wixbot
Copy link
Author

wixbot commented May 29, 2013

Hi. Could you please fix this bug in the upcoming build of WiX v4?

@wixbot
Copy link
Author

wixbot commented May 29, 2013

@Sergey, I have attached the version of wix that I built with this patch in it. Feel free to use it until the fix gets merged into the next release. Please be aware that I will not be able to provide any support.

There is something wrong with the way I built it that requires you to trust a certificate before the installer will execute correctly. Currently I manually work around the issue... You need to open an elevated visual studio command prompt and run the following command: sn -Vr *,36e4ce08b8ecfb17

@wixbot
Copy link
Author

wixbot commented May 29, 2013

Thanks Gregory,

Your fix solved this issue for us, I hope we can get this fix rolled up into an official release ASAP.

@wixbot
Copy link
Author

wixbot commented May 29, 2013

Hi. Is there still no solution in official release? I take a look on 3.8.415.0 version and see that problem persists.

@wixbot
Copy link
Author

wixbot commented May 29, 2013

It would be far more helpful to send a pull request rather than send compiled binaries. A pull request would allow a fix to be reviewed by the developers and incorporated. Otherwise, you're waiting for other people (who are probably busy) to prioritize things that are important to you.

@wixbot
Copy link
Author

wixbot commented May 29, 2013

The fix is now in the repository, I already tested successfully the latest build (http://wixtoolset.org/releases/v3.8.520.0).

@wixbot
Copy link
Author

wixbot commented May 29, 2013

Thank you very much, Stefan.

@wixbot
Copy link
Author

wixbot commented May 29, 2013

Thank you very much, Jeff.
In fact, it is not me who needs this fix, it is important to our customers who move from Visual Studio 2010 to Visual Studio 2012, which doesn't support vdproj setups. We help them to convert their existing Visual Studio setup projects (.vdproj) to WiX.

@wixbot
Copy link
Author

wixbot commented May 29, 2013

@wixbot
Copy link
Author

wixbot commented May 29, 2013

For anyone who is interested, I can correct this behavior by making the following change in Wix 3.7 final:

In src\ext\VSExtension\wixext\VSProjectHarvester.cs find the line:

buildSuccess = project.Build(projectFile, buildOutputGroups, buildOutputs);

and change it to this block:

string pwd = Directory.GetCurrentDirectory();
Directory.SetCurrentDirectory(projectFile.Substring(0, projectFile.LastIndexOf('\\')));
bool buildSuccess = false;
try
{
    buildSuccess = project.Build(projectFile, buildOutputGroups, buildOutputs);
}
finally
{
    Directory.SetCurrentDirectory(pwd);
}

@wixbot
Copy link
Author

wixbot commented May 29, 2013

Works fine for me. Please provide an example project that reproduces the problem before reopening. Thanks.

@wixbot
Copy link
Author

wixbot commented May 29, 2013

I have this same issue, It is preventing me from upgrading to 3.6. Any information or workarounds?

@wixbot
Copy link
Author

wixbot commented May 29, 2013

Sample solution with subj

@wixbot
Copy link
Author

wixbot commented May 29, 2013

I have uploaded sample solution with subj

@wixbot
Copy link
Author

wixbot commented May 29, 2013

WiX appears to have trouble with a .resx file that doesn't have the corresponding generated .cs file. This seems to happen when Visual Studio generates a WinForms Form.

As a workaround, either delete the resx (you are not using it, or you would have the .cs file), or add some resource to the resx and Visual Studio will generate the .cs file.

@wixbot
Copy link
Author

wixbot commented May 29, 2013

I modified Serge's example to be localizable. This reflects what I am seeing in my application. This forces the resx to be used and valid. Editing this resx file by hand (which is against best practices for winforms generated resx files) does not make wix succeed for me. Deleting it is not an option because it is used.

Thanks, Jeff

@wixbot
Copy link
Author

wixbot commented May 29, 2013

The incorrect path hints at the problem. Heat assumes incorrectly that it is standing in the harvest project folder, when really its working directory is the installer project folder.

To prove this, you can modify references to the offending .cs file to specify its full path, and heat works fine. This is not a solution or even a reasonable workaround, but it illustrates the problem (that heat is looking in a dumb place).

So to solve properly, either the framework calling heat needs to CD into the right folder first, or heat needs to be passed the correct folder somehow.

@wixbot
Copy link
Author

wixbot commented May 29, 2013

dwickern, The workaround you suggest doesn't seem to be correct. Here is what I see in the errors (on the 3.7 RC):

heat.exe(0,0): error HEAT5313: Build error during harvesting: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(78,9): Unable to create a manifest resource name for "UnhandledExDlgForm.resx". Could not find file 'D:Path To Setup\UnhandledExDlgForm.cs'.

Notes:

  1. UnhandledExDlgForm.cs exists and has a valid resource file.
  2. "Path To Setup\UnhandledExDlgForm.cs" does not exist, it shouldn't exist because it is the setup project path and not the harvested dll path.

@wixbot
Copy link
Author

wixbot commented May 29, 2013

@jeffras

My fix works for "WindowsFormsApplication1" posted above.

Simply delete the file:
WindowsFormsApplication1\ClassLibrary1\Form1.resx

I'm using WiX 3.6 release. If the fix doesn't work for you, please post steps to repro.

@wixbot wixbot added this to the v3.8 milestone Dec 20, 2015
@wixbot wixbot closed this as completed Dec 20, 2015
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

1 participant