Build of Xamarin iOS app fails on VS for Windows when using dynamic version of BlackBerry Dynamics SDK - xamarin.ios

We are currently switching from the static version of BlackBerry Dynamics SDK for Xamarin iOS to the new dynamic version. As far as I understand now GoodDynamics.iOS.dll does not contain all the resources anymore, but instead references the contents of the folder "GoodDynamics.iOS.resources" which has to be in the same folder as the dll.
The problem is that the native linking fails when trying to build Xamarin iOS apps using that new library on Visual Studio for Windows (paired to a Mac build agent).
Here's what I did:
Downloaded the BlackBerry Dynamics SDK for Xamarin iOS version 10.1.0.663
Extracted the "Examples" solution from there and loaded it into Visual Studio
Adjusted the bundle id in the "info.plist" in one of the projects to fit our provisioning profile, so it can be signed
Build the project
Result: Using Visual Studio on Mac OS it builds fine. But when I try to build it from Windows with Visual Studio paired to a Mac build agent I get the following messages/error in the build output:
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(235,3): warning MT1302: Could not extract the native library 'libGD_CPPWrapper.a' from '/Users/{UserName}/Library/Caches/Xamarin/mtbs/builds/GreetingsClient/dafdd80e9da4129fe5916d9283ff66211b655dba54eca9615ebdc599e5fa50eb/obj/iPhone/Debug/mtouch-cache/libGD_CPPWrapper.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary').
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(235,3): error : no such file or directory: '/Users/{UserName}/Library/Caches/Xamarin/mtbs/builds/GreetingsClient/dafdd80e9da4129fe5916d9283ff66211b655dba54eca9615ebdc599e5fa50eb/obj/iPhone/Debug/mtouch-cache/libGD_CPPWrapper.a'
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(235,3): error : clang: error: no such file or directory: '/Users/{UserName}/Library/Caches/Xamarin/mtbs/builds/GreetingsClient/dafdd80e9da4129fe5916d9283ff66211b655dba54eca9615ebdc599e5fa50eb/obj/iPhone/Debug/mtouch-cache/libGD_CPPWrapper.a'
Note: I exchanged the real user name by {UserName} in the above log lines.
So it seems it cannot find the contents of that GoodDynamics.iOS.resources folder where the 'libGD_CPPWrapper.a' and the xcframework folders are located. These don't even seem to get copied to the build Mac. Any ideas how I should adjust the build process so it can be built from Windows too?

Related

Installed Custom Visualizer not loading in VS2022

I am trying for some hours to install a custom visualizer in VS2022. Basically it is a simple string visualizer that opens a wpf form.
I followed this: https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-install-a-visualizer?view=vs-2022
But the instructions do not seem to work.
When the visualizer and the test console app are in the same solution, the visualizer works, shows up. Everything is alright, but that is not of too much help
What I have tried until now, but without success:
Copy all visualizer dlls in C:\Users\XXXX\Documents\Visual Studio 2022\Visualizers
Copy all visualizer dlls in C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers
Checked on multiple projects, some targeting .NET Framework 4.7.2, some .NET 6
Checked on one of my colleagues pc, also with VS2022
Copied all dlls to a folder here(where I found DataSetVisualizer and IEnumerableVisualizer): C:\Program Files\Microsoft Visual
Studio\2022\Professional\Common7\IDE\CommonExtensions\Platform\Debugger\
Run devenv /ResetSettings from an admin console
Run devenv /resetskippkgs from an admin console
Run Visual Studio as administrator
Checked in Debug => Windows => Modules to see if the custom dll is loaded
Do you guys have any idea what should I try? Or what could be the problem?
Did any of you succeeded in running a custom visualizer in VS2022
Thank you
So, after some days, and many hours of trial and error, I could finally install and see my custom visualizer.
Basically, what I have done and (I think) it solved the issues:
Cleaned up all the dlls from "C:\Users\XXXX\Documents\Visual Studio 2022\Visualizers" and all of its subfolders corresponding to .net framework versions
Checked that my visualizer corresponds to the correct type:
[assembly: DebuggerVisualizer(
typeof(DebuggerSide),
typeof(TextChunkObjectSource),
Target = typeof(IEnumerable),
Description = "PDF Visualizer")]
Don't put List<TextChunk>, or IReadOnlyList<TextChunk>, instead of IEnumerable<TextChunk>
Delete bin folder(s) and rebuild the visualizer project
Make sure to copy the dlls in all the needed folders:
I had to copy them here:
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers\
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers\netstandard2.0\
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\Packages\Debugger\Visualizers\netcoreapp\

