diff --git a/build.proj b/build.proj index ea5cdb8a2..f99c6643b 100644 --- a/build.proj +++ b/build.proj @@ -28,6 +28,7 @@ of patent rights can be found in the PATENTS file in the same directory. <PackageAssemblies Include="React.MSBuild" /> <PackageAssemblies Include="React.Owin" /> <PackageAssemblies Include="React.Router" /> + <PackageAssemblies Include="React.Router.Mvc4" /> <PackageAssemblies Include="React.Web" /> <PackageAssemblies Include="React.Web.Mvc4" /> <PackageAssemblies Include="System.Web.Optimization.React" /> diff --git a/src/React.Router.Mvc4/React.Router.Mvc4.csproj b/src/React.Router.Mvc4/React.Router.Mvc4.csproj new file mode 100644 index 000000000..58d7b9a1f --- /dev/null +++ b/src/React.Router.Mvc4/React.Router.Mvc4.csproj @@ -0,0 +1,47 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <Description>React Router support for ReactJS.NET.</Description> + <Copyright>Copyright 2014-Present Facebook, Inc</Copyright> + <AssemblyTitle>ReactJS.NET Router</AssemblyTitle> + <Authors>Daniel Lo Nigro, Gunnar Már Óttarsson</Authors> + <TargetFrameworks>net451</TargetFrameworks> + <GenerateDocumentationFile>true</GenerateDocumentationFile> + <AssemblyName>React.Router.Mvc4</AssemblyName> + <DefineConstants>$(DefineConstants);LEGACYASPNET</DefineConstants> + <AssemblyOriginatorKeyFile>../key.snk</AssemblyOriginatorKeyFile> + <SignAssembly>true</SignAssembly> + <PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign> + <PackageId>React.Router.Mvc4</PackageId> + <PackageTags>asp.net;mvc;asp;javascript;js;react;facebook;reactjs;babel;router;react router</PackageTags> + <PackageIconUrl>http://reactjs.net/img/logo_64.png</PackageIconUrl> + <PackageProjectUrl>http://reactjs.net/</PackageProjectUrl> + <PackageLicenseUrl>https://github.com/reactjs/React.NET#licence</PackageLicenseUrl> + <GenerateAssemblyInfo>false</GenerateAssemblyInfo> + </PropertyGroup> + + <ItemGroup> + <Compile Include="..\React.Router\*.cs" /> + <Compile Include="..\SharedAssemblyInfo.cs" /> + <Compile Include="..\SharedAssemblyVersionInfo.cs" /> + <Content Include="Content\**\*"> + <Pack>true</Pack> + <PackagePath>content\</PackagePath> + </Content> + </ItemGroup> + + <ItemGroup> + <Reference Include="System.Web" /> + <Reference Include="Microsoft.CSharp" /> + <PackageReference Include="Microsoft.AspNet.Mvc" Version="4.0.20710" /> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\React.Core\React.Core.csproj" /> + </ItemGroup> + + <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + </PropertyGroup> + +</Project> \ No newline at end of file diff --git a/src/React.Router/HtmlHelperExtensions.cs b/src/React.Router/HtmlHelperExtensions.cs index cabd14c6f..2c33eb8aa 100644 --- a/src/React.Router/HtmlHelperExtensions.cs +++ b/src/React.Router/HtmlHelperExtensions.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2014-Present, Facebook, Inc. * All rights reserved. * @@ -8,12 +8,9 @@ */ using System; -using React.Exceptions; -using React.TinyIoC; -#if NET451 +#if LEGACYASPNET using System.Web; -using System.Web.Mvc; using HttpResponse = System.Web.HttpResponseBase; using IHtmlHelper = System.Web.Mvc.HtmlHelper; #else diff --git a/src/React.Router/React.Router.csproj b/src/React.Router/React.Router.csproj index c03204a80..9bcf26730 100644 --- a/src/React.Router/React.Router.csproj +++ b/src/React.Router/React.Router.csproj @@ -5,7 +5,7 @@ <Copyright>Copyright 2014-Present Facebook, Inc</Copyright> <AssemblyTitle>ReactJS.NET Router</AssemblyTitle> <Authors>Daniel Lo Nigro, Gunnar Már Óttarsson</Authors> - <TargetFrameworks>net451;netstandard1.6</TargetFrameworks> + <TargetFrameworks>netstandard2.0</TargetFrameworks> <GenerateDocumentationFile>true</GenerateDocumentationFile> <AssemblyName>React.Router</AssemblyName> <AssemblyOriginatorKeyFile>../key.snk</AssemblyOriginatorKeyFile> @@ -19,10 +19,6 @@ <GenerateAssemblyInfo>false</GenerateAssemblyInfo> </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net451|AnyCPU'"> - <DefineConstants>TRACE;DEBUG;ASPNETCORE;NET451</DefineConstants> - </PropertyGroup> - <ItemGroup> <Compile Include="..\SharedAssemblyInfo.cs" /> <Compile Include="..\SharedAssemblyVersionInfo.cs" /> @@ -32,15 +28,9 @@ </Content> </ItemGroup> - <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' "> - <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="1.0.3" /> - <PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="1.0.3" /> - </ItemGroup> - - <ItemGroup Condition=" '$(TargetFramework)' == 'net451' "> - <Reference Include="System.Web" /> - <Reference Include="Microsoft.CSharp" /> - <PackageReference Include="Microsoft.AspNet.Mvc" Version="4.0.20710" /> + <ItemGroup> + <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.0.0" /> + <PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.0.0" /> </ItemGroup> <ItemGroup> diff --git a/src/React.Router/ReactRouterComponent.cs b/src/React.Router/ReactRouterComponent.cs index 1d90b00ab..44c4bb17f 100644 --- a/src/React.Router/ReactRouterComponent.cs +++ b/src/React.Router/ReactRouterComponent.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2014-Present, Facebook, Inc. * All rights reserved. * @@ -7,9 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -using JavaScriptEngineSwitcher.Core; using Newtonsoft.Json; -using React.Exceptions; namespace React.Router { diff --git a/src/React.Router/ReactRouterException.cs b/src/React.Router/ReactRouterException.cs index 419397be4..20d521954 100644 --- a/src/React.Router/ReactRouterException.cs +++ b/src/React.Router/ReactRouterException.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2014-Present, Facebook, Inc. * All rights reserved. * @@ -15,7 +15,7 @@ namespace React.Router /// <summary> /// React Router Exception /// </summary> -#if NET451 +#if LEGACYASPNET [Serializable] #endif public class ReactRouterException : Exception @@ -38,7 +38,7 @@ public ReactRouterException(string message, Exception innerException) : base(message, innerException) { } -#if NET451 +#if LEGACYASPNET /// <summary> /// Used by deserialization /// </summary> diff --git a/src/React.Router/SetServerResponse.cs b/src/React.Router/SetServerResponse.cs index 3f225a3bc..ce7065e90 100644 --- a/src/React.Router/SetServerResponse.cs +++ b/src/React.Router/SetServerResponse.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 2014-Present, Facebook, Inc. * All rights reserved. * @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#if NET451 +#if LEGACYASPNET using HttpResponse = System.Web.HttpResponseBase; #else using HttpResponse = Microsoft.AspNetCore.Http.HttpResponse; @@ -45,7 +45,7 @@ public static void ModifyResponse(RoutingContext context, HttpResponse Response) { if (statusCode == 301) { -#if NET451 +#if LEGACYASPNET Response.RedirectPermanent(context.url); #else Response.Redirect(context.url, true); diff --git a/src/React.sln b/src/React.sln index 1e44bdf55..7e48cfad7 100644 --- a/src/React.sln +++ b/src/React.sln @@ -68,6 +68,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "React.AspNet.Middleware", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "React.Sample.CoreMvc", "React.Sample.CoreMvc\React.Sample.CoreMvc.csproj", "{305918EF-AD05-4743-9B3A-DB1CE84D467E}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "React.Router.Mvc4", "React.Router.Mvc4\React.Router.Mvc4.csproj", "{2170D912-86E9-4CE3-8DA4-E1DE8D958E63}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -142,6 +144,10 @@ Global {305918EF-AD05-4743-9B3A-DB1CE84D467E}.Debug|Any CPU.Build.0 = Debug|Any CPU {305918EF-AD05-4743-9B3A-DB1CE84D467E}.Release|Any CPU.ActiveCfg = Release|Any CPU {305918EF-AD05-4743-9B3A-DB1CE84D467E}.Release|Any CPU.Build.0 = Release|Any CPU + {2170D912-86E9-4CE3-8DA4-E1DE8D958E63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2170D912-86E9-4CE3-8DA4-E1DE8D958E63}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2170D912-86E9-4CE3-8DA4-E1DE8D958E63}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2170D912-86E9-4CE3-8DA4-E1DE8D958E63}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -164,6 +170,7 @@ Global {D076273B-C5EA-47C7-923D-523E4C5EE30D} = {681C45FB-103C-48BC-B992-20C5B6B78F92} {7E1C3999-1982-476D-9307-12B30737B41E} = {681C45FB-103C-48BC-B992-20C5B6B78F92} {305918EF-AD05-4743-9B3A-DB1CE84D467E} = {A51CE5B6-294F-4D39-B32B-BF08DAF9B40B} + {2170D912-86E9-4CE3-8DA4-E1DE8D958E63} = {681C45FB-103C-48BC-B992-20C5B6B78F92} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {DCF4A41E-C60D-4086-98A9-6F8508D7E8D0} diff --git a/tests/React.Tests/React.Tests.csproj b/tests/React.Tests/React.Tests.csproj index 8f21419d2..5387decc2 100644 --- a/tests/React.Tests/React.Tests.csproj +++ b/tests/React.Tests/React.Tests.csproj @@ -18,7 +18,7 @@ <ItemGroup> <ProjectReference Include="..\..\src\React.Core\React.Core.csproj" /> <ProjectReference Include="..\..\src\React.Owin\React.Owin.csproj" /> - <ProjectReference Include="..\..\src\React.Router\React.Router.csproj" /> + <ProjectReference Include="..\..\src\React.Router.Mvc4\React.Router.Mvc4.csproj" /> <ProjectReference Include="..\..\src\React.Web.Mvc4\React.Web.Mvc4.csproj" /> </ItemGroup>