Skip to content

Commit 19366a6

Browse files
further work on migrating to .NET Standard
1 parent 1dd8cb8 commit 19366a6

File tree

8 files changed

+158
-124
lines changed

8 files changed

+158
-124
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
namespace TestAssembly.Controllers
22
{
3+
#if netmvc
34
using System.Web.Http;
45

56
public class BarApiControler : ApiController
67
{
78

89
}
10+
#endif
911
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
namespace TestAssembly.Controllers
22
{
3+
#if netmvc
34
using System.Web.Mvc;
45

56
public class FooControler : Controller
67
{
78

89
}
10+
#endif
911
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
namespace TestAssembly.Controllers
22
{
3+
#if netmvc
34
using System.Web.Http;
45

56
public class MyApiController : ApiController
67
{
78

89
}
10+
#endif
911
}

TestAssembly/TestAssembly.csproj

100644100755
Lines changed: 25 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,32 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{D5A0D078-C660-4654-8A14-DDC816BEBC54}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>TestAssembly</RootNamespace>
3+
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net35;net40;net451;netstandard1.5;</TargetFrameworks>
4+
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard1.5</TargetFrameworks>
115
<AssemblyName>TestAssembly</AssemblyName>
12-
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<NuGetPackageImportStamp>0443d319</NuGetPackageImportStamp>
6+
<PackageId>TestAssembly</PackageId>
7+
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
8+
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
9+
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
10+
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
11+
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
12+
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
13+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
1514
</PropertyGroup>
16-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17-
<DebugSymbols>true</DebugSymbols>
18-
<DebugType>full</DebugType>
19-
<Optimize>false</Optimize>
20-
<OutputPath>bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE</DefineConstants>
22-
<ErrorReport>prompt</ErrorReport>
23-
<WarningLevel>4</WarningLevel>
24-
</PropertyGroup>
25-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26-
<DebugType>pdbonly</DebugType>
27-
<Optimize>true</Optimize>
28-
<OutputPath>bin\Release\</OutputPath>
29-
<DefineConstants>TRACE</DefineConstants>
30-
<ErrorReport>prompt</ErrorReport>
31-
<WarningLevel>4</WarningLevel>
32-
</PropertyGroup>
33-
<ItemGroup>
34-
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
35-
<Private>True</Private>
36-
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
37-
</Reference>
38-
<Reference Include="Newtonsoft.Json">
39-
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
40-
</Reference>
41-
<Reference Include="System" />
42-
<Reference Include="System.Core" />
43-
<Reference Include="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
44-
<HintPath>..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.dll</HintPath>
45-
</Reference>
46-
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
47-
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
48-
</Reference>
49-
<Reference Include="System.Net.Http.WebRequest, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
50-
<HintPath>..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
51-
</Reference>
52-
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
53-
<Private>True</Private>
54-
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll</HintPath>
55-
</Reference>
56-
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
57-
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll</HintPath>
58-
</Reference>
59-
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
60-
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
61-
</Reference>
62-
<Reference Include="System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
63-
<Private>True</Private>
64-
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.40804.0\lib\net40\System.Web.Mvc.dll</HintPath>
65-
</Reference>
66-
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
67-
<Private>True</Private>
68-
<HintPath>..\packages\Microsoft.AspNet.Razor.2.0.20710.0\lib\net40\System.Web.Razor.dll</HintPath>
69-
</Reference>
70-
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
71-
<Private>True</Private>
72-
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll</HintPath>
73-
</Reference>
74-
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
75-
<Private>True</Private>
76-
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
77-
</Reference>
78-
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
79-
<Private>True</Private>
80-
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
81-
</Reference>
82-
<Reference Include="System.Xml.Linq" />
83-
<Reference Include="System.Data.DataSetExtensions" />
15+
16+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
17+
<Reference Include="System.Runtime" />
18+
<Reference Include="System.Threading.Tasks" />
19+
<Reference Include="System.Web" />
8420
<Reference Include="Microsoft.CSharp" />
85-
<Reference Include="System.Data" />
86-
<Reference Include="System.Xml" />
8721
</ItemGroup>
88-
<ItemGroup>
89-
<Compile Include="ClassWithNoDefaultCtor.cs" />
90-
<Compile Include="ClassWithNonVirtualMethod.cs" />
91-
<Compile Include="ClassWithPrivateDefaultCtor.cs" />
92-
<Compile Include="ClassWithProtectedDefaultCtor.cs" />
93-
<Compile Include="ClassWithPublicDefaultCtor.cs" />
94-
<Compile Include="Collections\Branch.cs" />
95-
<Compile Include="Collections\Forest.cs" />
96-
<Compile Include="Collections\ICanAdd.cs" />
97-
<Compile Include="Collections\ICanRemove.cs" />
98-
<Compile Include="Collections\Leaf.cs" />
99-
<Compile Include="Collections\Tree.cs" />
100-
<Compile Include="Controllers\BarApiControler.cs" />
101-
<Compile Include="Controllers\FooControler.cs" />
102-
<Compile Include="Controllers\MyApiController.cs" />
103-
<Compile Include="Controllers\TestApiController.cs" />
104-
<Compile Include="Controllers\TestController.cs" />
105-
<Compile Include="Dtos\AnotherClass.cs" />
106-
<Compile Include="Dtos\BlahDto.cs" />
107-
<Compile Include="Properties\AssemblyInfo.cs" />
108-
<Compile Include="SomeDto.cs" />
22+
23+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
24+
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
10925
</ItemGroup>
110-
<ItemGroup>
111-
<None Include="packages.config" />
112-
</ItemGroup>
113-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
114-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
115-
Other similar extension points exist, see Microsoft.Common.targets.
116-
<Target Name="BeforeBuild">
117-
</Target>
118-
<Target Name="AfterBuild">
119-
</Target>
120-
-->
26+
27+
28+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
29+
<DefineConstants>$(DefineConstants);netmvc</DefineConstants>
30+
</PropertyGroup>
31+
12132
</Project>

TestAssembly/_TestAssembly.csprojbu

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{D5A0D078-C660-4654-8A14-DDC816BEBC54}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>TestAssembly</RootNamespace>
11+
<AssemblyName>TestAssembly</AssemblyName>
12+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<NuGetPackageImportStamp>0443d319</NuGetPackageImportStamp>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
35+
<Private>True</Private>
36+
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
37+
</Reference>
38+
<Reference Include="Newtonsoft.Json">
39+
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
40+
</Reference>
41+
<Reference Include="System" />
42+
<Reference Include="System.Core" />
43+
<Reference Include="System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
44+
<HintPath>..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.dll</HintPath>
45+
</Reference>
46+
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
47+
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
48+
</Reference>
49+
<Reference Include="System.Net.Http.WebRequest, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
50+
<HintPath>..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
51+
</Reference>
52+
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
53+
<Private>True</Private>
54+
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.Helpers.dll</HintPath>
55+
</Reference>
56+
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
57+
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll</HintPath>
58+
</Reference>
59+
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
60+
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
61+
</Reference>
62+
<Reference Include="System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
63+
<Private>True</Private>
64+
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.40804.0\lib\net40\System.Web.Mvc.dll</HintPath>
65+
</Reference>
66+
<Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
67+
<Private>True</Private>
68+
<HintPath>..\packages\Microsoft.AspNet.Razor.2.0.20710.0\lib\net40\System.Web.Razor.dll</HintPath>
69+
</Reference>
70+
<Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
71+
<Private>True</Private>
72+
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll</HintPath>
73+
</Reference>
74+
<Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
75+
<Private>True</Private>
76+
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
77+
</Reference>
78+
<Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
79+
<Private>True</Private>
80+
<HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
81+
</Reference>
82+
<Reference Include="System.Xml.Linq" />
83+
<Reference Include="System.Data.DataSetExtensions" />
84+
<Reference Include="Microsoft.CSharp" />
85+
<Reference Include="System.Data" />
86+
<Reference Include="System.Xml" />
87+
</ItemGroup>
88+
<ItemGroup>
89+
<Compile Include="ClassWithNoDefaultCtor.cs" />
90+
<Compile Include="ClassWithNonVirtualMethod.cs" />
91+
<Compile Include="ClassWithPrivateDefaultCtor.cs" />
92+
<Compile Include="ClassWithProtectedDefaultCtor.cs" />
93+
<Compile Include="ClassWithPublicDefaultCtor.cs" />
94+
<Compile Include="Collections\Branch.cs" />
95+
<Compile Include="Collections\Forest.cs" />
96+
<Compile Include="Collections\ICanAdd.cs" />
97+
<Compile Include="Collections\ICanRemove.cs" />
98+
<Compile Include="Collections\Leaf.cs" />
99+
<Compile Include="Collections\Tree.cs" />
100+
<Compile Include="Controllers\BarApiControler.cs" />
101+
<Compile Include="Controllers\FooControler.cs" />
102+
<Compile Include="Controllers\MyApiController.cs" />
103+
<Compile Include="Controllers\TestApiController.cs" />
104+
<Compile Include="Controllers\TestController.cs" />
105+
<Compile Include="Dtos\AnotherClass.cs" />
106+
<Compile Include="Dtos\BlahDto.cs" />
107+
<Compile Include="Properties\AssemblyInfo.cs" />
108+
<Compile Include="SomeDto.cs" />
109+
</ItemGroup>
110+
<ItemGroup>
111+
<None Include="packages.config" />
112+
</ItemGroup>
113+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
114+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
115+
Other similar extension points exist, see Microsoft.Common.targets.
116+
<Target Name="BeforeBuild">
117+
</Target>
118+
<Target Name="AfterBuild">
119+
</Target>
120+
-->
121+
</Project>

TestStack.ConventionTests.Autofac/TestStack.ConventionTests.Autofac.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
<PackageReference Include="Autofac" Version="4.2.1" />
2323
</ItemGroup>
2424

25-
<ItemGroup>
26-
<ProjectReference Include="..\TestStack.ConventionTests\TestStack.ConventionTests.csproj" />
27-
</ItemGroup>
25+
2826

2927
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
3028
<DefineConstants>$(DefineConstants);NewReflection;</DefineConstants>
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<PropertyGroup>
43
<TargetFramework>netstandard1.6</TargetFramework>
54
<AssemblyName>TestStack.ConventionTests.Tests</AssemblyName>
@@ -12,17 +11,13 @@
1211
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
1312
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
1413
</PropertyGroup>
15-
16-
1714
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
1815
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
1916
</ItemGroup>
20-
2117
<ItemGroup>
22-
<PackageReference Include="Autofac" Version="4.6.0" />
18+
<PackageReference Include="Autofac" Version="4.6.1" />
2319
<PackageReference Include="NSubstitute" Version="2.0.3" />
2420
<PackageReference Include="NUnit" Version="3.7.1" />
2521
<PackageReference Include="Shouldly" Version="2.8.3" />
2622
</ItemGroup>
27-
28-
</Project>
23+
</Project>

TestStack.ConventionTests/TestStack.ConventionTests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<PackageReference Include="System.Xml.XDocument" Version="4.3.0" />
3131
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
3232
</ItemGroup>
33+
<ItemGroup>
34+
<ProjectReference Include="..\TestAssembly\TestAssembly.csproj" />
35+
</ItemGroup>
3336
<PropertyGroup Condition=" '$(TargetFramework)' == 'net35' ">
3437
<DefineConstants>$(DefineConstants);Serializable</DefineConstants>
3538
</PropertyGroup>

0 commit comments

Comments
 (0)