Visual Studio extension conflict when removing a project

After I save the changes of a solution and then remove an existing project, I'll get the following error message:
The operation could be completed. Not implemented.
Then I launched devenv.exe /Log and able to reproduce the problem and the errors are:
Extension will not be loaded because an extension with the same ID &apos;Microsoft.Windows.DevelopmentKit.Desktop&apos; is already loaded at
C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT\EXTENSIONMANAGER\EXTENSIONS\MICROSOFT\WINDOWS KITS\8.0\DESKTOP SDK\
C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT\EXTENSIONMANAGER\EXTENSIONS\MICROSOFT\WINDOWS KITS\8.1\DESKTOP SDK\
Extension will not be loaded because an extension with the same ID &apos;Microsoft.WinJS&apos; is already loaded at
C:\PROGRAM FILES (X86)\MICROSOFT SDKS\WINDOWS\V8.1\EXTENSIONSDKS\MICROSOFT.WINJS.SHARED\VSIX\
C:\PROGRAM FILES (X86)\MICROSOFT SDKS\WINDOWS\V8.0\EXTENSIONSDKS\MICROSOFT.WINJS.SHARED\VSIX\
It looks like it's trying to load two extensions but with different versions. I believe they are the Microsoft Advertising SDK for Windows 8.1 and Microsoft Advertising SDK for Windows Phone 8.1 but even if I launch VS 2012 with Admin, the Uninstall button is greyed out for me. I don't see them in the Add/Remove Programs either. So how can I get rid of this error?
A side note, I have both VS 2012 and VS 2013 installed and I had to do a repair on VS 2012 after VS 2013 was installed.
I had the same problem with Microsoft Windows Development Kit: two errors every time at Visual Studio start with description in the
%AppData%\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml
Sometimes (I think every time) Visual Studio Updater or Installer (when you try to install other version of VS) does not remove already installed version of a VS module.
In my case I had the second WDK with older version but installed after the newer one. I manually uninstalled the older version of Microsoft Windows Development Kit and problem with Visual Studio was solved.

How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK?

