visualstudio-wakatime: VisualStudio WakaTime extension on M1 ARM doesn't work

Hi,

I just upgraded to Visual Studio 2022 on MacBook Pro M1 Max (ARM) using Parallels.

Unfortunately, WakaTime extension throws an error every time I open Visual Studio. Here are the details:

Create Instance failed for package [WakaTimePackage] Source: 'mscorlib' Description: Could not load file or assembly 'file:///c:\users\test\appdata\local\microsoft\visualstudio\17.0_45d60efe\extensions\44g3sfld.gyw\WakaTime.Dev17.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. System.BadImageFormatException: Could not load file or assembly 'file:///c:\users\test\appdata\local\microsoft\visualstudio\17.0_45d60efe\extensions\44g3sfld.gyw\WakaTime.Dev17.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'file:///c:\users\test\appdata\local\microsoft\visualstudio\17.0_45d60efe\extensions\44g3sfld.gyw\WakaTime.Dev17.dll' at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence) at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo) at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName) WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Is there any workaround for this and when can we expect official support for ARM processors?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 19 (8 by maintainers)

Most upvoted comments

@alanhamlett and @leemcmullen šŸ‘

I just tried the feature/arm64 branch. THANK YOU!!!

Can you share the process?

For anyone else looking for an answer, here’s what I did:

  1. Clone the repo
  2. Checkout branch feature/arm64
  3. Clean solution
  4. Build project Dev17 (for VS 2022)
  5. Find the installer in bin\arm64\Debug

Once installer is finished, you WakaTime should prompt you for an API key.

@alanhamlett @gandarez @tpesl

Ok, good news, I’ve got it working in VS Community 2022 (ARM 64-bit) version 17.4.2 running on Windows 11 within Parallels on a MBP M1 šŸŽ‰šŸŽ‰

I did the following steps in this order. Caveat: I’ve never done any extension dev and was just feeling my way around in the dark really! So some of this might not have been/probably wasn’t required/necessary šŸ˜‚:

  • Cloned the repo and opened it in VS version above
  • Was getting a whole bunch of errors on the Dev14 proj so unloaded it
  • Focused on Dev17 proj only (assumed the ā€œ17ā€ here aligns with VS version it’s going to be installed in)
  • Added following entry within ā€œsource.extension.vsixmanifestā€ -> ā€œInstall Targetsā€:
    • Identifier: Microsoft.VisualStudio.Community, VersionRange: [17.0,18.0), Product Architecture: arm64
  • Build now failed mentioning product enum issue. Updated all nuget packages to latest versions
  • Now building ok, same loading issue once installed though
  • Updated TargetFramework to 4.8.1
  • Added the following to the csproj file:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|arm64'">
  <DebugType>full</DebugType>
  <PlatformTarget>ARM64</PlatformTarget>
  <OutputPath>bin\arm64\Debug\</OutputPath>
  <DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
  • Went to Configuration Manager and changed the Platform for Debug -> Dev17 to arm64
  • It started showing a warning about a <RuntimeIdentifiers> entry so added the following to the bottom of the csproj:
<PropertyGroup>
  <RuntimeIdentifiers>win-arm64;</RuntimeIdentifiers>
</PropertyGroup>
  • Clean, Build
  • Close VS. Double click the generated vsix within the bin\arm64\Debug directory to install
  • Next time I opened VS, I was prompted for my API Key. One odd thing here actually, I copied my API key from my dashboard settings and it has a waka_ prefix before the rest which looks like a GUID. Copying it with the waka_ prefix didn’t work, an error was returned about an invalid key (sorry didn’t note the actual message). I removed the waka_ prefix though and it was accepted
  • Clicked around in some files, made some edits and observed data coming through to my dashboard šŸŽ‰šŸŽ‰

No idea how this should be worked into the actual repo etc but hopefully it’s useful information and might help some others get unstuck.