Why does Bridge.net not compile HashSet<T> or Stack<T> - c#

I am using Bridge.net v17.10.1, and according to the documentation they are implemented in Bridge.Core.
HashSet<T> varName;
Stack<T> varName2;
Produces the following errors:
Error CS0433 The type 'HashSet<T>' exists in both 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'Bridge, Version=17.6.0.0, Culture=neutral, PublicKeyToken=null'
Error CS0433 The type 'Stack<T>' exists in both 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'Bridge, Version=17.6.0.0, Culture=neutral, PublicKeyToken=null'
Probably something super simple, but my Bridge.Net knowledge is limited and I have not been able to figure it out.

This is a known issue, the answer is described here: https://forums.bridge.net/forum/community/help/2902-c-compile-error-the-type-stopwatch-exists-in-both-system-and-bridge
Yes, you have to remove System reference from your csproj file
Also I can suggest to add the following reference to prevent adding System reference by Visual Studio
<Reference Include="System" Condition="False" />

Related

System.IO.Compression Reference issue

I am working on .NET framework 4.6 Web API application. My app is working on my machine and I was able to build it in my local but when I push it to our Azure Dev OPS CI, I got this build error.
Error CS0433: The type 'ZipArchive' exists in both 'System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
: Error CS0433: The type 'ZipArchiveMode' exists in both 'System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Process 'msbuild.exe' exited with code '1'.

Found conflicts between different versions of "Microsoft.Bcl.AsyncInterfaces"

I have a netstandard2.0 library that is used by net5.0 applications
One of packages used by the library references Microsoft.Bcl.AsyncInterfaces 5.0.0
But I get this warning for every application:
47>C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5):
warning MSB3277: Found conflicts between different versions of "Microsoft.Bcl.AsyncInterfaces" that could not be resolved.
There was a conflict between "Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" and "Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51".
"Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was chosen because it was primary and "Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" was not.
References which depend on "Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [C:\Users\IgorBe\.nuget\packages\microsoft.bcl.asyncinterfaces\1.1.1\ref\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll].
C:\Users\IgorBe\.nuget\packages\microsoft.bcl.asyncinterfaces\1.1.1\ref\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll
Project file item includes which caused reference "C:\Users\IgorBe\.nuget\packages\microsoft.bcl.asyncinterfaces\1.1.1\ref\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll".
C:\Users\IgorBe\.nuget\packages\microsoft.bcl.asyncinterfaces\1.1.1\ref\netstandard2.1\Microsoft.Bcl.AsyncInterfaces.dll
References which depend on "Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" [].
Please note that "Project file item includes which caused reference" is not a project but the dll itself. My guess is that 1.0.0 version is used by compiler with .net standard to provide some core async functionality
But how can I get rid of this message? There seems to be no binding redirection for .Net 5.0

Error on rebuilding the project after updating syncfusion nuget