I use Visual Studio 2012 and this is the only version of Visual Studio I have installed. I need to build certain C++ projects with the v90 platform toolset (of Visual Studio 2008), but I can't install Visual Studio 2008.
I understand it is possible to use the v90 platform toolset by installing Windows SDK 7.0. How exactly is it done? If I simply use the web installer of 7.0 SP1, I still don't see v90 as one of the possible platform toolsets.
It is possible, but apparently requires some maneuvering and will not support building MFC applications. The following assumes that VS2012 update 4 is installed, but neither VS2010 nor VS2008 are installed.
Download the x86 DVD of SDK 7.0 SP1 (GRMSDK_EN_DVD.iso). Mount the ISO or extract its contents, and manually install the MSI files from the following folders under the Setup folder:
WinSDK (this may fail, it's ok)
WinSDKBuild
WinSDKInterop
WinSDKTools
WinSDKWin32Tools
vc_stdx86
vc_stdamd64
winsdk_intellidocs
WinSDKIntellisenceRefAssys
WinSDKNetFxTools
Download the x86 DVD of SDK 7.1 (GRMSDK_EN_DVD.iso). Mount the ISO or extract its contents, and manually install the MSI files from the same folders listed above (except winsdk_intellidocs, which doesn't exist).
Go to C:\Program Files (x86)\Microsoft Visual Studio 9.0. Copy the following files from Common7\IDE to VC\bin:
msobj80.dll
mspdb80.dll
mspdbcore.dll
mspdbsrv.exe
Now you should be able to choose the v90 platform toolset in Visual Studio 2012 and build with it.
Explanations (and sources):
Individual MSI installation is based on the second workaround from this connect report.
The requirement for both 7.0 and 7.1 is based on this question (both VS2010 and VS2008 are required to use v90 in VS2012!). SDK 7.1 is not needed if you have VS2010.
DLL/EXE copying requirement is based on yet another question. If you do not copy them, you will see error MSB6006: "CL.exe" exited with code -1073741515.
In addition to this answer I want to add that
You can install SDK 7.0 simply by running setup, there is no problem with it.
You can install SDK 7.1 by running setup, if you remove Microsoft Visual C++ 2010 Redistributables first and fix following registry values:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client]
"Version"="4.0.30319"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full]
"Version"="4.0.30319"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Client]
"Version"="4.0.30319"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v4\Full]
"Version"="4.0.30319"
You can (and probably should) restore these values to whatever they originally were after installation is complete.
Do not forget to install KB2519277 after this, it updates compilers in SDK 7.1 to SP1.
You don't need to copy any dll. MSBuild uses
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC#ProductDir
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VC#ProductDir
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VS#ProductDir
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Setup\VS#ProductDir
to set up paths. It's probably wise to fix them to point to "C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\" and "C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\" as it might be useful elsewhere in build process.
Same goes for version 10.0 if you plan to use Windows7.1SDK toolset.
Use WindowsSdkVer.exe to set current SDK to 7.1 to defeat cryptic error in Microsoft.Cpp.x64.Targets(63,5) about missing unnamed required file. If the tool gives you error, then set these values manually:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows#CurrentInstallFolder
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows#CurrentInstallFolder
to point to newly installed SDK. The tool needs some registry keys from Visual Studio installation to work properly, but there are many and I'm not sure which are important.
Reboot. None of the above asks you to, but without reboot I got errors when trying to build a project.
As an aside, SDK7.1 adds v100 toolset, but it won't work, saying something about Could not find WindowsSDKDir variable from the registry. This is because v100 actually requires SDK7.0A which comes with Visual Studio 2010 and is not available separately. Windows7.1SDK toolset is the one which utilises VC2010 compilers if you need them.
Microsoft.Cpp.Win32.*.props files have a lot of relevant stuff if something fails in build system.
One addition/update for VS2013 to Yodans answer:
My working setup:
VS2013 has to use VS2010 libs
Using WinSDK 7.1 (Yodans 2.) build tools (v100) in VS2013
clean install, uninstalling everything mentioned in the sdk release notes (can be downloaded at http://www.microsoft.com/en-us/download/details.aspx?id=8279 under category Details)
Microsoft Windows SDK for Windows 7 (7.1) (the Windows SDK core-component files)
Application Verifier
Debugging Tools for Windows
Windows Performance Toolkit
Microsoft Help Viewer 1.0
Microsoft Visual C++ 2010 Redistributable
Microsoft Visual C++ 2010 Standard Edition
Additionally removed all .NET and VC++ related MS Software (not tested if necessary)
choosing Windows7.1SDK as Platform Toolset in VS2013
error MSB6006: "CL.exe" exited with code -1073741515
cl.exe uses msobj100.dll, mspdb100.dll, mspdbcore.dll and mspdbsrv.exe
Added to PATH C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
Build works and binary is usable ( So now its tested Yodan ;-) )
My mistake:
copied files in 7. above to C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin (Yodans 3.), believing this dir is in PATH, but it was not!
So better do as sugested by Yodan and tested by myself in 8. above
p.s. same answer is solving this problem:
Visual Studio 2013: CL.exe exited with code -1073741515

PhoneGap add wp8 platform requires MSBuild x86

When trying to add the wp8 platform to a project, using:
phonegap local build wp8
It fails. Requiring msbuild x86.
C:\Program Files (x86)\MSBuild\Microsoft\WindowsPhone\v8.0\Microsoft.WindowsPhon
e.v8.0.Overrides.targets(15,9): error : Building Windows Phone application using
MSBuild 64 bit is not supported. If you are using TFS build definitions, change
the MSBuild platform to x86. [C:\funiz\platforms\wp8\Funiz.csproj]
ERROR: MSBuild failed to create .xap when building cordova-wp8 for debugging.
This is a Windows 8.1 machine, with Visual Studio Ultimate 2013, Update 2 RC.
The PATH environment variable is set to:
C:\Users\Yoram Kornatzky\AppData\Roaming\npm;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Windows\Microsoft.NET\Framework\v4.0.30319
I tried removing the Frame64 element from the PATH. But it still fails.
Any insight would be appreciated.
You haven't specified the build template you are using. But if you are using DefaultTemplate in your team build definition, change value of parameter "MSBuild Platform" from Auto to X86

Installing PlatformToolset v110 without installing Visual Studio 2012

We have a Visual Studio solution that contains some VC++ projects, and we've currently upgraded to Visual Studio 2012 from VS2010. In the process we also lifted the VC++ projects to PlatformToolset v110.
On our build server (Jenkins), we would like to build this project with MsBuild without having to install VS2012. But I can't get it to work, and I think it's because the folder C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110 must be present.
This folder and its contents is created during installation of VS2012, but as far as I can tell it won't be included in either the Windows SDK 7.1 or Windows SDK 8.0?
Is there any other SDK or installation package that can help with this issue?
I know it's not really without installing Visual Studio 2012, but:
If licensing costs are the biggest driver perhaps the Express for Windows Desktop edition could be an alternative. You could keep the installation to the minimum required to support C++ builds.

Resources