New iOS MVVMCross project - which Nuget package and/or PCL targets? - ios

We are creating a new iOS project. I want to use the Universal API so pretty sure I need to switch to Xamarin Beta channel and pull the prerelease of MVVMCross.
However when I try and add the MVVMCross package to a fresh PCL I get
Could not install package 'MvvmCross.PortableSupport 3.5.0-beta1'. You
are trying to install this package into a project that targets
'portable-net45+sl50+Xamarin.iOS10+MonoAndroid10+MonoTouch10', but the
package does not contain any assembly references or content files that
are compatible with that framework. For more information, contact the
package author.
The error looks simple enough but those compatibility errors from NuGet are never as simple as they look
The PCL is targetting
.NET 4.5
Silverlight 5
Xamarin Android
Xamarin.iOS
Xamarin.iOS (Classic)
Which targets do I need to change so I can add the correct MVVMCross to build Universal iOS

It looks like Your challenge is supporting Silverlight 5 - sl50
All the other platforms you list will support modern PCL profiles like 78 and 259. However, Microsoft haven't built any Silverlight support for these profiles.
This dropping of the "older profiles" is why MvvmCross dropped the old WindowsPhone support - announced back in July 2013 http://slodge.blogspot.co.uk/2013/07/mvvmcross-wp7-tombstoned.html

I fixed the problem you had. I managed to fix it without hacking csproj. I couldn't deselect Silverlight 5. I selected Windows 8 target and then I was able to deselect Silverlight 5.

Related

Xamarin Android use “Bundle assemblies into native code” and "obfuscation"

I am trying to combine obfuscating my xamarin android project and then bundle the assemblies into native code with the Visuals Studio 2017 Pro option.
I was able to obfuscate my assemblies with this tutorial https://blog.noser.com/xamarin-android-code-obfuscation/
Unfortunately the obfuscated assemblies does not find its way into the native bundle.
Likely i intercepted the build proccess at the wrong place.
<Target Name="Obfuscate" AfterTargets="_CopyIntermediateAssemblies" Condition="'$(Configuration)' == 'Release'">
Does anyone know how to merge the obfuscated assemblies into the native bundle? Thx for help in advance.
I help develop another .NET obfuscation/protection tool, Dotfuscator.
We've written a Xamarin build integration that automatically handles protection as part of the normal build process, so you don't have to manually write your own MSBuild targets or copy files around.
The official Xamarin docs recommend using Dotfuscator to protect Android builds, but this integration also works for iOS and UWP.
As Dotfuscator's Community Edition is included in Visual Studio, you can try this integration out for free.
I wrote a guest post for the Xamarin Blog that explains how to do this.
Edit regarding the setting in the question: I did some limited testing and Dotfuscator works fine with the "Bundle assemblies into native code" setting. I installed the latest version of Visual Studio 2017 Enterprise, version 15.7.2, but found out that version has a bug related to this setting. To work around it, I used the unofficial VSIX install mentioned at that link. Then I opened a Dotfuscator-Xamarin sample app and enabled the native code setting. I also added code to the sample to show the name of a class used by the application. Then I deployed the app to an emulator. The app ran normally and the logging statement showed an obfuscated name for the class, indicating that Dotfuscator correctly protected the app before it was bundled into native code.

Location of Resharper SDK project template and samples

I am trying to write a plugin for Resharper 8.1. The online SDK documentation makes reference to a Visual Studio project template and list of sample projects. I cannot seem to locate them. They are not downloaded as part of the Resharper 8.1 SDK NuGet package, and although I have found several links that claim to take you to the download page for the Resharper SDK, they only take you here:
https://www.jetbrains.com/resharper/download/
This has a link to the Resharper SDK on this page, but that only takes you to the NuGet repository (and once again the NuGet package does not appear to contain the project templates or samples).
You can download the old 8.x SDKs from this site. The SDKs include the old samples projects.
I haven't updated the samples to 9.0 yet - they'll be uploaded to JetBrains' GitHub page once I've done it.

Update to Xamarin touch 8.2 and use mvvmcross

We are using xamarin and mvvmcross with great plesure normmally.
However I updated our project to the newest Xamarin.Ios 8.2, changed the reference from monotouch to Xamarin.Ios updated all our nuget packages (only mvvmcross packages) and then sh.. hit the fan.
1000 errors :P I got ridth of them all, however everytime I am using a component from mvvmcross it want me to reference 'module monotouch should be referenced.
Any suggestion for what I am needing to get my project to build again.
Regards
Xamarin's advice on the unified API is http://blog.xamarin.com/is-the-ios-unified-api-for-me/
Unfortunately, existing Xamarin.iOS components need to be re-built against the Unified API, so while we (and the community) are working to update the component code, you will not be able to include these in your app. A workaround for open-source projects is to download and compile the code yourself as part of your Unified API project.
#lothrop is doing a superb job leading the Unified API development for MvvmCross
You can see the progress, build it and contribute to it on https://github.com/MvvmCross/MvvmCross/pull/813 (and see a discussion on https://github.com/MvvmCross/MvvmCross/issues/801)
Currently I believe the progress is pretty good - it's working - but we have some VisualStudio Xamarin blockers which are preventing this being pushed to release.
Getting more dev effort on this - more input to https://github.com/MvvmCross/MvvmCross/pull/813 and https://github.com/MvvmCross/MvvmCross/issues/801 - would certainly be appreciated. e.g. the community can help by building and using #lothrop's code - does it work for them?

Windows Phone 8.1 with DirectXTK

When I try to add a reference (DirectXTK) to my native part of the WP8.1 project I got the following message: A reference to 'DirectXTK' cannot be added because the two projects target different platforms.
Anyone experienced this behavior before?
My project is based on DirectX and XAML App (Windows Phone Silverlight 8.1) app template
This has been answered on the CodePlex.
In short, you have to create a "Static Library (Windows Phone Silverlight 8.1)" project for DirectXTK.

Can't install MVVMCross on PCL project

After I create a PCL project in VS2012 with the following configuration:
I try to add MVVMCross through Nuget installation, but the process rolls-back with this error:
I'm trying to install Hot Tuna Starter Pack for that matter.
I have installed Xamarin trial version a week ago.
Is this a Xamarin error supporting PCLs?
Your screenshots show that you have a VSMonoTouch PCL hack in place - it's likely that will be causing issues - especially with net10 shown in the nuget log there. Try removing your VSMonoTouch XML files and then creating new projects for test.
Here is a setup that currently works for me - http://slodge.blogspot.ca/2013/04/my-current-pcl-setup-in-visual-studio.html
Note: It's likely that this post won't remain in-date for very long - Xamarin are releasing their PCL implementations at the moment.

Resources