Skip to content

Commit 745595b

Browse files
committed
Convert to a netstandard library but multitarget to support net45 as well
1 parent fabe1a4 commit 745595b

File tree

7 files changed

+22
-215
lines changed

7 files changed

+22
-215
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ ipch/
6868
*.sdf
6969
*.cachefile
7070

71-
# Visual Studio profiler
71+
# Visual Studio
7272
*.psess
7373
*.vsp
7474
*.vspx
75+
*.vs
7576

7677
# TFS 2012 Local Workspace
7778
$tf/

NameParser/NameParser.sln

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2013
4-
VisualStudioVersion = 12.0.31101.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.28307.271
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NameParser", "NameParser\NameParser.csproj", "{63B86F06-9B90-4971-92D1-B9601063778E}"
77
EndProject
@@ -25,4 +25,7 @@ Global
2525
GlobalSection(SolutionProperties) = preSolution
2626
HideSolutionNode = FALSE
2727
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {B8C97786-B75E-42AA-B82A-10AACE17E7A2}
30+
EndGlobalSection
2831
EndGlobal
Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,8 @@
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>{63B86F06-9B90-4971-92D1-B9601063778E}</ProjectGuid>
8-
<OutputType>Library</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>NameParser</RootNamespace>
11-
<AssemblyName>NameParser</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
3+
<TargetFrameworks>netstandard20;net45</TargetFrameworks>
144
</PropertyGroup>
15-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16-
<DebugSymbols>true</DebugSymbols>
17-
<DebugType>full</DebugType>
18-
<Optimize>false</Optimize>
19-
<OutputPath>bin\Debug\</OutputPath>
20-
<DefineConstants>DEBUG;TRACE</DefineConstants>
21-
<ErrorReport>prompt</ErrorReport>
22-
<WarningLevel>4</WarningLevel>
23-
</PropertyGroup>
24-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25-
<DebugType>pdbonly</DebugType>
26-
<Optimize>true</Optimize>
27-
<OutputPath>bin\Release\</OutputPath>
28-
<DefineConstants>TRACE</DefineConstants>
29-
<ErrorReport>prompt</ErrorReport>
30-
<WarningLevel>4</WarningLevel>
31-
</PropertyGroup>
32-
<ItemGroup>
33-
<Reference Include="System" />
34-
<Reference Include="System.Core" />
35-
<Reference Include="System.Xml.Linq" />
36-
<Reference Include="System.Data.DataSetExtensions" />
37-
<Reference Include="Microsoft.CSharp" />
38-
<Reference Include="System.Data" />
39-
<Reference Include="System.Xml" />
40-
</ItemGroup>
41-
<ItemGroup>
42-
<Compile Include="Config.cs" />
43-
<Compile Include="Parser.cs" />
44-
<Compile Include="Properties\AssemblyInfo.cs" />
45-
</ItemGroup>
465
<ItemGroup>
476
<Content Include="LICENSE.txt" />
487
</ItemGroup>
49-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
50-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
51-
Other similar extension points exist, see Microsoft.Common.targets.
52-
<Target Name="BeforeBuild">
53-
</Target>
54-
<Target Name="AfterBuild">
55-
</Target>
56-
-->
578
</Project>

NameParser/NameParser/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 6 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,13 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
32
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProjectGuid>{7D33DD62-7D6F-4B3E-B369-8D58EE057914}</ProjectGuid>
7-
<OutputType>Library</OutputType>
8-
<AppDesignerFolder>Properties</AppDesignerFolder>
9-
<RootNamespace>NameParserTest</RootNamespace>
10-
<AssemblyName>NameParserTest</AssemblyName>
11-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
12-
<FileAlignment>512</FileAlignment>
13-
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14-
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
15-
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
16-
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
17-
<IsCodedUITest>False</IsCodedUITest>
18-
<TestProjectType>UnitTest</TestProjectType>
3+
<TargetFramework>netcoreapp2.1</TargetFramework>
194
</PropertyGroup>
20-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21-
<DebugSymbols>true</DebugSymbols>
22-
<DebugType>full</DebugType>
23-
<Optimize>false</Optimize>
24-
<OutputPath>bin\Debug\</OutputPath>
25-
<DefineConstants>DEBUG;TRACE</DefineConstants>
26-
<ErrorReport>prompt</ErrorReport>
27-
<WarningLevel>4</WarningLevel>
28-
</PropertyGroup>
29-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
30-
<DebugType>pdbonly</DebugType>
31-
<Optimize>true</Optimize>
32-
<OutputPath>bin\Release\</OutputPath>
33-
<DefineConstants>TRACE</DefineConstants>
34-
<ErrorReport>prompt</ErrorReport>
35-
<WarningLevel>4</WarningLevel>
36-
</PropertyGroup>
37-
<ItemGroup>
38-
<Reference Include="System" />
39-
</ItemGroup>
40-
<Choose>
41-
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
42-
<ItemGroup>
43-
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
44-
</ItemGroup>
45-
</When>
46-
<Otherwise>
47-
<ItemGroup>
48-
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
49-
</ItemGroup>
50-
</Otherwise>
51-
</Choose>
525
<ItemGroup>
53-
<Compile Include="NameParserTests.cs" />
54-
<Compile Include="Properties\AssemblyInfo.cs" />
6+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
7+
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
8+
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
559
</ItemGroup>
5610
<ItemGroup>
57-
<ProjectReference Include="..\NameParser\NameParser.csproj">
58-
<Project>{63b86f06-9b90-4971-92d1-b9601063778e}</Project>
59-
<Name>NameParser</Name>
60-
</ProjectReference>
11+
<ProjectReference Include="..\NameParser\NameParser.csproj" />
6112
</ItemGroup>
62-
<Choose>
63-
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
64-
<ItemGroup>
65-
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
66-
<Private>False</Private>
67-
</Reference>
68-
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
69-
<Private>False</Private>
70-
</Reference>
71-
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
72-
<Private>False</Private>
73-
</Reference>
74-
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
75-
<Private>False</Private>
76-
</Reference>
77-
</ItemGroup>
78-
</When>
79-
</Choose>
80-
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
81-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
82-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
83-
Other similar extension points exist, see Microsoft.Common.targets.
84-
<Target Name="BeforeBuild">
85-
</Target>
86-
<Target Name="AfterBuild">
87-
</Target>
88-
-->
8913
</Project>

NameParser/NameParserTest/NameParserTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
namespace NameParseTest
2-
{
3-
using Microsoft.VisualStudio.TestTools.UnitTesting;
4-
using NameParser;
5-
using System;
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using NameParser;
3+
using System;
64

5+
namespace NameParseTest
6+
{
77
[TestClass]
88
public class NameParserTests
99
{
@@ -249,15 +249,15 @@ public void ThreeNames()
249249

250250
Assert.IsNotNull(janeDoe.AdditionalName);
251251
var abrahamLincoln = janeDoe.AdditionalName;
252-
252+
253253
Assert.AreEqual("Mr", johnSmith.Title);
254254
Assert.AreEqual("John", johnSmith.First);
255255
Assert.AreEqual("Smith", johnSmith.Last);
256256

257257
Assert.AreEqual("Mrs", janeDoe.Title);
258258
Assert.AreEqual("Jane", janeDoe.First);
259259
Assert.AreEqual("Doe", janeDoe.Last);
260-
260+
261261
Assert.AreEqual("President", abrahamLincoln.Title);
262262
Assert.AreEqual("Abraham", abrahamLincoln.First);
263263
Assert.AreEqual("Lincoln", abrahamLincoln.Last);

NameParser/NameParserTest/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)