Xamarin Error Fixed : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Severity Code Description Project File Line Suppression State
Error Unable to copy file … The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Xamarin IOS Project Deployment problem cause Windows Path/File too long. This is not a Xamarin or a Visual Studio problem, it is all about Windows Operating system limits. So follow these steps to solve that problem

  1. Windows + R
  2. type “regedit” end go
  3. Computer>HKEY_LOCAL_MACHINE>SYSTEM>CurrentControlSet>Control>FileSystem
  4. LongPathsEnabled
  5. Set Value = 1
  6. Apply and restart windows

It’s done !

Xamarin Error : Solved : Missing architecture. Apps built with Watch OS 5.0 and later SDKs must contain additional architectures

Getting Xamarin IOS Watch 5.1 Extension error

Missing architecture. Apps built with Watch OS 5.0 and later SDKs must contain additional architectures

And i think just solved it with reducing ipa file size with deleting .net core library in watch and extension projects. It worked for me.

How to add custom font in Xamarin.IOS designer UI WatchKit project

If you can’t see your custom font on Visual Studio designer and still see the Custom(not installed) or you can’t set your WKInterfaceLabel.Font property follow these steps,

  1. Add font file in to the Reference folder on your IOS project as “Font Awesome 5 Free-Solid-900.otf”,
  2. Edit Info.plist file come to source section and add Fonts provided by application property as Array and add your font name “Font Awesome 5 Free-Solid-900.otf” as string value,
  3. Then in designer you won’t see your font in custom option. Don’t worry you can’t fix that issue and won’t see it 🙂
  4. Come to your project and set your new custom font with using some coding
    var u = new UIKit.UIStringAttributes
    {
    Font = UIKit.UIFont.FromName("Font Awesome 5 Free", 20f)
    };

    this.LogoLabel.SetText(new NSAttributedString(text, u));
  5. Thats all, when you start your project it will use the new custom font !

If you find how to fix setting the font by selecting in Xamarin Visual Studio UI Custom section please write me a comment.

How to set Todays Widget Height depending on content size using Xamarin Ios Native

Here is a sample to set Todays Widget Content height according to tableview content height

public partial class TodayViewController : UIViewController, INCWidgetProviding { //https://forums.xamarin.com/discussion/104640/almost-all-time-cannot-show-more-for-xamarin-today-widget-on-ios-11 [Export("widgetActiveDisplayModeDidChange:withMaximumSize:")] public void WidgetActiveDisplayModeDidChange(NCWidgetDisplayMode activeDisplayMode, CoreGraphics.CGSize maxSize)

{

// Take action based on the display mode switch (activeDisplayMode) { case NCWidgetDisplayMode.Compact: this.PreferredContentSize = maxSize; // changes according to compact mode break; case NCWidgetDisplayMode.Expanded: this.PreferredContentSize = new CoreGraphics.CGSize(maxSize.Width, tableView.ContentSize.Height); // changes according to expanded mode break;

}

}

}