From 68c7240b5db3edc4f961147d9d96a1f78db0682e Mon Sep 17 00:00:00 2001 From: "Roy, Rajat" Date: Tue, 22 Mar 2022 16:29:05 -0700 Subject: [PATCH] Feature/net6.0 927 (#633) * changing to net6.0 * circumventing the possible net6.0 bug * updated nuget, removed un-necessary stuff from proj files * using const to reduce string concatenation * removing None Remove section * updating some more interpreted strings to be net6.0 compatible --- AnnotationLambda/AnnotationLambda.csproj | 12 ++++++------ CacheUtils/CacheUtils.csproj | 10 +++++----- Cloud/Cloud.csproj | 10 +++++----- CommandLine/CommandLine.csproj | 4 ++-- Compression/Compression.csproj | 4 ++-- CustomAnnotationLambda/CustomAnnotationLambda.csproj | 8 ++++---- .../CustomStrValidationLambda.csproj | 4 ++-- Downloader/Downloader.csproj | 10 +++++----- ErrorHandling/ErrorHandling.csproj | 8 ++++---- GeneAnnotationLambda/GeneAnnotationLambda.csproj | 8 ++++---- Genome/Genome.csproj | 4 ++-- IO/IO.csproj | 12 ++++-------- Intervals/Intervals.csproj | 4 ++-- Jasix/Jasix.csproj | 4 ++-- Jist/Jist.csproj | 2 +- MitoHeteroplasmy/MitoHeteroplasmy.csproj | 4 ++-- Nirvana/Nirvana.csproj | 10 +++++----- NirvanaLambda/NirvanaLambda.csproj | 10 +++++----- OptimizedCore/OptimizedCore.csproj | 6 +++--- Phantom/Phantom.csproj | 4 ++-- ReferenceSequence/ReferenceSequence.csproj | 4 ++-- RepeatExpansions/RepeatExpansionPhenotype.cs | 9 +++++++-- RepeatExpansions/RepeatExpansions.csproj | 8 ++------ SAUtils/ExtractCosmicSvs/CosmicCnvItem.cs | 2 +- SAUtils/SAUtils.csproj | 10 +++------- Sandbox/AminoAcidAligner/AminoAcidAligner.csproj | 2 +- .../GenerateMustGenotypeVcf.csproj | 4 ++-- Sandbox/Piano/Piano.csproj | 4 ++-- Sandbox/UnitTests/UnitTests.csproj | 4 ++-- SingleAnnotationLambda/SingleAnnotationLambda.csproj | 6 +++--- Tabix/Tabix.csproj | 4 ++-- UnitTests/ErrorHandling/ExceptionUtilitiesTests.cs | 4 ++-- UnitTests/Jist/JiSTtests.cs | 10 +++++----- UnitTests/UnitTests.csproj | 10 +++++----- .../VariantAnnotation.Interface.csproj | 4 ++-- VariantAnnotation/VariantAnnotation.csproj | 12 ++++-------- Variants/Variants.csproj | 4 ++-- Vcf/Vcf.csproj | 12 +++--------- 38 files changed, 117 insertions(+), 134 deletions(-) diff --git a/AnnotationLambda/AnnotationLambda.csproj b/AnnotationLambda/AnnotationLambda.csproj index 3afa2997..ed26e43c 100644 --- a/AnnotationLambda/AnnotationLambda.csproj +++ b/AnnotationLambda/AnnotationLambda.csproj @@ -1,17 +1,17 @@  - netcoreapp3.1 + net6.0 true Lambda bin\$(Configuration) - latest + - + - - - + + + diff --git a/CacheUtils/CacheUtils.csproj b/CacheUtils/CacheUtils.csproj index 42553bdc..84e7c1db 100644 --- a/CacheUtils/CacheUtils.csproj +++ b/CacheUtils/CacheUtils.csproj @@ -1,9 +1,9 @@  Exe - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + @@ -12,9 +12,9 @@ - - - + + + diff --git a/Cloud/Cloud.csproj b/Cloud/Cloud.csproj index 34772024..714602e5 100644 --- a/Cloud/Cloud.csproj +++ b/Cloud/Cloud.csproj @@ -1,14 +1,14 @@  - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + - + - - + + diff --git a/CommandLine/CommandLine.csproj b/CommandLine/CommandLine.csproj index 08912d65..97cdb461 100644 --- a/CommandLine/CommandLine.csproj +++ b/CommandLine/CommandLine.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/Compression/Compression.csproj b/Compression/Compression.csproj index a57f14b2..c0ba67e2 100755 --- a/Compression/Compression.csproj +++ b/Compression/Compression.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/CustomAnnotationLambda/CustomAnnotationLambda.csproj b/CustomAnnotationLambda/CustomAnnotationLambda.csproj index 71f5c04e..ab35af90 100644 --- a/CustomAnnotationLambda/CustomAnnotationLambda.csproj +++ b/CustomAnnotationLambda/CustomAnnotationLambda.csproj @@ -1,15 +1,15 @@  - netcoreapp3.1 + net6.0 true Lambda bin\$(Configuration) - latest + - + - + diff --git a/CustomStrValidationLambda/CustomStrValidationLambda.csproj b/CustomStrValidationLambda/CustomStrValidationLambda.csproj index 7a9d3901..895b6b2e 100644 --- a/CustomStrValidationLambda/CustomStrValidationLambda.csproj +++ b/CustomStrValidationLambda/CustomStrValidationLambda.csproj @@ -1,11 +1,11 @@  - netcoreapp3.1 + net6.0 true Lambda - + diff --git a/Downloader/Downloader.csproj b/Downloader/Downloader.csproj index 5c69f0ee..594d54e5 100644 --- a/Downloader/Downloader.csproj +++ b/Downloader/Downloader.csproj @@ -1,15 +1,15 @@  Exe - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + - - - + + + diff --git a/ErrorHandling/ErrorHandling.csproj b/ErrorHandling/ErrorHandling.csproj index 343cae87..7ef7efb6 100644 --- a/ErrorHandling/ErrorHandling.csproj +++ b/ErrorHandling/ErrorHandling.csproj @@ -1,11 +1,11 @@  - netcoreapp3.1 - ..\bin\$(Configuration) - latest + net6.0 + ..\bin\$(Configuration) + - + \ No newline at end of file diff --git a/GeneAnnotationLambda/GeneAnnotationLambda.csproj b/GeneAnnotationLambda/GeneAnnotationLambda.csproj index 29380927..543abc5f 100644 --- a/GeneAnnotationLambda/GeneAnnotationLambda.csproj +++ b/GeneAnnotationLambda/GeneAnnotationLambda.csproj @@ -1,15 +1,15 @@  - netcoreapp3.1 + net6.0 true Lambda bin\$(Configuration) - latest + - - + + diff --git a/Genome/Genome.csproj b/Genome/Genome.csproj index bf7dae59..7af2f96d 100644 --- a/Genome/Genome.csproj +++ b/Genome/Genome.csproj @@ -1,8 +1,8 @@ - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/IO/IO.csproj b/IO/IO.csproj index 5ff03bef..3fb99bfc 100755 --- a/IO/IO.csproj +++ b/IO/IO.csproj @@ -1,18 +1,14 @@  - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + true - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + diff --git a/Intervals/Intervals.csproj b/Intervals/Intervals.csproj index 273639ea..7c914ba0 100644 --- a/Intervals/Intervals.csproj +++ b/Intervals/Intervals.csproj @@ -1,8 +1,8 @@ - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/Jasix/Jasix.csproj b/Jasix/Jasix.csproj index b290b4e1..a0ca8443 100644 --- a/Jasix/Jasix.csproj +++ b/Jasix/Jasix.csproj @@ -1,9 +1,9 @@  Exe - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/Jist/Jist.csproj b/Jist/Jist.csproj index c557cbe4..3350d22f 100644 --- a/Jist/Jist.csproj +++ b/Jist/Jist.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) diff --git a/MitoHeteroplasmy/MitoHeteroplasmy.csproj b/MitoHeteroplasmy/MitoHeteroplasmy.csproj index b9322351..95e9e3af 100644 --- a/MitoHeteroplasmy/MitoHeteroplasmy.csproj +++ b/MitoHeteroplasmy/MitoHeteroplasmy.csproj @@ -1,8 +1,8 @@ - netcoreapp3.1 - latest + net6.0 + diff --git a/Nirvana/Nirvana.csproj b/Nirvana/Nirvana.csproj index ead207d9..125c8d85 100644 --- a/Nirvana/Nirvana.csproj +++ b/Nirvana/Nirvana.csproj @@ -1,14 +1,14 @@  Exe - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + - - - + + + diff --git a/NirvanaLambda/NirvanaLambda.csproj b/NirvanaLambda/NirvanaLambda.csproj index 299f9656..4c43b582 100644 --- a/NirvanaLambda/NirvanaLambda.csproj +++ b/NirvanaLambda/NirvanaLambda.csproj @@ -1,16 +1,16 @@  - netcoreapp3.1 + net6.0 true Lambda bin\$(Configuration) - latest + - + - - + + diff --git a/OptimizedCore/OptimizedCore.csproj b/OptimizedCore/OptimizedCore.csproj index b637772b..ff18eb27 100755 --- a/OptimizedCore/OptimizedCore.csproj +++ b/OptimizedCore/OptimizedCore.csproj @@ -1,12 +1,12 @@ - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + true - + diff --git a/Phantom/Phantom.csproj b/Phantom/Phantom.csproj index c9a4cb0c..e44f10e2 100644 --- a/Phantom/Phantom.csproj +++ b/Phantom/Phantom.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/ReferenceSequence/ReferenceSequence.csproj b/ReferenceSequence/ReferenceSequence.csproj index 3dc61c4b..e78f2654 100644 --- a/ReferenceSequence/ReferenceSequence.csproj +++ b/ReferenceSequence/ReferenceSequence.csproj @@ -1,9 +1,9 @@  Exe - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/RepeatExpansions/RepeatExpansionPhenotype.cs b/RepeatExpansions/RepeatExpansionPhenotype.cs index 4bec842f..46f9452b 100644 --- a/RepeatExpansions/RepeatExpansionPhenotype.cs +++ b/RepeatExpansions/RepeatExpansionPhenotype.cs @@ -41,8 +41,13 @@ public string GetAnnotation(int repeatNumber) private string GetJson(double percentile, IEnumerable classifications) { - string joined = string.Join(",", classifications.Select(classification => "\"" + classification + "\"")); - return $"{{\"phenotype\":\"{_phenotype}\",\"omimId\":{_omimId},\"classifications\":[{joined}],\"percentile\":{percentile:0.00}}}"; + // in net6.0, the compiler gets confused if you have }}}. Should the first two }s be a closing brace or the second? This results in a bug. + // we can circumvent it by taking the leading and trailing parenthesis out of the main expression and adding them separately + const char openCurly = '{'; + const char closeCurly = '}'; + string joined = string.Join(",", classifications.Select(classification => "\"" + classification + "\"")); + return $"{openCurly}\"phenotype\":\"{_phenotype}\",\"omimId\":{_omimId},\"classifications\":[{joined}],\"percentile\":{percentile:0.00}{closeCurly}"; + } private IEnumerable GetClassifications(int repeatNumber) diff --git a/RepeatExpansions/RepeatExpansions.csproj b/RepeatExpansions/RepeatExpansions.csproj index ad42fdc8..6f003d0b 100644 --- a/RepeatExpansions/RepeatExpansions.csproj +++ b/RepeatExpansions/RepeatExpansions.csproj @@ -1,14 +1,10 @@  - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + - - - - diff --git a/SAUtils/ExtractCosmicSvs/CosmicCnvItem.cs b/SAUtils/ExtractCosmicSvs/CosmicCnvItem.cs index eb186893..a923337e 100644 --- a/SAUtils/ExtractCosmicSvs/CosmicCnvItem.cs +++ b/SAUtils/ExtractCosmicSvs/CosmicCnvItem.cs @@ -57,7 +57,7 @@ private static IEnumerable GetJsonStrings(IDictionary dicti { foreach (var kvp in dictionary) { - yield return $"{{\"{kvp.Key.Replace('_', ' ')}\":{kvp.Value}}}"; + yield return $"{JsonObject.OpenBrace}\"{kvp.Key.Replace('_', ' ')}\":{kvp.Value}{JsonObject.CloseBrace}"; } } diff --git a/SAUtils/SAUtils.csproj b/SAUtils/SAUtils.csproj index fdd2ddb4..cde79d97 100755 --- a/SAUtils/SAUtils.csproj +++ b/SAUtils/SAUtils.csproj @@ -1,18 +1,14 @@  Exe - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + diff --git a/Sandbox/AminoAcidAligner/AminoAcidAligner.csproj b/Sandbox/AminoAcidAligner/AminoAcidAligner.csproj index 5af9507d..1d9f19e0 100644 --- a/Sandbox/AminoAcidAligner/AminoAcidAligner.csproj +++ b/Sandbox/AminoAcidAligner/AminoAcidAligner.csproj @@ -1,7 +1,7 @@  Exe - netcoreapp3.1 + net6.0 diff --git a/Sandbox/GenerateMustGenotypeVcf/GenerateMustGenotypeVcf.csproj b/Sandbox/GenerateMustGenotypeVcf/GenerateMustGenotypeVcf.csproj index aaab2a12..bdab5443 100644 --- a/Sandbox/GenerateMustGenotypeVcf/GenerateMustGenotypeVcf.csproj +++ b/Sandbox/GenerateMustGenotypeVcf/GenerateMustGenotypeVcf.csproj @@ -1,9 +1,9 @@  Exe - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/Sandbox/Piano/Piano.csproj b/Sandbox/Piano/Piano.csproj index 93a6edeb..42ad30b9 100644 --- a/Sandbox/Piano/Piano.csproj +++ b/Sandbox/Piano/Piano.csproj @@ -1,9 +1,9 @@  Exe - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/Sandbox/UnitTests/UnitTests.csproj b/Sandbox/UnitTests/UnitTests.csproj index cbd1d053..09088d0d 100644 --- a/Sandbox/UnitTests/UnitTests.csproj +++ b/Sandbox/UnitTests/UnitTests.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/SingleAnnotationLambda/SingleAnnotationLambda.csproj b/SingleAnnotationLambda/SingleAnnotationLambda.csproj index ddb75e74..e794d1ea 100644 --- a/SingleAnnotationLambda/SingleAnnotationLambda.csproj +++ b/SingleAnnotationLambda/SingleAnnotationLambda.csproj @@ -1,13 +1,13 @@  - netcoreapp3.1 + net6.0 true Lambda bin\$(Configuration) - latest + - + diff --git a/Tabix/Tabix.csproj b/Tabix/Tabix.csproj index e69bcd86..e96ec014 100644 --- a/Tabix/Tabix.csproj +++ b/Tabix/Tabix.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/UnitTests/ErrorHandling/ExceptionUtilitiesTests.cs b/UnitTests/ErrorHandling/ExceptionUtilitiesTests.cs index 02f6bb44..82eeb4ed 100644 --- a/UnitTests/ErrorHandling/ExceptionUtilitiesTests.cs +++ b/UnitTests/ErrorHandling/ExceptionUtilitiesTests.cs @@ -30,10 +30,10 @@ public void GetInnermostException_AsExpected() } } - public sealed class MockHttpWebResponse : HttpWebResponse + public sealed class MockHttpWebResponse : WebResponse { private readonly Stream _stream; - public override HttpStatusCode StatusCode { get; } + public HttpStatusCode StatusCode { get; } public MockHttpWebResponse(Stream stream, HttpStatusCode statusCode) { diff --git a/UnitTests/Jist/JiSTtests.cs b/UnitTests/Jist/JiSTtests.cs index 8414c0d9..8ec081a7 100644 --- a/UnitTests/Jist/JiSTtests.cs +++ b/UnitTests/Jist/JiSTtests.cs @@ -43,7 +43,7 @@ private static (Stream jsonStream, Stream jasixStream) GetJsonStreams(IChromosom position.SetupGet(x => x.Start).Returns(i); position.SetupGet(x => x.RefAllele).Returns("A"); position.SetupGet(x => x.AltAlleles).Returns(new []{"T"}); - jsonWriter.WritePosition(position.Object, $"{{\"chromosome\":\"{chromosome.UcscName}\",\"position\":{i}}}"); + jsonWriter.WritePosition(position.Object, $"{JsonObject.OpenBrace}\"chromosome\":\"{chromosome.UcscName}\",\"position\":{i}{JsonObject.CloseBrace}"); } if (withGenes) @@ -237,10 +237,10 @@ private static (Stream jsonStream, Stream jasixStream) GetNirvanaJsonStream(int jasixIndex.BeginSection(JasixCommons.PositionsSectionTag, writer.Position); for (int i = 100*chromNumber; i < 123*chromNumber; i++) { - writer.WriteLine($"{{\"chromosome\":\"chr{chromNumber}\",\"position\":{i}}},"); + writer.WriteLine($"{JsonObject.OpenBrace}\"chromosome\":\"chr{chromNumber}\",\"position\":{i}{JsonObject.CloseBrace},"); if(i%50==0) writer.Flush();//creating another block } - writer.WriteLine($"{{\"chromosome\":\"chr{chromNumber}\",\"position\":{100*chromNumber+25}}}"); + writer.WriteLine($"{JsonObject.OpenBrace}\"chromosome\":\"chr{chromNumber}\",\"position\":{100*chromNumber+25}{JsonObject.CloseBrace}"); writer.Flush(); jasixIndex.EndSection(JasixCommons.PositionsSectionTag, writer.Position); @@ -327,10 +327,10 @@ private static (Stream jsonStream, Stream jasixStream) GetNirvanaJsonStreamWitho jasixIndex.BeginSection(JasixCommons.PositionsSectionTag, writer.Position); for (int i = 100 *chromNumber; i < 123 *chromNumber; i++) { - writer.WriteLine($"{{\"chromosome\":\"chr{chromNumber}\",\"position\":{i}}},"); + writer.WriteLine($"{JsonObject.OpenBrace}\"chromosome\":\"chr{chromNumber}\",\"position\":{i}{JsonObject.CloseBrace},"); if(i %50 ==0) writer.Flush();//creating another block } - writer.WriteLine($"{{\"chromosome\":\"chr{chromNumber}\",\"position\":{100 *chromNumber +25}}}"); + writer.WriteLine($"{JsonObject.OpenBrace}\"chromosome\":\"chr{chromNumber}\",\"position\":{100 *chromNumber +25}{JsonObject.CloseBrace}"); writer.Flush(); jasixIndex.EndSection(JasixCommons.PositionsSectionTag, writer.Position); diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj index 043aac33..9cf7dfae 100755 --- a/UnitTests/UnitTests.csproj +++ b/UnitTests/UnitTests.csproj @@ -1,14 +1,14 @@  - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + true - - - + + + diff --git a/VariantAnnotation.Interface/VariantAnnotation.Interface.csproj b/VariantAnnotation.Interface/VariantAnnotation.Interface.csproj index e916ba9b..1533898d 100755 --- a/VariantAnnotation.Interface/VariantAnnotation.Interface.csproj +++ b/VariantAnnotation.Interface/VariantAnnotation.Interface.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/VariantAnnotation/VariantAnnotation.csproj b/VariantAnnotation/VariantAnnotation.csproj index efcd9f4a..bccf492a 100755 --- a/VariantAnnotation/VariantAnnotation.csproj +++ b/VariantAnnotation/VariantAnnotation.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + @@ -18,12 +18,8 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + - \ No newline at end of file + diff --git a/Variants/Variants.csproj b/Variants/Variants.csproj index 05cf1129..e9a87891 100644 --- a/Variants/Variants.csproj +++ b/Variants/Variants.csproj @@ -1,8 +1,8 @@ - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + diff --git a/Vcf/Vcf.csproj b/Vcf/Vcf.csproj index 69d6be52..d567699f 100755 --- a/Vcf/Vcf.csproj +++ b/Vcf/Vcf.csproj @@ -1,8 +1,8 @@  - netcoreapp3.1 + net6.0 ..\bin\$(Configuration) - latest + @@ -11,10 +11,4 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - \ No newline at end of file +