.NET 4 Beta 2 clickonce failure

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

.NET 4 Beta 2 clickonce failure
 
Yuri Astrakhan




Posts: 53
Joined: 2006-05-19
Hi, the Excel add-in project registers and works fine from Visual Studio 2010 Beta 2 (.Net 4), but publishing it as a clickonce deployment fails to install. The loader is the latest beta version 5.0.2026.

What are the steps to configure a new setup project for this?

Application Domain: DefaultDomain
Assembly Codebase: file:///C:/Users/.. ./AppData/Local/Apps/2.0/9G5HQA5P.8XZ/HOO6HJ4L.RT6/hort..d-in_ed655cba97cf17be_0002.0000_852c6a3804f83269/adxlauncher.exe
Assembly Full Name: adxlauncher, Version=5.2.2024.2005, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version: 5.2.2024.2005
Assembly Build Date: 7/17/2005 1:06:50 AM

Exception Source: mscorlib
Exception Type: System.BadImageFormatException
Exception Message: Could not load file or assembly 'myAddin' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Exception Target Site: _nLoad

---- Stack Trace ----
System.Reflection.Assembly._nLoad(fileName As AssemblyName, codeBase As String, assemblySecurity As Evidence, locationHint As Assembly, stackMark As StackCrawlMark&, throwOnFileNotFound As Boolean, forIntrospection As Boolean)
adxlauncher.exe: N 00000 (0x0) JIT
System.Reflection.Assembly.nLoad(fileName As AssemblyName, codeBase As String, assemblySecurity As Evidence, locationHint As Assembly, stackMark As StackCrawlMark&, throwOnFileNotFound As Boolean, forIntrospection As Boolean)
adxlauncher.exe: N 0011 (0xB) IL
System.Reflection.Assembly.InternalLoad(assemblyRef As AssemblyName, assemblySecurity As Evidence, stackMark As StackCrawlMark&, forIntrospection As Boolean)
adxlauncher.exe: N 0115 (0x73) IL
System.Reflection.Assembly.InternalLoad(assemblyString As String, assemblySecurity As Evidence, stackMark As StackCrawlMark&, forIntrospection As Boolean)
adxlauncher.exe: N 0083 (0x53) IL
System.AppDomain.Load(assemblyString As String)
adxlauncher.exe: N 0000 (0x0) IL
AddinExpress.MSO.ADXLoaderSupport.ClickOnceRegistrationService_2(register As Boolean, assemblyIdentity As String, showExceptions As Boolean, closeProgress As EventHandler, flags As Int32)
adxlauncher.exe: N 0481 (0x1E1) IL
Posted 02 Dec, 2009 12:43:21 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Yuri.

Please compile your project for .NET v2.0 - v3.5. It should fix the issue.
Posted 03 Dec, 2009 05:11:44 Top
Yuri Astrakhan




Posts: 53
Joined: 2006-05-19
I wish I could :)

Unfortunately other team members are heavily using c# 4 features (default parameter values, covariance, etc) in their libraries which I need.

I have created a setup package which seems to work ok. Do you have any estimate on when the adxlauncher.exe will be capable of running in .NET 4?

Thanks!
Posted 03 Dec, 2009 11:11:37 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Yuri, I am not sure but most likely we will not rebuild our ClickOnce solution for .NET 4.0 as we are going to add a new Web Deployment solution to all our products. As to the issue, please try to use a config file for the adxlauncher (adxlauncher.exe.config) so that it loads .NET v4 instead of v2.0. I haven't tested it but I think it should work.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0.21006"/>
</startup>
</configuration>
Posted 03 Dec, 2009 12:18:35 Top
Yuri Astrakhan




Posts: 53
Joined: 2006-05-19
Thanks, it worked!

My steps: added adxlauncher.exe.config, set its copy property to "copy if newer", and made sure its included in the publish wizard's list.
Posted 03 Dec, 2009 14:13:16 Top
Andrei Smolin


Add-in Express team


Posts: 14129
Joined: 2006-05-11
Thank you, Yuri!

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 04 Dec, 2009 04:05:04 Top
Yuri Astrakhan




Posts: 53
Joined: 2006-05-19
Unfortunately found a related issue: BadImageFormatException while uninstalling a clickonce program from control panel. After this error message, it said that everything was successful.

Application Domain: ADXUnreg: ed20bc68-c379-4dbe-bb5a-ef36ca1a4297
Assembly Codebase: file:///C:/Windows/assembly/GAC_MSIL/AddinExpress.MSO.2005/5.2.2024.2005__4416dd98f0861965/AddinExpress.MSO.2005.dll
Assembly Full Name: AddinExpress.MSO.2005, Version=5.2.2024.2005, Culture=neutral, PublicKeyToken=4416dd98f0861965
Assembly Version: 5.2.2024.2005
Assembly Build Date: 7/17/2005 1:06:50 AM

Exception Source: mscorlib
Exception Type: System.BadImageFormatException
Exception Message: Could not load file or assembly 'HpXLAddin' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Exception Target Site: _nLoad

---- Stack Trace ----
System.Reflection.Assembly._nLoad(fileName As AssemblyName, codeBase As String, assemblySecurity As Evidence, locationHint As Assembly, stackMark As StackCrawlMark&, throwOnFileNotFound As Boolean, forIntrospection As Boolean)
AddinExpress.MSO.2005.dll: N 00000 (0x0) JIT
System.Reflection.Assembly.nLoad(fileName As AssemblyName, codeBase As String, assemblySecurity As Evidence, locationHint As Assembly, stackMark As StackCrawlMark&, throwOnFileNotFound As Boolean, forIntrospection As Boolean)
AddinExpress.MSO.2005.dll: N 0011 (0xB) IL
System.Reflection.Assembly.InternalLoad(assemblyRef As AssemblyName, assemblySecurity As Evidence, stackMark As StackCrawlMark&, forIntrospection As Boolean)
AddinExpress.MSO.2005.dll: N 0120 (0x78) IL
System.Reflection.Assembly.InternalLoad(assemblyString As String, assemblySecurity As Evidence, stackMark As StackCrawlMark&, forIntrospection As Boolean)
AddinExpress.MSO.2005.dll: N 0083 (0x53) IL
System.AppDomain.Load(assemblyString As String)
AddinExpress.MSO.2005.dll: N 0002 (0x2) IL
AddinExpress.MSO.ADXLoaderSupport.ClickOnceRegistrationService_2(register As Boolean, assemblyIdentity As String, showExceptions As Boolean, closeProgress As EventHandler, flags As Int32)
AddinExpress.MSO.2005.dll: N 0481 (0x1E1) IL
Posted 04 Dec, 2009 11:09:26 Top
Yuri Astrakhan




Posts: 53
Joined: 2006-05-19
Sergey or Andrei, any ideas on this issue? True, its not as important as installing, but I'm worried that updates might fail unexpectedly.
Posted 08 Dec, 2009 10:03:28 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Yuri.

I get the same result. I will try to fix it in the next build. It will be published in January.
Posted 08 Dec, 2009 11:38:30 Top