Can't compile Moonlight application in MonoDevelop - macos

I am trying to build Moonlight application using MonoDevelop 2.8 and Mono 2.10.5 on Mac OS X but it fails to compile:
Error: Framework 'Moonlight / Silverlight 3.0' not installed. (MoonlightTest)

The Moonlight addin on Mac is somewhat limited. It uses Silverlight to run the apps, since there is no Moonlight plugin for Mac has been released, but it uses the Moonlight SDK assemblies to compile, since the Silverlight SDK assemblies cannot be redistributed. Unfortunately the only SDK package released for Moonlight was 2.0 - Moonlight skipped 3.0 and assemblies for 4.0 exist but were never released as an SDK.

Related

Upgrade to OneSignal 4.0 SDK not compatible with PCL Profile44 and others Visual Studio Mac 2022

when trying to install the OneSignal 4.x SDK to the shared project part of my pcs project I get the following error:
OneSignalSDK.Xamarin 4.1.0 with .NETPortable,Version=v4.5,Profile=Profile259.
Package OneSignalSDK.Xamarin 4.1.0 is not compatible with portable45-net45+win8+wp8+wpa81 (.NETPortable,Version=v4.5,Profile=Profile259). Package OneSignalSDK.Xamarin 4.1.0 supports:
monoandroid41 (MonoAndroid,Version=v4.1)
netstandard2.0 (.NETStandard,Version=v2.0)
xamarinios (Xamarin.iOS,Version=v0.0)
I tried almost every other Profile with the same result. I cant get this to install.
The SDK installs fine in the iOS and Android projects. And the former sdk 3.x also installed fine.
Any help on this would be great!
Thanks
Thomas

CodeTaskFactory" could not be found in the assembly"

I'm new in Dot net after I cloned some project from GitHub, I try to run then got below error.
OS: Mac 10.12.6 (16G29)
Tool version: Visual stuido 2017
SDK: 2
/Volumes/Users/Administrator/Documents/My Web Sites/nopCommerce-develop
/nopCommerce-develop/src/Build/ClearPluginAssemblies.proj(5,5): Error MSB4174:
The task factory "CodeTaskFactory" could not be found in the assembly "/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Micro
soft.Build.Tasks.v4.0.dll". (MSB4174) (Nop.Web)
As per the previous answer:
nopCommerce 4.0 has developed with .NET core, but still its targeting to .NET Framework 4.6 and not .NET Core. So you cannot run nopCommerce 4.0 to MAC or Linux.
Still if you would like to run it to cross platform, you can change the targeted framework to .NET Core and solve the errors may you face.

Debug/Emulator getting started with Android using Xamarin

