I am not able to execute my C# .Net Core 2.0 application on ubuntu14.04 other than installing the .net core SDK and use dotnet run. The application uses log4net 2.0.8 which is causing the problems. When I pack it using dotnet publish -c Release -r ubuntu.14.04-x64 on WIndows 10 I get lots of errors like:
error NU1605: Detected package downgrade: System.Runtime.Extensions from 4.3.0 to 4.1.0. Reference the package directly from the project to select a different version.
...
error NU1605: Detected package downgrade: System.Runtime.InteropServices from 4.3.0 to 4.1.0. Reference the package directly from the project to select a different version.
Referencing these packages directly does not change anything but packing it under linux is working. However, when i execute the packed app using ./maypp I get:
Unhandled Exception: System.ArgumentNullException: SafeHandle cannot be null.
Parameter name: pHandle
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument, ExceptionResource resource)
at System.StubHelpers.StubHelpers.SafeHandleAddRef(SafeHandle pHandle, Boolean& success)
at Interop.GlobalizationInterop.GetSortKey(SafeSortHandle sortHandle, String str, Int32 strLength, Byte* sortKey, Int32 sortKeyLength, CompareOptions options)
at System.Globalization.CompareInfo.GetHashCodeOfStringCore(String source, CompareOptions options, Boolean forceRandomizedHashing, Int64 additionalEntropy)
at System.Linq.Set1.InternalGetHashCode(TElement value)
at System.Linq.Set1.Add(TElement value)
at System.Linq.Set1.UnionWith(IEnumerable1 other)
at System.Linq.Enumerable.DistinctIterator1.FillSet()
at System.Linq.Enumerable.DistinctIterator1.ToArray()
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
Without log4net it is working. Google did not reveal any hint. Any Ideas are welcome?
Microsoft.AspNetCore.AllandMicrosoft.NetCore.App? I had very similar issues related to this as theMicrosoft.NetCore.Appshould not be referenced directly. Because of this i had some version mismatch looking quite the same. Also the problem described here resulted in my case in similar problens github.com/aspnet/IISIntegration/issues/476