Skip to content

[WIP] NH-3807 Support for .NET Core 1.0 #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
210178b
Indention fix. One method was weirdly indented.
ngbrown Aug 10, 2016
3bfc5dc
NH-3853 - Remove NET_4_0 guards around SecurityCriticalAttribute, ful…
ngbrown Aug 15, 2016
9f4cdca
NH-3853 - Add CoalesceType so projections don't rely on SerializableT…
ngbrown Aug 7, 2016
3ef76b6
NH-3853 - Remove serialization from Exceptions for CoreClr.
ngbrown Aug 15, 2016
bb73052
NH-3853 - Guard usage of SerializableType for CoreClr.
ngbrown Aug 15, 2016
72c6e3b
NH-3853 - Move SerializationHelper to the test project where it's used.
ngbrown Aug 7, 2016
04ac9e3
NH-3853 - Guard use of SerializationHelper in unit tests for CoreClr.
ngbrown Aug 15, 2016
ed0b7bb
NH-3853 - Guard usage of ISerializable and IDeserializationCallback f…
ngbrown Aug 15, 2016
85c2d8c
NH-3853 - Guard use serialization and Any types in unit tests for Cor…
ngbrown Aug 15, 2016
2ba02af
NH-3853 - Replace use of FormatterConverter::ToString with Convert.To…
ngbrown Aug 15, 2016
e0daa0b
NH-3853 - Solution and project configuration without features, for te…
ngbrown Aug 15, 2016
6a8dc5d
NH-3807 - Add compatibility layer of Attributes for CoreClr.
ngbrown Aug 15, 2016
1199e84
NH-3807 - Replace use of ApplicationException with Exception.
ngbrown Aug 7, 2016
ce4b7f0
NH-3807 - Replace use of Array.ConvertAll with Linq.Select.
ngbrown Aug 7, 2016
9ede6eb
NH-3807 - Replace use of MethodImplOptions.Syncronized with method bo…
ngbrown Aug 15, 2016
2f90d5c
NH-3807 - Replace use of Array.ForEach with EnumerableExtensions.ForE…
ngbrown Aug 9, 2016
acff8e1
NH-3807 - Replace use of System.Collections.Queue with System.Collect…
ngbrown Aug 7, 2016
440b223
NH-3807 - Replace use of System.Collections.Stack with System.Collect…
ngbrown Aug 10, 2016
b29a10c
NH-3807 - Replace use of InvariantCultureIgnoreCase with OrdinalIgnor…
ngbrown Aug 7, 2016
80adb06
NH-3807 - Add AssemblyName to Assembly.Load
ngbrown Aug 15, 2016
abcbb6f
NH-3807 - Clean up some namespaces.
ngbrown Aug 10, 2016
49ce1dd
NH-3807 - Switch stream's over to using statements.
ngbrown Aug 15, 2016
31b9b1d
NH-3807 - Use XmlReader.Create instead of XmlTextReader.
ngbrown Aug 14, 2016
8e8de5b
NH-3807 - Replace uses of ToShortTimeString, ToShortDateString, Compa…
ngbrown Aug 14, 2016
d645630
NH-3807 - Took care of most of the GetTypeInfo() needs.
ngbrown Aug 15, 2016
7d085b1
# This is a combination of 2 commits.
hazzik Mar 16, 2017
bf3c44b
XXX
hazzik Mar 16, 2017
dc2dea2
NH-3807 - Refactoring Mapping.ByCode to reduce use of ReflectedType.
ngbrown Aug 14, 2016
551b21d
NH-3807 - Expand list of features #defined for standard .NET build.
ngbrown Aug 16, 2016
79397c0
NH-3807 - Stop passing DataRow into AbstractColumnMetaData, as it doe…
ngbrown Aug 16, 2016
c1e7497
NH-3807 - Make ProxyFactory take care of its own AppDomain.CurrentDomain
ngbrown Aug 20, 2016
83bc9bb
NH-3807 - Guard on System.Configuration
ngbrown Aug 16, 2016
d873f91
NH-3807 - Guard on XmlSchemas and Xml ValidationEventHandler
ngbrown Aug 16, 2016
8650a0a
NH-3807 - Guard on Odbc and OleDb
ngbrown Aug 16, 2016
9a282b8
NH-3807 - Guard System.Security permissions and attributes
ngbrown Aug 16, 2016
6991d27
NH-3807 - Guard Remoting methods and types and Wcf service model oper…
ngbrown Aug 16, 2016
5fb4f65
NH-3807 - Guard System.Transactions, that is distributed transactions.
ngbrown Aug 16, 2016
01c5d10
NH-3807 - Guard CodeDom and handle switch between DelegateBuilder cre…
ngbrown Aug 16, 2016
1329cd1
NH-3807 - Handle DbDataReader not having a Close and GetSchemaTable o…
ngbrown Aug 16, 2016
135fc34
NH-3807 - Since AppDomain is no longer CoreClr, use AppContext.BaseDi…
ngbrown Aug 20, 2016
a91ddbe
NH-3807 - Guard on all uses of GetSchemaTable, including use of dbm2d…
ngbrown Aug 20, 2016
5643186
NH-3807 - Guard on uses of HttpContext since CoreCli doesn't have it.
ngbrown Aug 20, 2016
77a6c94
NH-3807 - Centeralize all use of string.Intern() and guard on use for…
ngbrown Aug 20, 2016
08029f9
NH-3807 - Guard on use of DbProviderFactories for CoreClr.
ngbrown Aug 20, 2016
6efa605
NH-3807 - Other misc reflection changes for CoreClr.
ngbrown Aug 21, 2016
12407dc
NH-3807 - CoreClr no longer has SqlCommendSet to reflect on, so defau…
ngbrown Aug 21, 2016
c996d4f
Convert to VS2017 projects
hazzik Mar 17, 2017
2c9e75f
Convert NHibernate.DomainModel to .NET Core multi-target project
hazzik Mar 17, 2017
6d4d80f
NH-3807 - Build with MSBuild 2017
hazzik Mar 17, 2017
c7d1047
NH-3807 - Use "modern" way to find MSBuild
hazzik Mar 17, 2017
c1d62bf
NH-3962 - Build with MSBuild Tools 2017
hazzik Mar 17, 2017
1b94287
Set MSBuildSDKsPath
hazzik Mar 17, 2017
89414fb
Update msbuild.cmd
hazzik Mar 17, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ current-test-configuration
# to satisfy later build steps. But it should not be committed.
NHibernate.dll
TestResult.xml
/src/packages
*.lock.json
1 change: 1 addition & 0 deletions Tools/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
nuget.exe
NUnit.*
vswhere.*
15 changes: 15 additions & 0 deletions Tools/msbuild.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off
set MSBuildSDKsPath="C:\Program Files\dotnet\sdk\1.0.1\Sdks"

