Closed blairlearn closed 3 years ago
Remove the shared code files and replace them with the NuGet packages from http://github.com/nciocpl/ncI.OCPL.Api.Shared/
Parent Issue: Update the drug dictionary to .Net 3.1 #54
src/NCI.OCPL.Api.DrugDictionary/NCI.OCPL.Api.DrugDictionary.csproj
<TargetFramework>
netcoreapp3.1
<PackageReference>
<PackageReference Include="NSwag.AspNetCore" Version="13.11.*" /> <PackageReference Include="NEST" Version="5.6.*" />
test/NCI.OCPL.Api.DrugDictionary.Tests/NCI.OCPL.Api.DrugDictionary.Tests.csproj
<PackageReference Include="coverlet.msbuild" Version="3.0.*" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.10.*" /> <PackageReference Include="xunit" Version="2.4.*" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.4.*" /> <PackageReference Include="Moq" Version="4.13.*" />
From the command line, in the project's base directory, run the following commands (See the "Notes section for prerequisites)
$ dotnet remove src/NCI.OCPL.Api.DrugDictionary reference src/NCI.OCPL.Api.Common $ dotnet remove test/NCI.OCPL.Api.DrugDictionary.Tests reference src/NCI.OCPL.Api.Common $ dotnet remove test/NCI.OCPL.Api.DrugDictionary.Tests reference src/NCI.OCPL.Api.Common.Testing $ dotnet sln remove src/NCI.OCPL.Api.Common $ dotnet sln remove src/NCI.OCPL.Api.Common.Testing $ rm -rf src/NCI.OCPL.Api.Common src/NCI.OCPL.Api.Common.Testing
# Add NuGet packages $ dotnet add src/NCI.OCPL.Api.DrugDictionary package NCI.OCPL.Api.Common --version 1.0.* $ dotnet add test/NCI.OCPL.Api.DrugDictionary.Tests package NCI.OCPL.Api.Common --version 1.0.* $ dotnet add test/NCI.OCPL.Api.DrugDictionary.Tests package NCI.OCPL.Api.Common.Testing --version 1.0.*
We're going to skip cleaning up the models for now and just do the changes required for .Net 3.1. (Models will be another ticket.)
src/NCI.OCPL.Api.DrugDictionary/Program.cs
using NCI.OCPL.Api.Common;
Main()
public static void Main(string[] args) { CreateHostBuilder<Startup>(args).Build().Run(); }
CreateWebHostBuilder
src/NCI.OCPL.Api.DrugDictionary/Startup.cs
public Startup(IConfiguration configuration) : base(configuration) { }
ConfigureAppSpecific
env
protected override void ConfigureAppSpecific(IApplicationBuilder app, IWebHostEnvironment env)
web.config
In src/NCI.OCPL.Api.DrugDictionary/web.config, in the <handlers> section, replace AspNetCoreModule with AspNetCoreModuleV2
src/NCI.OCPL.Api.DrugDictionary/web.config
<handlers>
AspNetCoreModule
AspNetCoreModuleV2
This requires
Remove the shared code files and replace them with the NuGet packages from http://github.com/nciocpl/ncI.OCPL.Api.Shared/
Parent Issue: Update the drug dictionary to .Net 3.1 #54
Update .csproj files
src/NCI.OCPL.Api.DrugDictionary/NCI.OCPL.Api.DrugDictionary.csproj
<TargetFramework>
element tonetcoreapp3.1
.<PackageReference>
elements becomes:test/NCI.OCPL.Api.DrugDictionary.Tests/NCI.OCPL.Api.DrugDictionary.Tests.csproj
<TargetFramework>
element tonetcoreapp3.1
.From the command line, in the project's base directory, run the following commands (See the "Notes section for prerequisites)
Remove the shared code projects:
Add NuGet packages
Code Cleanup
We're going to skip cleaning up the models for now and just do the changes required for .Net 3.1. (Models will be another ticket.)
In
src/NCI.OCPL.Api.DrugDictionary/Program.cs
using NCI.OCPL.Api.Common;
Main()
toCreateWebHostBuilder
method.In
src/NCI.OCPL.Api.DrugDictionary/Startup.cs
ConfigureAppSpecific
(change the type forenv
, remove the loggerFactory parameter).Update the
web.config
In
src/NCI.OCPL.Api.DrugDictionary/web.config
, in the<handlers>
section, replaceAspNetCoreModule
withAspNetCoreModuleV2
Sub-Tasks
Notes
This requires