Xamarin Studio 6 incompatible with NUnit 3.2.1 - xamarin

I've downloaded the latest copy of xamarin studio which is 6.0 build 3668. I've built a tiny console app and I'm trying to run some unit tests through the UI in xamarin, but I get a message saying that nunit 3.2.1 is unsupported. I have a fake script which does work when run in the terminal.
Full error message is here : Skipped loading assembly test because it references an unsupported version of the nunit.framework, 3.2.1.0.
Can anyone help please ?

I have also faced the problem: "Error CS0246: The type or namespace name 'NUnit' could not be found".
It's because the .dll file is not loaded in the references of the solution.
In my case, I am using Monodevelop/Xamarin Studio 7.8.4,
having multiple NUnit dlls in the monodevelop.UnitTest directory.
Duo to this reason, I had to add reference manually.
As I am using the Ubuntu 18.04 distribution, the nunit.framework.dll assembly was locketed at: usr/lib/monodevelop/Addins/MonoDevelop.UnitTesting/NUnit2/nunitframework.dll
So, I just added this assembly to the my project and the unit test was working fine.
Note: here I have added nunit.framework 2.6.4 assembly.

Related

Unknown Objective-C runtime 'microsoft'

I'm trying to compile an app with WinObjC. I'm using Visual Studio 2017 version 15.7.6 and WinObjC prerelease v0.2.180221 from NuGet.
The very first source file it tries to compile, and every subsequent one fails with the error message:
clang.exe : error : unknown or ill-formed Objective-C runtime 'microsoft'
What am I doing wrong?
You seems trying to use side loaded clang compiler, that not gonna work unfortunately, since for WinObjC have been used modified clang with custom ObjectiveC runtime added.
To build your project successfully, you must add latest WinObjC nuget packages of version v0.2.180221-dev-20180516000001 to your project along with this https://www.nuget.org/packages/WinObjC.Compiler/ compiler package, it includes proper clang forked from original clang v6.0.1. Supported VS version is v15.4.5-15.8.9
UPDATE 1
To use latest Visual Studio starting from v15.9 up to the current VS2019 v16.X, you might find useful this topic with guide how to modify your project to make it run.

ASP.NET CORE 2.1 Preview "SharedCompilationId" parameter is not supported by the "Csc" task

I am trying run the project with views in separate class library on Mac OSX as described in below article
https://blogs.msdn.microsoft.com/webdev/2018/03/01/asp-net-core-2-1-razor-ui-in-class-libraries/
The problem is that I cannot build the class library project with Visual Studio Community 7.4 on Mac OS.
Project builds with command line (donet build) without problems but when I try to build it with Visual Studio it throws two errors:
/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.razor.design/2.1.0-preview1-final/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.Compilation.targets(10,10): Error MSB4064: The "SharedCompilationId" parameter is not supported by the "Csc" task. Verify the parameter exists on the task, and it is a settable public instance property. (MSB4064)
/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.razor.design/2.1.0-preview1-final/build/netstandard2.0/Microsoft.AspNetCore.Razor.Design.Compilation.targets(5,5): Error MSB4063: The "Csc" task could not be initialized with its input parameters. (MSB4063)
When I change RazorCompileOnBuild to false or remove Content from Content Build project compiles without errors.
Go to Nuget Console and add:
Install-Package Microsoft.Net.Compilers -Version 2.8.2
You will no longer get above mentioned error.
I had this problem on the build server but not locally.
The solution:
Install the updated Visual Studio on the build server. In my case 2017.15.4
As I find you can solve this issue in two ways.
Solution 1
Add Microsoft.Net.Compilers compilers package to the project.
Solution 2
Build the project using the command line. dotnet build
In my case, I had installed the .NET Core 2.1 SDK, but not the runtime.
Strange how Microsoft don't include the runtime in the SDK.
If you face this problem there are three steps you need to take:
Ensure that Nuget package and Target Framework match.
Ensure that the referenced runtime and sdk are installed.
Ensure that Visual Studio is up to date.

Error while creating xamarin-component for android

I have used the command
xamarin-component.exe package C:\cmp\AndroidComponent\component
for creating Xamarin component.While building the Sample android project, it is showing the below error. (I have used the command xamarin-component.exe package C:\cmp\AndroidComponent\component -verbose to display the error message in detail).
Error message:
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Bindings.targets(155,2): error MSB3644: The reference assemblies for framework "MonoAndroid,Version=v1.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [C:\cmp\AndroidComponent\component\samples\App17\VidyoClientAndroid\VidyoClientAndroid.csproj]
Note:
I am able to create a Xamarin component for iOS source code successfully. • While creating the Xamarin component for Android source code, internally msbuild.exe is getting called from 64 bit folder(C:\Program Files (x86)\MSBuild\14.0\binamd64\msbuild.exe "/p:Configuration=Release" "C:\cmp\AndroidComponent\component\samples\App17\App17.sln"...). • Build is successful when msbuild.exe is called from path: “C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe”(32 bit) explicitly while building the android project explicity.

unable to find nunit assembly for xamarin test cloud in VSTS

Hi I am using VSTS for CI. For my Xamarin Android application during the build process it is trying to test the app on cloud, it's failing as it is not able to find nunit.framework.dll file in the project. I am using Nunit Version 2.6.4
The NuGets in the project are included in the output directory but still, I am getting the issue, can you please help me with it?
VSTS: Test Assembly Directory: Solution/Droid.UITests
Error:
Unable to find the nunit.framework.dll in the assembly directory. In Xamarin Studio you may have to right-click on the nunit.framework reference and choose Local Copy for it to be included in the output directory.
I got it. I had to remove the old references from the solution's nuget package collection.

Xamarin Studio cannot find an assembly which is not existing and throws compile error "Error executing task ResolveAssemblyRefernce"

I'm getting the following error when I try to compile my project:
Error executing task ResolveAssemblyReference: Could not load file or assembly '//DataLayer/bin/Debug/EntityFramework.Extended.dll' or one of its dependencies. The system cannot find the file specified. (DataLayer)
I used to use this dependency, together with EntityFramework, that is true, but I removed both of it. This all happened via nuget. A check on the project with grep:
grep -r -i EntityFramework *
reveals that the string only exists in two files inside comments, nothing else, so why am I getting this exception?
I feel the easiest thing to do right now is to start a new project and configure it properly without EntityFramework.Extended from the beginning, but I still would like to have an answer, in case I encounter similar problems in the future.
A small remark - I use Xamarin studio in OS X to develop a .Net web application in mono. I have the latest version, Xamarin Studio 5.2 with Mono 3.4 and am compiling the project by using .Net 4.0 profile.

Resources