Skip to content

Commit

Permalink
add netstandard2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-xu committed Sep 10, 2017
1 parent 8bf6611 commit c10ccf6
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/Ninject/Activation/InstanceReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class InstanceReference
[SecuritySafeCritical]
public bool Is<T>()
{
#if !CORE
#if !NO_REMOTING
if (System.Runtime.Remoting.RemotingServices.IsTransparentProxy(this.Instance)
&& System.Runtime.Remoting.RemotingServices.GetRealProxy(this.Instance).GetType().Name == "RemotingProxy")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public static string Format(this ITarget target)
throw new ArgumentOutOfRangeException();
}

#if !CORE
#if !NO_REFLECTEDTYPE
sw.Write(" of type {0}", target.Member.ReflectedType.Format());
#endif
return sw.ToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static bool IsPrivate(this PropertyInfo propertyInfo)
/// <returns>The custom attributes.</returns>
public static IEnumerable<Attribute> GetCustomAttributesExtended(this MemberInfo member, Type attributeType, bool inherited)
{
#if !CORE
#if !NO_GETCUSTOMATTRIBUTES
return Attribute.GetCustomAttributes(member, attributeType, inherited);
#else
var propertyInfo = member as PropertyInfo;
Expand Down
2 changes: 1 addition & 1 deletion src/Ninject/Infrastructure/StandardScopeCallbacks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class StandardScopeCallbacks
/// </summary>
public static readonly Func<IContext, object> Singleton = ctx => ctx.Kernel;

#if !NO_CURRENT_THREAD
#if !NO_THREAD_SCOPE
/// <summary>
/// Gets the callback for thread scope.
/// </summary>
Expand Down
48 changes: 28 additions & 20 deletions src/Ninject/Ninject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Copyright>2007-2010, Enkari, Ltd. 2010-2016, Ninject Contributors.</Copyright>
<VersionPrefix>4.0.0-beta</VersionPrefix>
<Authors>Nate Kohari ([email protected]);Remo Gloor ([email protected]);Ninject Contributors</Authors>
<TargetFrameworks>netstandard1.3;netstandard1.5;net45</TargetFrameworks>
<TargetFrameworks>netstandard1.3;netstandard1.5;netstandard2.0;net45</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Ninject</AssemblyName>
Expand All @@ -20,33 +20,32 @@
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/ninject/Ninject</RepositoryUrl>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.1</NetStandardImplicitPackageVersion>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.5' ">1.6.1</NetStandardImplicitPackageVersion>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>pdbonly</DebugType>
<DebugSymbols>True</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<!-- Include symbols in the package -->
<ItemGroup Condition=" '$(Configuration)' == 'Release' ">
<Content Include="$(OutputPath)/**/$(AssemblyName).pdb">
<Pack>true</Pack>
<PackagePath>$(BuildOutputTargetFolder)/%(RecursiveDir)$(AssemblyName).pdb</PackagePath>
</Content>
</ItemGroup>

<ItemGroup Condition=" '$(Configuration)' == 'Release' ">
<PackageReference Include="gitlink" Version="3.0.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="stylecop.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="gitlink" Version="3.0.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
Expand All @@ -70,17 +69,26 @@
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Reflection.Emit.ILGeneration" Version="4.3.0" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>$(DefineConstants);CORE;NO_MEMBERTYPE;NO_CUSTOM_ATTRIBUTE_PROVIDER;NO_ASSEMBLY_SCANNING;NO_EXCEPTION_SERIALIZATION;NO_CURRENT_THREAD</DefineConstants>
<DefineConstants>$(DefineConstants);NO_REMOTING;NO_REFLECTEDTYPE;NO_GETCUSTOMATTRIBUTES;NO_MEMBERTYPE;NO_CUSTOM_ATTRIBUTE_PROVIDER;NO_ASSEMBLY_SCANNING;NO_EXCEPTION_SERIALIZATION;NO_THREAD_SCOPE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' ">
<DefineConstants>$(DefineConstants);CORE;NO_ASSEMBLY_SCANNING;NO_EXCEPTION_SERIALIZATION;NO_CURRENT_THREAD</DefineConstants>
<DefineConstants>$(DefineConstants);NO_REMOTING;NO_REFLECTEDTYPE;NO_GETCUSTOMATTRIBUTES;NO_ASSEMBLY_SCANNING;NO_EXCEPTION_SERIALIZATION;NO_THREAD_SCOPE</DefineConstants>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<DefineConstants>$(DefineConstants);NO_REMOTING;NO_ASSEMBLY_SCANNING</DefineConstants>
</PropertyGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public IBindingNamedWithOrOnSyntax<T> InTransientScope()
return this;
}

#if !NO_CURRENT_THREAD
#if !NO_THREAD_SCOPE
/// <summary>
/// Indicates that instances activated via the binding should be re-used within the same thread.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Ninject/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
[assembly: AssemblyCompany("Ninject Project Contributors")]
[assembly: AssemblyCopyright("2007-2010, Enkari, Ltd. 2010-2016, Ninject Contributors.")]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.6")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
2 changes: 1 addition & 1 deletion src/Ninject/Syntax/IBindingInSyntax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public interface IBindingInSyntax<T> : IBindingSyntax
/// <returns>The fluent syntax.</returns>
IBindingNamedWithOrOnSyntax<T> InTransientScope();

#if !NO_CURRENT_THREAD
#if !NO_THREAD_SCOPE
/// <summary>
/// Indicates that instances activated via the binding should be re-used within the same thread.
/// </summary>
Expand Down

0 comments on commit c10ccf6

Please sign in to comment.