4

I'm developing a sample where I use Octopus Deploy to configure and create a clickonce package upon installation and I'm having some problems using mage.exe on the 'production' machine. I've included mage.exe and mageui.exe, but I get the following error when using mage.exe

ERROR:

Unhandled Exception: System.TypeLoadException: Could not load type 'System.Reflection.AssemblySignatureKeyAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
2013-03-05 20:28:12 INFO     ERROR:    at System.ModuleHandle.ResolveMethod(RuntimeModule module, Int32 methodToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount)
2013-03-05 20:28:12 INFO     ERROR:    at System.ModuleHandle.ResolveMethodHandleInternalCore(RuntimeModule module, Int32 methodToken, IntPtr[] typeInstantiationContext, Int32 typeInstCount, IntPtr[] methodInstantiationContext, Int32 methodInstCount)
2013-03-05 20:28:12 INFO     ERROR:    at System.ModuleHandle.ResolveMethodHandleInternal(RuntimeModule module, Int32 methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
2013-03-05 20:28:12 INFO     ERROR:    at System.Reflection.CustomAttributeData..ctor(RuntimeModule scope, CustomAttributeRecord caRecord)
2013-03-05 20:28:12 INFO     ERROR:    at System.Reflection.CustomAttributeData.GetCustomAttributes(RuntimeModule module, Int32 tkTarget)
2013-03-05 20:28:12 INFO     ERROR:    at System.Reflection.CustomAttributeData.GetCustomAttributesInternal(RuntimeAssembly target)
2013-03-05 20:28:12 INFO     ERROR:    at System.Reflection.RuntimeAssembly.GetCustomAttributesData()
2013-03-05 20:28:12 INFO     ERROR:    at System.Reflection.CustomAttributeData.GetCustomAttributes(Assembly target)
2013-03-05 20:28:12 INFO     ERROR:    at System.Resources.ManifestBasedResourceGroveler.GetNeutralResourcesLanguage(Assembly a, UltimateResourceFallbackLocation& fallbackLocation)
2013-03-05 20:28:12 INFO     ERROR:    at System.Resources.ResourceManager.CommonSatelliteAssemblyInit()
2013-03-05 20:28:12 INFO     ERROR:    at System.Resources.ResourceManager..ctor(Type resourceSource)
2013-03-05 20:28:12 INFO     ERROR:    at MageCLI.Application.get_Resources()
2013-03-05 20:28:12 INFO     ERROR:    at MageCLI.Application.InternalError(String message, String stackTrace)
2013-03-05 20:28:12 INFO     ERROR:    at MageCLI.Application.Main(String[] args)

So my question is what dependencies are needed to run mage.exe, without installing the .NET Framework SDK?

jaspernygaard
  • 3,098
  • 5
  • 35
  • 52

1 Answers1

3

I managed to figure out the problem using FUSLOGVW.exe. I've copied mage.exe and mageui.exe from .NET Framework 4.5, which is not installed in a Windows 2008 Server by default. Taking mage from .NET 4.0 solved the problem.

jaspernygaard
  • 3,098
  • 5
  • 35
  • 52
  • I've been working on a clickonce script, which might interest you. https://github.com/jonnii/BuildDeploySupport/blob/master/package/tools/deploy/ClickOnce.ps1 – jonnii Mar 17 '13 at 16:23
  • Excellent! I'll take a look. I've also created a sample application at bitbucket - https://bitbucket.org/jnus/clickonceandoctopusdeploy – jaspernygaard Mar 19 '13 at 08:09
  • Also, why are you creating a click once package with octopus? I think that's something that should be done by the build server. – jonnii Mar 20 '13 at 00:21
  • 1
    We want to build the clickonce app just once, and deploy the exact same binaries to multiple environemnts with different configuration (e.g. preprod, qa, prod) - eventually deploying to production. This is also what Octopus Deploy does, since the same release package is used for all environments. Makes good sence, but CO is kind of outdated in that way. – jaspernygaard Mar 26 '13 at 16:07
  • What we're doing is building the binaries once (using teamcity) and then in team city we have different build configurations to take the artifacts from the continuous build and create the click once package. We need to be able to do side by side installs, so you can't use the same click once package as the identity has to be different (we actually use different keys for each environment). – jonnii Mar 26 '13 at 16:55
  • We might run into problems with having side by side installations - haven't quite figured that one out. What version of mage.exe do you use with your build script? Tried different versions and with the latest (v8.0A\bin\NETFX 4.0 Tools), I get manifest error when installing the CO. – jaspernygaard Apr 01 '13 at 14:52
  • I use the one in this path: "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools". I haven't tried the one in v8.0A yet. It's possible that there are differences, I will try and get back to you. – jonnii Apr 01 '13 at 16:52