Unable to build project for all platforms

Add-in Express™ Support Service
That's what is more important than anything else

Unable to build project for all platforms
 
Steve Shannon




Posts: 18
Joined: 2011-03-18
Greetings,

In following your blog article on "Deploying per-user Office extensions via an MSI installer", step 2 mentions setting the "Platform target" property to "Any CPU" on the Build tab of the project properties window. However, this tab and Build Events do not appear for me, but rather I have a Compile tab with an "Advanced Compile Options" button. Here, I have specified the Target CPU to be "Any CPU", so I would imagine this done the same thing. I'm running Visual Studio 2010, so perhaps this accounts for the difference from the blog article.

However, the real issue occurs when I attempt to build the setup project. I receive the following warning:

"File 'adxloader64.dll' targeting 'x64' is not compatible with the project's target platform 'x86'"

When I select the setup project and look in the Solution Explorer, I see there's a property called TargetPlatform that is set to 'x86'. The only other options for this property are 'x64' and 'Itanium' -- there is no 'Any CPU' option. Do you know what I'm doing wrong? Is there a way to make this property include an 'Any CPU' option? Or is there a way to ignore this property so the build compiles correctly?

Any help is greatly appreciated!

Thanks in advance,
Steve
Posted 18 Mar, 2011 11:37:51 Top
Andrei Smolin


Add-in Express team


Posts: 18844
Joined: 2006-05-11
Hi Steve,

Steve Shannon wrote:
step 2 mentions setting the "Platform target" property to "Any CPU" on the Build tab of the project properties window. However, this tab and Build Events do not appear for me, but rather I have a Compile tab with an "Advanced Compile Options" button.


That's okay. You are using VB.NET and the article is based on a C# project.

Steve Shannon wrote:
However, the real issue occurs when I attempt to build the setup project. I receive the following warning:

"File 'adxloader64.dll' targeting 'x64' is not compatible with the project's target platform 'x86'"


Ignore that warning. It relates to the fact that your setup project contains both 32-bit and 64-bit loader versions and in this way your installer and your add-in don't depend on the Office version (and bitness) installed on the target PC.

Does it help?


Andrei Smolin
Add-in Express Team Leader
Posted 18 Mar, 2011 12:01:24 Top
Steve Shannon




Posts: 18
Joined: 2011-03-18
Ok, so does it matter what the TargetPlatform property is set to? If not, we can close this issue. Thanks for the swift response.

Best,
Steve
Posted 18 Mar, 2011 12:20:24 Top
Andrei Smolin


Add-in Express team


Posts: 18844
Joined: 2006-05-11
Hi Steve,

TargetPlatform of your setup project set to x64 will generate the installer which will be able to run on Windows 64-bit only. If you set it to x86, it will be run on 32-bit and 64-bit Windows.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Mar, 2011 13:00:30 Top
Paul Stickney




Posts: 38
Joined: 2010-02-08
I actually have -- and recommend, depending upon situation -- using two different MSI installers (and thus "Deployment Projects" in Visual Studio). One for Office 32-bit (x86, also used for 32-bit Office on 64-bit Windows) and one for Office 64-bit (x64, required 64-bit Windows). It is more tedious, yes, but there are some advantages:

1. The Registry Virtualization that occurs during the installation process is "correct" (32-bit or 64-bit view as appropriate). MSI files are either 32-bit or 64-bit. There is currently no such thing as a 32/64-bit MSI package. (`adxregistrator` jumps through some hoops to make sure this works correctly, however this doesn't affect the MSI installer itself).

2. Get rid of the warning about adxloader and makes each MSI ever-so-slightly smaller (although the combined size is larger, of course). The space saving is realized more the more "bitness specific" modules there are.

3. Ready to ship bitness-specific libraries and DLLs. I use a number of external DLLs which are platform-specific. Using two projects allows me to correctly include and deploy the correct files. This avoid having to deal with "Office bitness" within the MSI (32-bit Office can run on a 64-bit Windows). Because this isn't the same as the "target bitness" a MSM isn't as ideal to use.

Using a custom front-end setup (I use DotNetInstaller) and a "dispatcher" to call the correct MSI based on version of Office works well for me -- this is a "one exe solution" for end-users and an easy-to-administer MSI for corporate deployment. Then again, I only support MSI packages (no Click Once or Click Twice :-) and so this information may not be relevant in other contexts.

In the future I hope to switch to WIX which should make synchronization between both 32-bit and 64-bit MSI packages trivial.

Happy coding.
Posted 01 Apr, 2011 17:11:46 Top
Eugene Astafiev


Guest


Hi Paul,

Thank you for the detailed explanation. Please note that the adxregistrator.exe utility (which is used for registering Add-in Express based add-ins) is an x86 based exe. There is no need to use separate installers. Please read more about that in the http://www.add-in-express.com/creating-addins-blog/2011/02/22/deployment-office-extensions-overview/ article on our technical blog.
Posted 04 Apr, 2011 07:19:45 Top