set pre=Microsoft.VisualStudio.Product.
set ids=%pre%Community %pre%Professional %pre%Enterprise %pre%BuildTools

for /f "usebackq tokens=1* delims=: " %%i in (`%~dp0\vswhere.1.0.58\tools\vswhere.exe -latest -products %ids% -requires Microsoft.Component.MSBuild`) do (
if /i "%%i"=="installationPath" set InstallDir=%%j
)

if exist "%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" (
"%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" %*
) else (
exit /b -1
)
3 changes: 2 additions & 1 deletion Tools/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.5.0" targetFramework="net461" />
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.2" targetFramework="net461" />
<package id="NUnit.Extension.VSProjectLoader" version="3.5.0" targetFramework="net461" />
</packages>
<package id="vswhere" version="1.0.58" targetFramework="net461" />
</packages>
4 changes: 1 addition & 3 deletions build-common/common-project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@

<target name="common.compile-all" depends="common.generate-assemblyinfo common.nuget-restore">
<!--property name="msbuild.cmd" value="${cmd.sln} ${cmd.out} ${cmd.platform} ${cmd.debug} ${cmd.optimize} ${cmd.doc} /t:Rebuild /v:q /m" /-->
<readregistry property="MSBuildToolsPath" key="SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0\MSBuildToolsPath" hive="LocalMachine" />

<exec program="${path::combine(MSBuildToolsPath, 'msbuild.exe')}" verbose="true">
<exec program="${path::combine(tools.dir, 'msbuild.cmd')}" verbose="true">
<arg value="${root.dir}/src/NHibernate.sln" />
<arg value="/p:OutputPath=&quot;${path::get-full-path(bin.dir)}&quot;" />
<arg value="/p:Platform=&quot;Any CPU&quot;" />
Expand Down
10 changes: 10 additions & 0 deletions src/NHibernate.DomainModel/Compat/NonSerializedAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#if !FEATURE_SERIALIZATION && NETSTANDARD
// ReSharper disable once CheckNamespace
namespace System
{
[AttributeUsage(AttributeTargets.Field, Inherited = false)]
internal sealed class NonSerializedAttribute : Attribute
{
}
}
#endif
10 changes: 10 additions & 0 deletions src/NHibernate.DomainModel/Compat/SerializableAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#if !FEATURE_SERIALIZATION && NETSTANDARD
// ReSharper disable once CheckNamespace
namespace System
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Delegate, Inherited = false)]
internal sealed class SerializableAttribute : Attribute
{
}
}
#endif
4 changes: 4 additions & 0 deletions src/NHibernate.DomainModel/Foo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,11 @@ public LifecycleVeto OnSave(ISession s)
_component.Glarch = new Glarch();
_dependent = new Fee();
_dependent.Fi = "belongs to foo # " + Key;
#if !NETSTANDARD
_locale = Thread.CurrentThread.CurrentCulture;
#else
_locale = CultureInfo.CurrentCulture;
#endif
return LifecycleVeto.NoVeto;
}

Expand Down
2 changes: 2 additions & 0 deletions src/NHibernate.DomainModel/Master.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public ISet<Detail> Details
get { return _details; }
set
{
#if !NETSTANDARD
Trace.WriteLine("Details assigned");
#endif
_details = value;
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/NHibernate.DomainModel/NHSpecific/NullableInt32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ namespace NHibernate.DomainModel.NHSpecific
/// <summary>
/// A nullable type that wraps an <see cref="Int32"/> value.
/// </summary>
[TypeConverter(typeof(NullableInt32Converter)), Serializable()]
#if !NETSTANDARD
[TypeConverter(typeof(NullableInt32Converter))]
#endif
[Serializable]
public struct NullableInt32 : IFormattable, IComparable
{
public static readonly NullableInt32 Default = new NullableInt32();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if !NETSTANDARD
using System;
using System.Collections;
using System.ComponentModel;
Expand Down Expand Up @@ -96,4 +97,5 @@ public override bool GetPropertiesSupported(ITypeDescriptorContext context)
return true;
}
}
}
}
#endif
Loading