Currently I am using
Xamarin forms 3.6.0.539721
Syncfusion nuget Version 17.1.0.53
now i am trying to update syncfusion nuget version to 18.2.0.44
Steps:
Installed Syncfusion Licensing from 17.1.0.53 to 18.2.0.44
then I install syncfusion.xamarin.core from 17.1.0.53 to 18.2.0.44
then I install syncfusion.xamarin.sfnumericupdown from 17.1.0.53 to 18.2.0.44
and after install and rebuilding project it gives me below errors.
Error The Java type `mono.android.support.v4.widget.DrawerLayout_DrawerListenerImplementor` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. HXSV1.Android
Error `mono.android.support.v4.content.Loader_OnLoadCanceledListenerImplementor` generated by: Android.Support.V4.Content.Loader+IOnLoadCanceledListenerImplementor, Xamarin.Android.Support.Core.Utils, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error `mono.android.support.v4.view.ViewPager_OnPageChangeListenerImplementor` generated by: Android.Support.V4.View.ViewPager+IOnPageChangeListenerImplementor, Xamarin.Android.Support.Core.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error `mono.android.support.v4.view.AsyncLayoutInflater_OnInflateFinishedListenerImplementor` generated by: Android.Support.V4.View.AsyncLayoutInflater+IOnInflateFinishedListenerImplementor, Xamarin.Android.Support.Core.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error `mono.android.support.v4.content.Loader_OnLoadCompleteListenerImplementor` generated by: Android.Support.V4.Content.Loader+IOnLoadCompleteListenerImplementor, Xamarin.Android.Support.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error `mono.android.support.v4.view.ViewPager_OnAdapterChangeListenerImplementor` generated by: Android.Support.V4.View.ViewPager+IOnAdapterChangeListenerImplementor, Xamarin.Android.Support.Core.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error `mono.android.support.v4.view.ViewPager_OnPageChangeListenerImplementor` generated by: Android.Support.V4.View.ViewPager+IOnPageChangeListenerImplementor, Xamarin.Android.Support.ViewPager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error The Java type `mono.android.support.v4.view.ViewPager_OnPageChangeListenerImplementor` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. HXSV1.Android
Error `mono.android.support.v4.view.AsyncLayoutInflater_OnInflateFinishedListenerImplementor` generated by: Android.Support.V4.View.AsyncLayoutInflater+IOnInflateFinishedListenerImplementor, Xamarin.Android.Support.AsyncLayoutInflater, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error `mono.android.support.v4.widget.DrawerLayout_DrawerListenerImplementor` generated by: Android.Support.V4.Widget.DrawerLayout+IDrawerListenerImplementor, Xamarin.Android.Support.Core.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error The Java type `mono.android.support.v4.widget.SlidingPaneLayout_PanelSlideListenerImplementor` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. HXSV1.Android
Error The Java type `mono.android.support.v4.content.Loader_OnLoadCanceledListenerImplementor` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. HXSV1.Android
Error `mono.android.support.v4.widget.DrawerLayout_DrawerListenerImplementor` generated by: Android.Support.V4.Widget.DrawerLayout+IDrawerListenerImplementor, Xamarin.Android.Support.DrawerLayout, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error The Java type `mono.android.support.v4.content.Loader_OnLoadCompleteListenerImplementor` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. HXSV1.Android
Error `mono.android.support.v4.widget.SwipeRefreshLayout_OnRefreshListenerImplementor` generated by: Android.Support.V4.Widget.SwipeRefreshLayout+IOnRefreshListenerImplementor, Xamarin.Android.Support.SwipeRefreshLayout, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error `mono.android.support.v4.view.ViewPager_OnAdapterChangeListenerImplementor` generated by: Android.Support.V4.View.ViewPager+IOnAdapterChangeListenerImplementor, Xamarin.Android.Support.ViewPager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error `mono.android.support.v4.widget.SlidingPaneLayout_PanelSlideListenerImplementor` generated by: Android.Support.V4.Widget.SlidingPaneLayout+IPanelSlideListenerImplementor, Xamarin.Android.Support.Core.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error `mono.android.support.v4.content.Loader_OnLoadCompleteListenerImplementor` generated by: Android.Support.V4.Content.Loader+IOnLoadCompleteListenerImplementor, Xamarin.Android.Support.Core.Utils, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error `mono.android.support.v4.widget.SwipeRefreshLayout_OnRefreshListenerImplementor` generated by: Android.Support.V4.Widget.SwipeRefreshLayout+IOnRefreshListenerImplementor, Xamarin.Android.Support.Core.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error The Java type `mono.android.support.v4.widget.SwipeRefreshLayout_OnRefreshListenerImplementor` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. HXSV1.Android
Error `mono.android.support.v4.widget.SlidingPaneLayout_PanelSlideListenerImplementor` generated by: Android.Support.V4.Widget.SlidingPaneLayout+IPanelSlideListenerImplementor, Xamarin.Android.Support.SlidingPaneLayout, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error The Java type `mono.android.support.v4.view.AsyncLayoutInflater_OnInflateFinishedListenerImplementor` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. HXSV1.Android
Error `mono.android.support.v4.content.Loader_OnLoadCanceledListenerImplementor` generated by: Android.Support.V4.Content.Loader+IOnLoadCanceledListenerImplementor, Xamarin.Android.Support.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null HXSV1.Android
Error The Java type `mono.android.support.v4.view.ViewPager_OnAdapterChangeListenerImplementor` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. HXSV1.Android
I want to update sfnumericupdown nuget because it have issue in step value up and down in Ukraine Language.
step value is 0.1 and Value is 46.2, now when i tap numeric up icon then value becomes 55/255/555, it means value not changing as per step value.
any help?
thank you.
Greetings from Syncfusion.
We have checked the reported issue with the provided steps in SfNumericUpDown control with a simple sample and control is working fine from our side. Could you please confirm whether all projects have the same Xamarin Forms version. Please have the sample and video for reference from the below link.
Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Updown-1262080342
Video link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/UpdownVideo364340833
Screenshot:
UpDown image
Please check with the sample and if the issue still persists please modify the same with the issue reproducing steps and also mention in which scenario you could reproduce the issue which will be helpful for us to analyse further and provide an appropriate solution.
Regards,
Sridevi S.