Using VS2015/Windows 10, I created a Blank App (Portable) and set the startup project to Droid. I had only one emulator by default, so I created a Galaxy Nexus/API 23/Intel Atom x86 using the AVD with HAXM.
I can't get this blank project to run on either emulator. When I hit debug, it goes through the motions and starts the emulator but nothing happens. If I run any project beyond the first time after I created a project I get the following error:
System.MissingMethodException: Method
'Android.Support.V4.Widget.DrawerLayout.AddDrawerListener' not found.
http://imgur.com/a/hZNUQ
Frame not in module http://imgur.com/a/KtsRD
This is what I have installed: http://imgur.com/a/iL7Wt
I have installed all the latest updates, the SDK's etc. I would simply like to get started and emulate a HelloWorld app.
UPDATE: still have the issues, here is some more information to track issue.
Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586
Microsoft .NET Core Tools (Preview 2) 14.1.21111.0
Microsoft .NET Core Tools (Preview 2)
Xamarin 4.2.1.64 (872717c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Inspector Support 1.0.0.0 (1f3067d)
Adds support for inspecting Xamarin and WPF apps.
Xamarin.Android 7.0.2.37 (ce955cc)
Visual Studio extension to enable development for Xamarin.Android.
Xamarin.iOS 10.2.1.5 (44931ae)
Visual Studio extension to enable development for Xamarin.iOS.
Installed Android SDKS:
Android SDK Tools 25.2.3
Android SDK Platform-tools 25.0.1
Android SDK Build-tools 23.0.2, 23.0.1, 22.0.1, 21.1.2
, 19.1
Android 7.1.1 (API 25) - SDK Platform, Google API's Intel x86 ATOM
Android 7.0 (API 24) - SDK Platform, Google API's Intel x86 ATOM
Android 6.0 (API 23) - SDK Platform, Google API's Intel x86 ATOM
Android 5.1.1 (API 22) - SDK Platform, Google API's Intel x86 ATOM
Android 5.0.1 (API 21) - SDK Platform, Google API's Intel x86 ATOM
Android 4.4.1 (API 19) - SDK Platform, Google API's Intel x86 ATOM
http://imgur.com/a/vZZmf
Reproduction steps
1) Create a new Blank PCL project, targetted .NET Framework 4.5
2) Right off the bat I have the following 4 Warning messages
Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled. App5.Droid 1 Active
Warning The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'App5, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'App5.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly(String fileName)
at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(ICollection1 jars, ICollection1 resolvedResourceDirectories, ICollection1 resolvedAssetDirectories, ICollection1 resolvedEnvironments)
at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() App5.Droid
Warning Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. App5.UWP
Warning Cannot resolve Assembly or Windows Metadata file 'System.Runtime.dll' App5.UWP D:\Visual Studio 2015\Projects\App5\App5\App5.UWP\App5.UWP.csproj
http://imgur.com/a/EwIQY
3) Right click on the Droid project - properties
Compile using: Use Latest Platform (Android 7.0 Nougat)
Min Android: Android 4.0.3 (API level 15 - Ice Cream Sandwich)
Target Android version: Use compile SDK version
http://imgur.com/a/yZyAv
4) Set startup project as Droid, RUN using AVD_GalaxyNexus_ToolsForApacheCordova (Android 4.4 - API 19)
5) Pop-up message: Running an x86 based Android Virtual Device is 10x faster. We strongly recommend creating a new AVD. Clicked OK
6) Android Emulator Starts. VS15 message bar: 'Deploying AVD' for a long time....then 'Ready' orange bar. Few more minutes and new pop-up opens: 'Find Source: NavigationPageRenderer.cs' ...not sure where this file is/what this file is supposed to be.
http://imgur.com/a/DVYjJ
7) When I click cancel, I get the error message:
System.MissingMethodException: Method 'Android.Support.V4.Widget.DrawerLayout.AddDrawerListener' not found.
http://imgur.com/a/KGvEG
Reproduced same issue on multiple machines
Update: So I just reproduced your issue and I am sorry that you and other ran into this. It looks like there was an issue in the templates and I am working with the team to quickly resolve this.
To fix:
Simply right click on the android project and select "Manage Nuget Packages"
Go to Updates
Find Xamarin.Android.Support.v7.AppCompat
Select version 23.3.0 from the version picker and hit Install
You additionally will need to install the RecyclerView 23.3.0 NuGet Package. Go to Browse and search for: Xamarin.Android.Support.v7.RecyclerView and make sure to pick 23.3.0 to install for the correct version
Now do a full clean/rebuild and it should work
This should install the correct versions of everything you need for Android
So, it looks like you are attempting to create a Blank Xamarin.Forms application, not a traditional Xamarin application.
My first recommendation is to try to just create a blank Android application with Xamarin. This will have very little dependencies and you can see if it starts to deploy out of the box.
Looking at your Installed Android SDKs, I would recommend Uninstalling anything Under Android 7.1.1 (API 25) as it is not supported yet and may be causing issues downloading NuGet packages.
Here is what mine looks like as of today:
Looking at your Warnings I think it will go away once you uninstall API 25, not sure why that is getting installed unless you maybe already installed Android Studio?
Also, if you are targting API 24+ you'll have to install the Java JDK 1.8. I would suggest removing 1.7 unless you need to use previous versions. The release notes for Xamarin.Android 7.0 have more information as well: https://developer.xamarin.com/releases/android/xamarin.android_7/xamarin.android_7.0/
Note: Xamarin.Android 7.0 requires JDK 1.8 to use the Android Nougat (API 24) APIs. You can continue to use earlier versions of the JDK if targeting earlier Android API levels:
JDK 1.8 - up to API 24+ JDK 1.7 - up to API 23 JDK 1.6 - up to API 20 Additionally, a 64-bit version of the JDK is required to use custom controls in the Android designer.
I wrote a big blog on setup here: http://motzcod.es/post/150380059392/preparing-machines-for-xamarin-cycle if things aren't configure properly.
Try to do a New project at this point and it will re-download all the NuGets and such properly.
As for System.ObjectModel warning, you can remove it from the References and it shouldn't be needed.

