cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
shamp00
Level 3

Cannot build solution with multiple setup projects from the command line

I have a .NET 4.5 solution with 5 InstallShield projects. I'm on Windows 8 64x, Visual Studio 2012, InstallShield 2012 Spring LE.

When I build the solution using devenv from the command line, I get -6225 errors. Apparently this is a known bug (also here)

But when I build it from the command line using MSBuild, the first IS project works, but all the others fail with 'error : Failed to load ISWIBuild: -2147221164'

What am I doing wrong?
0 Kudos

(13) Replies
chiranjeevi
Level 7 Flexeran
Level 7 Flexeran

Hello,

can you try creating Exec task on msbuild for each setup ?

Thanks,
Chiranjeevi
0 Kudos
shamp00
Level 3

Can you give me an example of how to do this?

I am currently using




Configuration=$(Configuration)
Platform=$(Platform)
BuildInParallel="false"
StopOnFirstFailure="true"
Targets="Build"






If I change MySolution.sln to MySetup1.isproj, it fails with

No outputs for project "MyProject1" were provided but the installation project references "MyProject1.Content Files".


I can't see how to get the outputs without building the whole solution.
0 Kudos
chiranjeevi
Level 7 Flexeran
Level 7 Flexeran

Hello,

Please refer below article for more information:

http://msdn.microsoft.com/en-us/library/vstudio/bb651793.aspx

Thanks,
Chiranjeevi
0 Kudos
shamp00
Level 3

That link doesn't help. Whenever I build a single isproj file I get

No outputs for project "MyProject1" were provided but the installation project references "MyProject1.Content Files".


It doesn't seem to matter whether I use MSBuild from the command line or the MSBuild task.

To summarize:

  • If I build the whole solution with MSBuild, I can only include one isproj project, otherwise I get a Failed to load ISWIBuild: -2147221164
  • If I build the whole solution with DevEnv, I get -6225 errors
  • If I build a single isproj with MSBuild, I get No outputs for project ... were provided
0 Kudos
chiranjeevi
Level 7 Flexeran
Level 7 Flexeran

Hello,

It is important to realize that when you use an "MSBuild" task, a new child MSBuild process will be started. The implication of this is that any items and properties you define in the parent MSBuild process will not be automatically passed to/visible from the child MSBuild process unless you explicitly pass them via Properties attribute on MSBuild element (as in ).

To answer your questions, I wrote the following self-contained example that runs a child MSBuild project for all the specified configurations:

1. First, create a directory for your MSBuild experiment (for example I used C:\temp\msbuildtest)
2. In this directory, create the first file, main.proj:
3.
4.
5.
6.
7.

8.
11.
12.
13.


14. In the same directory, create the second file, child.proj (in your case this would be the actual C# project you're trying to build, but because I'm trying to illustrate my point, I am using a simple child project that instead of running C# compiler just prints values of properties 🙂 )
15.
16.
17.
18.


19. Now you can run the example. First the default, if you don't explicitly specify configurations to build:
20. C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild main.proj
21. > (cut the noise)
22. > Build:
> Building configuration Debug with output path C:\temp_c\d\bin\Debug
And then explicitly specified multiple configurations:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild main.proj /property:Config=Debug+Release+Staging+Production
> (cut the noise)
> Build:
> Building configuration Debug with output path C:\temp_c\d\bin\Debug
> Build:
> Building configuration Release with output path C:\temp_c\d\bin\Release
> Build:
> Building configuration staging with output path C:\temp_c\d\bin\Staging
> Build:
> Building configuration Production with output path C:\temp_c\d\bin\Production
You should be able to adapt this technique to your situation.


Hope this helps.

Thanks,
Chiranjeevi
0 Kudos
shamp00
Level 3

Hi Chiranjeevi,

Thanks for your replies. I am aware of MSBuild's capabilities and have tried nesting MSBuild projects without success. I cannot get any command line build to work.

I have attached a simplified VS 2012 solution. It contains two console applications and two corresponding setup projects. Could you please provide any method of building the Setup1.msi and Setup2.msi from the command line using ISLE.

I have included two batch files:
The first one (BuildSolutionDirectly.cmd) runs msbuild.exe against the .sln file and fails with Failed to load ISWIBuild: -2147221164
The second one (BuildWithXml.cmd) uses Build.xml and fails with No outputs for project

Thanks for any help,

Rob
0 Kudos
chiranjeevi
Level 7 Flexeran
Level 7 Flexeran

Hello,

I am unable to download the attachment completely.

Can you try below workaround:

If Multiprocessor Builds is enabled, it will may cause built in a different order via command line than building in Visual Studio IDE. I would like to suggest you to try to turn off Multiprocessor Builds by setting maximum number of parallel project builds to 1 under Tools>Options>Projects and Solutions>Build and Run.

try to use this command from an Admin CMD window:

MSBuild "" /p:Configuration=Debug /p:Platform="Any CPU" /t:rebuild


Thanks,
Chiranjeevi
0 Kudos
shamp00
Level 3

chiranjeevi wrote:
Hello,

I am unable to download the attachment completely.



That is strange - I just downloaded it successfully from two different machines with no problem. Here is a dropbox link to the same project: https://dl.dropboxusercontent.com/u/53351620/InstallShieldTest.zip

Your suggestion to turn off Multiprocessor builds has had no effect. I still get Failed to load ISWIBuild: -2147221164 as soon as the second InstallShield project starts building.

(I suspect the problem might be that the InstallShield task descends from Microsoft.Build.Utilities.Task instead of AppDomainIsolatedTask. This causes the ISWIBuild assembly to remain locked. See here for a similar issue on StackOverflow: http://stackoverflow.com/a/3405932/1077279)
0 Kudos
chiranjeevi
Level 7 Flexeran
Level 7 Flexeran

Hello,

Have you tried setting the build path to .Net version 4.5.

Thanks,
Chiranjeevi
0 Kudos
shamp00
Level 3

chiranjeevi wrote:
Hello,
Have you tried setting the build path to .Net version 4.5.


Yes the build path is .NET 4.5. Have you looked at the project I included in my last post?
0 Kudos
chiranjeevi
Level 7 Flexeran
Level 7 Flexeran

Hello,

I am currently working on the issue with the help of project provided, will get back to you soon with my findings.

Thanks,
Chiranjeevi
0 Kudos
shamp00
Level 3

Any news on this? Thanks.

chiranjeevi wrote:
Hello,

I am currently working on the issue with the help of project provided, will get back to you soon with my findings.

Thanks,
Chiranjeevi
0 Kudos
chiranjeevi
Level 7 Flexeran
Level 7 Flexeran

Hello,

I am currenly working with our engineering to resolve the issue.

As soon as I get further information on this issue, I'll update you with the details.

Thanks
Chiranjeevi
0 Kudos