.net core reference conflict with phantom assembly version

When I build my asp.net core 2.2 app, I get a warning saying
There was a conflict between "Microsoft.AspNetCore.Hosting.Server.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" and "Microsoft.AspNetCore.Hosting.Server.Abstractions, Version=2.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60".
"Microsoft.AspNetCore.Hosting.Server.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was chosen because it was primary and "Microsoft.AspNetCore.Hosting.Server.Abstractions, Version=2.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" was not.
References which depend on "Microsoft.AspNetCore.Hosting.Server.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [/Users/yurypastushenko/.nuget/packages/microsoft.aspnetcore.hosting.server.abstractions/2.0.0/lib/netstandard2.0/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll].
/Users/yurypastushenko/.nuget/packages/microsoft.aspnetcore.hosting.server.abstractions/2.0.0/lib/netstandard2.0/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll
Project file item includes which caused reference "/Users/yurypastushenko/.nuget/packages/microsoft.aspnetcore.hosting.server.abstractions/2.0.0/lib/netstandard2.0/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll".
/Users/yurypastushenko/.nuget/packages/microsoft.aspnetcore.hosting.server.abstractions/2.0.0/lib/netstandard2.0/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll
References which depend on "Microsoft.AspNetCore.Hosting.Server.Abstractions, Version=2.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60" [].
/Users/yurypastushenko/.nuget/packages/microsoft.aspnetcore.hosting.abstractions/2.0.3/lib/netstandard2.0/Microsoft.AspNetCore.Hosting.Abstractions.dll
Project file item includes which caused reference "/Users/yurypastushenko/.nuget/packages/microsoft.aspnetcore.hosting.abstractions/2.0.3/lib/netstandard2.0/Microsoft.AspNetCore.Hosting.Abstractions.dll".
Microsoft.AspNetCore.Hosting.Abstractions, Version=2.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
Notice the empty list [] after References which depend on "Microsoft.AspNetCore.Hosting.Server.Abstractions, Version=2.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60".
Does this mean that I have no references to version 2.0.3? Then why is this reference conflict happens?
Did anyone meet a similar problem?
Pavel, thank you for your comment. While trying to answer, I came across the two references in .csproj files:
<ItemGroup>
<Reference Include="Microsoft.AspNetCore.Hosting.Abstractions, Version=2.0.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
<HintPath>..\..\..\.nuget\packages\microsoft.aspnetcore.hosting.abstractions\2.0.3\lib\netstandard2.0\Microsoft.AspNetCore.Hosting.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60">
<HintPath>..\..\..\.nuget\packages\microsoft.extensions.dependencyinjection.abstractions\2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
</ItemGroup>
I have no idea how did they get there, but obviously they are the reason of the conflicts. After deleting them everything compiles without warnings.

Cannot convert from type1 to type1 in netstandard error

I've been lured into creating NetStandard libraries in 2017RC. I have come across 2 bizarre errors
Error CS1503 Argument 1: cannot convert from 'UtilityLibrary.CountryHelpers.Country.CountryCode
[...UtilityLibrary\Country\Country.cs(10)]' to
'UtilityLibrary.CountryHelpers.Country.CountryCode [Common,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]'
Error CS0433 The type 'Regex' exists in both 'System.Text.RegularExpressions, Version=4.0.10.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' and 'System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'
After doing some searching, these are the things I've tried:
a clean of the entire solution and build
removing each project and re-adding them, setting the references after readding them
Why am I seeing the regex error? I literally just created a few libraries in one sitting!

Categories