Why would the following errors occur in Xamarin Studio on OS X but not in Visual Studio?

I'm trying to understand why I'm getting the following errors when running tests in Xamarin Studio 5.9.1 (build 3) on OS X.
System.IO.FileNotFoundException : Could not load file or assembly 'System.Net.Http, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
System.TypeLoadException : A type load exception has occurred.
All projects build successfully and the same tests run just fine in Visual Studio on Windows using the same solution.
I am seeing a warning when building the test project on OS X, despite having already installed and added the reference.
All projects referencing MyProject.fsproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569.
I still don't know why Xamarin behaves differently than Visual Studio, but the root cause was that the test project was targeting .Net 4.5 whereas the main project was targeting .Net 4.0
Thanks to #7sharp9 for the help.
Different platforms (Android, iOS, Desktop) have different System.Net.Http.dll binaries - compiled from the same source, but each version references the mscorlib.dll (and other base-class libraries) from the platform it was built against.
This is not a problem when you use it in an application - Xamarin Studio will automatically pick the right version for you - but you can't use it in a Portable Class Library.
Microsoft initially implemented HttpClient as part of .NET 4.5, but then released a portable version of it (with a Windows-only license). If I understand this correctly, then that's mostly the same API as in .NET 4.5 plus a few minor additions (I think they added gzip compression, which Mono's version currently doesn't).
For Xamarin / Mono, all we need to do to create an open-source version of this library is to take our existing sources and compile them against the portable profile. I haven't tried this yet, but this could be as easy as editing the .csproj file and replacing the .
Also would suggest that you install HttpClient NuGet package
System.Net.Http.HttpClient is available directly from the latest version of Xamarin.
Simply check for updates from Xamarin Studio ;-)

Nuget, PCL, sl40 sl4 win8 win profile differences

I have PCL with ".NET 4 and higher, Silverlight 4 and higher, Windows Phone 7 and higher, Windows Store apps (Windows 8)" (from project->properties window).
I have Microsoft.Bcl version 1.1.3 installed.
When I want to update the reference to 1.1.6 I see following.
Install-Package : Could not install package 'Microsoft.Bcl 1.1.6'. You are trying to install this package into a project that targets
'portable-net40+sl40+wp+win', 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.
Looking at packages folder I see following:
./Microsoft.Bcl.1.1.3/lib/portable-net40+sl4+win8+wp71
./Microsoft.Bcl.1.1.6/lib/portable-net40+sl4+win8+wp71
Now the questions:
What is the difference between sl40 and sl4 profile, win8 and win
profile and wp and wp71 profile?
How can I update Microsoft.Bcl 1.1.6 in my project?
Microsoft.Bcl is targeting a later version of Windows Phone than your PCL project which is why it is failing to install.
Framework differences
sl40 and sl4 - same framework
win8 and win - same framework. win means win version 0.0 but NuGet maps this to win8
wp and wp71 - different frameworks. wp means wp version 0.0 but it is equivalent to wp7 by the way NuGet maps the frameworks.
Updating to Microsoft.Bcl 1.1.6
To install Microsoft.Bcl you will need to update your PCL project so it targets wp71 or above. So you can choose to target Windows Phone 7.5 or later or Windows Phone 8 or later.
If you choose Windows Phone 7.5 or later that seems to map to wp71 in Nuget.

Resources