Xamarin.iOS : “Failed to compile the generated registrar code” on Visual Studio for Mac

If you have recently upgraded your XCode version to 14.0, and installed the XCode command line tools too, you will probably notice some error messages when trying to run your Xamarin.Forms, or iOS application from Visual Studio for Mac.

Error MT4109: Failed to compile the generated registrar code.

What actually helped me, is this:
Navigate to https://developer.apple.com/download/all/ and search for Command Line Tools for Xcode 13.4 and Xcode 13.4. Both downloads are big, the XCode itself around 10GB and the CL Tools are around 1GB, so definitely do not do this on metered connections.

Once the downloads are ready, open the XCode.XP file with the Package Archiver, let it extract to downloads, then move it to Applications folder.

After that, install CL tools. Follow the installer’s instructions.

Boom, it’s solved. Issue reported at: https://github.com/xamarin/xamarin-macios/issues/15954

This content has 2 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

Xamarin.UWP FontImageSource does not get displayed

You may have noticed that if you give an image a FontImageSource, the image does not display properly on the UWP platform. This is probably because the default value of the FontImageSource Color property is white, and you probably want to draw it white. Check if you are giving an explicit value to the Color property. If not, try it.

				            <Image>
					            <Image.Source>
                                    <FontImageSource 
                                                    FontFamily="FontIcons"
                                                    Color="Black"
                                                    Glyph="?"
                                                    Size="25" />    
                                </Image.Source>
				            </Image>
This content has 2 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

Forms.RecurrenceToolkit is discontinued

Just as Xamarin.Forms is changing to a .NET MAUI, banditoth.Forms.RecurrenceToolkit will also undergo a change. As of today, I do not plan to develop any new functionality in the aforementioned package. Some parts of the package will be developed for .NET MAUI compatibility. You will be able to find the new packages in the future with the banditoth.MAUI prefix, which will also be available on GitHub.
I would like to thank you for the more than 2700 downloads.
Bug fixes will continue to be made, so if someone actually uses this for a live application, in that case no worries.

Let’s look at some statistics. The most popular package was MVVM with a total of 623 downloads. This was followed by the Logging package with 459 downloads. The Multilanguage and Converters packages were similarly successful, with around 430 downloads.

I will be back soon with MAUI packages 😉

This content has 2 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

Xamarin.UWP: Image from embedded resource throws “Operation is not supported on this platform” error

If you are getting the error “Operation is not supported on this platform” when you are trying to set an ImageResource from file for an image on Xamarin.UWP, then the problem comes from this line of code:

IconSource = ImageSource.FromResource("afolder.animage.jpg");

The solution: Image as Embadded Ressource shows “operation is not supported on this platform” in UWP and Release (microsoft.com)
In a short brief: You need to use the second parameter for FromResource method call. You must pass an assembly in order to success on UWP platform. iOS and Android is not affected with this error.

IconSource = ImageSource.FromResource("afolder.animage.jpg", typeof(AClassFromTheAssembly).Assembly);
This content has 2 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

Xamarin.UWP DryIoC error: Code generation not supported on this platform

If you are getting the following error when using DryIoC with Xamarin.Forms on UWP:

System.PlatformNotSupportedException: Dynamic code generation is not
supported on this platform.
at System.Reflection.Emit. TypeBuilder.GetMethod (Type, Methodinfo) + 0x2d
at
Dryloc.FastExpressionCompiler.LightExpression.ExpressionCompiler.CompileNoA
rgsNew(Constructorlnfo, Type, Type[, Type) + 0x5b
at
Dryloc.FastExpressionCompiler.LightExpression.ExpressionCompiler.TryCompileB
oundToFirstClosureParam(Type, Expression, IParameterProvider, Typel, Type.
CompilerFlags) + 0x73
at Dryloc.FactoryDelegateCompiler.CompileToFactoryDelegate(Expression.
Boolean) + 0x14c
at Dryloc.Container.Dryloc.IResolver.Resolve(Type, IfUnresolved) + 0x23c

Then instantiate your container with this code:

Container = new Container(rules =>
{
    // https://github.com/dadhi/DryIoc/blob/master/docs/DryIoc.Docs/ResolutionPipeline.md
    return rules.WithUseInterpretation();
});

The reason why you need to do this is here: DryIoc/ResolutionPipeline.md at master · dadhi/DryIoc · GitHub

This content has 2 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.