Is .NET Core 1.0 a supported target in any available version of Oxygene?
You can target it (ie reference the dlls), but the tooling for VS itself isnât ready yet, itâs currently beta and about to be completely redone from a json project to msbuild project, so no ide support yet.
Thank you. We never used GUI building, and right now I am trying to create a project file for MSBuildâing. But without a sample and/or a template I am lost. I tried to re-use our UWP project files, but I tend to think, that this approach is not exactly correct.
Indeed. The whole process is currently a bit messy from the vs side. Iâll do some research tomorrow, check va15 with the .net. Core rc tool chains build output and see if I can dig out the DLL refs there
Oke so this is a bit less than ideal but easiest is to just install this:
(VS2015), then create a new C# .net core project and build it.
It wonât actually show the references anywhere, but if you go to
.,\ConsoleApp1\obj\Debug\netcoreapp1.0
there will be 1 or 2 rcp files (which look very identical to me) and have something like;
--temp-output:c:\users\carlokok\documents\visual studio 2015\Projects\ConsoleApp1\obj\Debug\netcoreapp1.0\
--out:c:\users\carlokok\documents\visual studio 2015\Projects\ConsoleApp1\bin\Debug\netcoreapp1.0\ConsoleApp1.dll
--define:DEBUG
--define:TRACE
--define:NETCOREAPP1_0
--suppress-warning:CS1701
--suppress-warning:CS1702
--suppress-warning:CS1705
--optimize:False
--emit-entry-point:True
--output-name:ConsoleApp1
--file-version:1.0.0.0
--version:1.0.0.0
--informational-version:1.0.0
--target-framework:.NETCoreApp,Version=v1.0
--reference:C:\Users\carlokok\.nuget\packages\Microsoft.CSharp\4.0.1\ref\netstandard1.0\Microsoft.CSharp.dll
--reference:C:\Users\carlokok\.nuget\packages\Microsoft.VisualBasic\10.0.1\ref\netstandard1.1\Microsoft.VisualBasic.dll
--reference:C:\Users\carlokok\.nuget\packages\Microsoft.Win32.Primitives\4.0.1\ref\netstandard1.3\Microsoft.Win32.Primitives.dll
--reference:C:\Users\carlokok\.nuget\packages\System.AppContext\4.1.0\ref\netstandard1.6\System.AppContext.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Buffers\4.0.0\lib\netstandard1.1\System.Buffers.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Collections\4.0.11\ref\netstandard1.3\System.Collections.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Collections.Concurrent\4.0.12\ref\netstandard1.3\System.Collections.Concurrent.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Collections.Immutable\1.2.0\lib\netstandard1.0\System.Collections.Immutable.dll
--reference:C:\Users\carlokok\.nuget\packages\System.ComponentModel\4.0.1\ref\netstandard1.0\System.ComponentModel.dll
--reference:C:\Users\carlokok\.nuget\packages\System.ComponentModel.Annotations\4.1.0\ref\netstandard1.4\System.ComponentModel.Annotations.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Console\4.0.0\ref\netstandard1.3\System.Console.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Diagnostics.Debug\4.0.11\ref\netstandard1.3\System.Diagnostics.Debug.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Diagnostics.DiagnosticSource\4.0.0\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Diagnostics.Process\4.1.0\ref\netstandard1.4\System.Diagnostics.Process.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Diagnostics.Tools\4.0.1\ref\netstandard1.0\System.Diagnostics.Tools.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Diagnostics.Tracing\4.1.0\ref\netstandard1.5\System.Diagnostics.Tracing.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Dynamic.Runtime\4.0.11\ref\netstandard1.3\System.Dynamic.Runtime.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Globalization\4.0.11\ref\netstandard1.3\System.Globalization.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Globalization.Calendars\4.0.1\ref\netstandard1.3\System.Globalization.Calendars.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Globalization.Extensions\4.0.1\ref\netstandard1.3\System.Globalization.Extensions.dll
--reference:C:\Users\carlokok\.nuget\packages\System.IO\4.1.0\ref\netstandard1.5\System.IO.dll
--reference:C:\Users\carlokok\.nuget\packages\System.IO.Compression\4.1.0\ref\netstandard1.3\System.IO.Compression.dll
--reference:C:\Users\carlokok\.nuget\packages\System.IO.Compression.ZipFile\4.0.1\ref\netstandard1.3\System.IO.Compression.ZipFile.dll
--reference:C:\Users\carlokok\.nuget\packages\System.IO.FileSystem\4.0.1\ref\netstandard1.3\System.IO.FileSystem.dll
--reference:C:\Users\carlokok\.nuget\packages\System.IO.FileSystem.Primitives\4.0.1\ref\netstandard1.3\System.IO.FileSystem.Primitives.dll
--reference:C:\Users\carlokok\.nuget\packages\System.IO.FileSystem.Watcher\4.0.0\ref\netstandard1.3\System.IO.FileSystem.Watcher.dll
--reference:C:\Users\carlokok\.nuget\packages\System.IO.MemoryMappedFiles\4.0.0\ref\netstandard1.3\System.IO.MemoryMappedFiles.dll
--reference:C:\Users\carlokok\.nuget\packages\System.IO.UnmanagedMemoryStream\4.0.1\ref\netstandard1.3\System.IO.UnmanagedMemoryStream.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Linq\4.1.0\ref\netstandard1.6\System.Linq.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Linq.Expressions\4.1.0\ref\netstandard1.6\System.Linq.Expressions.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Linq.Parallel\4.0.1\ref\netstandard1.1\System.Linq.Parallel.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Linq.Queryable\4.0.1\ref\netstandard1.0\System.Linq.Queryable.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Net.Http\4.1.0\ref\netstandard1.3\System.Net.Http.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Net.NameResolution\4.0.0\ref\netstandard1.3\System.Net.NameResolution.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Net.Primitives\4.0.11\ref\netstandard1.3\System.Net.Primitives.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Net.Requests\4.0.11\ref\netstandard1.3\System.Net.Requests.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Net.Security\4.0.0\ref\netstandard1.3\System.Net.Security.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Net.Sockets\4.1.0\ref\netstandard1.3\System.Net.Sockets.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Net.WebHeaderCollection\4.0.1\ref\netstandard1.3\System.Net.WebHeaderCollection.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Numerics.Vectors\4.1.1\ref\netstandard1.0\System.Numerics.Vectors.dll
--reference:C:\Users\carlokok\.nuget\packages\System.ObjectModel\4.0.12\ref\netstandard1.3\System.ObjectModel.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Reflection\4.1.0\ref\netstandard1.5\System.Reflection.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Reflection.DispatchProxy\4.0.1\ref\netstandard1.3\System.Reflection.DispatchProxy.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Reflection.Extensions\4.0.1\ref\netstandard1.0\System.Reflection.Extensions.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Reflection.Metadata\1.3.0\lib\netstandard1.1\System.Reflection.Metadata.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Reflection.Primitives\4.0.1\ref\netstandard1.0\System.Reflection.Primitives.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Reflection.TypeExtensions\4.1.0\ref\netstandard1.5\System.Reflection.TypeExtensions.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Resources.Reader\4.0.0\lib\netstandard1.0\System.Resources.Reader.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Resources.ResourceManager\4.0.1\ref\netstandard1.0\System.Resources.ResourceManager.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Runtime\4.1.0\ref\netstandard1.5\System.Runtime.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Runtime.Extensions\4.1.0\ref\netstandard1.5\System.Runtime.Extensions.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Runtime.Handles\4.0.1\ref\netstandard1.3\System.Runtime.Handles.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Runtime.InteropServices\4.1.0\ref\netstandard1.5\System.Runtime.InteropServices.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Runtime.InteropServices.RuntimeInformation\4.0.0\ref\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Runtime.Numerics\4.0.1\ref\netstandard1.1\System.Runtime.Numerics.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Security.Cryptography.Algorithms\4.2.0\ref\netstandard1.6\System.Security.Cryptography.Algorithms.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Security.Cryptography.Encoding\4.0.0\ref\netstandard1.3\System.Security.Cryptography.Encoding.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Security.Cryptography.Primitives\4.0.0\ref\netstandard1.3\System.Security.Cryptography.Primitives.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Security.Cryptography.X509Certificates\4.1.0\ref\netstandard1.4\System.Security.Cryptography.X509Certificates.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Security.Principal\4.0.1\ref\netstandard1.0\System.Security.Principal.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Text.Encoding\4.0.11\ref\netstandard1.3\System.Text.Encoding.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Text.Encoding.Extensions\4.0.11\ref\netstandard1.3\System.Text.Encoding.Extensions.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Text.RegularExpressions\4.1.0\ref\netstandard1.6\System.Text.RegularExpressions.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Threading\4.0.11\ref\netstandard1.3\System.Threading.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Threading.Tasks\4.0.11\ref\netstandard1.3\System.Threading.Tasks.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Threading.Tasks.Dataflow\4.6.0\lib\netstandard1.1\System.Threading.Tasks.Dataflow.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Threading.Tasks.Extensions\4.0.0\lib\netstandard1.0\System.Threading.Tasks.Extensions.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Threading.Tasks.Parallel\4.0.1\ref\netstandard1.1\System.Threading.Tasks.Parallel.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Threading.Thread\4.0.0\ref\netstandard1.3\System.Threading.Thread.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Threading.ThreadPool\4.0.10\ref\netstandard1.3\System.Threading.ThreadPool.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Threading.Timer\4.0.1\ref\netstandard1.2\System.Threading.Timer.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Xml.ReaderWriter\4.0.11\ref\netstandard1.3\System.Xml.ReaderWriter.dll
--reference:C:\Users\carlokok\.nuget\packages\System.Xml.XDocument\4.0.11\ref\netstandard1.3\System.Xml.XDocument.dll
c:\users\carlokok\documents\visual studio 2015\Projects\ConsoleApp1\Program.cs
c:\users\carlokok\documents\visual studio 2015\Projects\ConsoleApp1\Properties\AssemblyInfo.cs
in them, those are the references you need.
Thank you for the pointer.
The question for now is (a) what to put into ProjectTypeGUIDs tag (or remove it altogether?) and (b) what to use in (or instead of) this line:
{Import Project="$(MSBuildExtensionsPath)\RemObjects Software\Oxygene\WindowsXaml\v14.0\RemObjects.Oxygene.Echoes.WinRT.targets" /}
Remove the guids yes. And use the regular echoes target, like plain class library.
Ok, MSBuild approach doesnât work at all:
I have set âFrameworkâ tag to point at .NET Core 1.0 Framework (MS provides a download with all binaries in it). Now I try to compile with MSBuild:
- if I donât have json files in the directory, the compiler tries to use .NET Framework 4.0 assemblies despite of the HintPath directive and Framework setting.
- if I have json file in the directory, the compiler fails with the error, saying that I need to add a reference to .NET Framework 4.0 to my project.json file.
Now I am trying Oxygene compilation (Oxygene 8.2). It kind of works in a straightforward way, in the meaning that it takes correct assemblies and tries to compile the code.
However, with this approach I get errors in compilation, and they look like a compiler glitch:
Example 1:
C:\Projects\SecureBlackbox\Redist\NET\PackagesâŚ\Sources\SBSocket.pas (7521:43) [E62] Type mismatch, cannot assign âSocketExceptionâ to "Exception"
Line contents:
on E : SocketException do
Example 2:
C:\Projects\SecureBlackbox\Redist\NET\PackagesâŚ\Sources\SBSocket.pas (8536:38) [E62] Type mismatch, cannot assign ânot nullable SocketExceptionâ to "Object"
Line contents:
raise SocketException.Create(SB_SOCKET_ERROR_CODE_TIMEDOUT);
SocketException class is in System.Net.Primitives assembly, which is referenced in my project. So the compiler either doesnât find it for whatever reason or thereâs a problem with the compiler itself.
Now, thereâs a problem with FileStream:
C:\Projects\SecureBlackbox\Redist\NET\PackagesâŚ\Sources\SBUsers.pas (516:11) [E407] No overloaded constructor with these parameters for type âFileStreamâ, best matching overload is "constructor (handle: Microsoft.Win32.SafeHandles.SafeFileHandle; access: System.IO.FileAccess; bufferSize: System.Int32; isAsync: Boolean)"
Line contents:
fs := FileStream.Create(AFileName, FileMode.Open, FileAccess.Read, FileShare.Read);
Declaration of the method in .NET Core class (System.Net.FileStream):
public FileStream(string path, System.IO.FileMode mode, FileAccess access, FileShare share) :
The problem with this one is that the compiler canât handle FileMode, FileAccess and FileShare properly. Adding full name to those parameters solve the problem, but we have hundreds of lines in the project.
Ok, the problem with System.IO⌠types was âsolvedâ by specifying the complete qualifiers. The problem with SocketException came from the fact, that this class is a descendant of ⌠Win32Exception (in cross-platform .NET Core, yes), so I needed to include a reference to the additional assembly.
System.IO as a prefix is should not be needed when the uses is there (if I understand things correctly), can you show me this project(either here or privately)?
System.IO prefix is needed because the type seems to be defined in both mscorlib.dll and System.IO.something.dll . And I canât drop either of them because in that case other stuff becomes broken. Iâll send you the project now.
In general, Iâve managed with compiling all SecureBlackbox assemblies with minimal code adjustments. Itâs time to test them now.
Hey Carlo,
Hope you are OK. I am going to take this topic over from Eugene now.
While weâve indeed managed to compile the assemblies against .NET Core revision of the framework, there is something .NET Core compilers donât like about them. Specifically, when trying to reference a SecureBlackbox assembly from a .NET core app, we get a bunch of compilation errors looking like the one below:
Error CS0012 The type âObjectâ is defined in an assembly that is not referenced. You must add a reference to assembly âmscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089â.
The errors are reported for any line of code that makes a call to one of SecureBlackbox methods.
We did some research, and it looks like the problem is in a reference to mscorlib.dll contained in all assemblies generated by Oxygene. As far as I understand, this is not exactly legitimate to reference mscorlib.dll from a .NET core application/library, as that assembly is platform-specific and can differ for different underlying platforms. Instead, a collection of higher-level unified proxy assemblies and/or NuGet packages, such as System.Runtime, should be referenced, that redirect framework calls internally to appropriate platform-dependent assemblies.
We tried to reflect that requirement in our .oxygene project files by removing any mscorlib.dll references and adding references to System.Runtime.dll, System.Runtime.Interop.dll etc. instead, but we came across issues. It seems that Oxygene always inserts an implicit reference to mscorlib.dll, even if the latter is not specified explicitly in the project file. We also noticed that no System.Runtime.dll and System.Runtime.Interop.dll actually get referenced from the resulting DLL, even though they are reported as valid references in the compiler log.
Could you please suggest how we can stop Oxygene from generating a reference to mscorlib.dll and force it to insert references to System.Runtime.dll etc. instead?
Thanks,
Ken
P.S. On a side note, it would be great if Oxygene was able to reference entire NuGet packages (like âMicrosoft.NETCore.Appâ) when building .NET Core assemblies, as that would simplify our building processes significantly.
can you send me a generated dll of yours? (here or privately)
Elements should never generate an mscorlib reference on itâs own.
Iâve just sent the DLL together with all the details to you by e-mail. Thank you!
Thanks, logged as bugs://76084
bugs://76084 got closed with status fixed.
Logged as bugs://i64011.
bugs://i64011 was closed as fixed.