dotnet / upgrade-assistant

A tool to assist developers in upgrading .NET Framework applications to .NET 6 and beyond
MIT License
1.11k stars 163 forks source link

`CoreWCF` was not used and the sample project `CalculatorService` is still `using System.ServiceModel;` #1521

Open Shereef opened 1 year ago

Shereef commented 1 year ago

Describe the bug

CoreWCF was not used and the sample project CalculatorService is still using System.ServiceModel;

To Reproduce

  1. cd into CalculatorService
  2. Run upgrade-assistant upgrade CalculatorService.csproj on v0.5.261.51392
  3. Choose in place Upgrade type framework.inplace and .NET 6.0 (Supported until November, 2024)
  4. The project doesn't run and CoreWCF is not used at all

Exceptions (if any)

Further technical details

The log file upgrade-assistant.clef was not generated but here are the logs from console:

 Selected options
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 Source project     C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj
 Target framework   .NET 6.0 (Supported until November, 2024)
 Upgrade type       framework.inplace

 Steps
────────────────────────────────────────────
 Upgrade type / Target framework / Upgrade
────────────────────────────────────────────

We have gathered all required options and are ready to do the upgrade. Do you want to continue? [y/n] (y): y
Restoring packages for 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj' ...
Building project 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'...
Starting upgrade of selected nodes for CalculatorService.csproj...
project CalculatorService.csproj...
        Microsoft.UpgradeAssistant.Transformers.ProjectSdkStyleTransformer
        info: Converting project 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj' to SDK style.
        info: C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj contains an App.config file. App.config is replaced by appsettings.json in .NET
Core. You will need to delete App.config and migrate to appsettings.json if it's applicable to your project.
        info: Done
        Microsoft.UpgradeAssistant.Msbuild.Transformers.InplaceDuplicatePackageReferenceTransformer
        info: Done
        Microsoft.UpgradeAssistant.Transformers.DefaultProjectFilesRemoveTransformer
        info: Done
        Microsoft.UpgradeAssistant.Transformers.TargetFrameworkTransformer
        info: Setting property 'TargetFramework' to 'net6.0' for project 'CalculatorService (C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj)'.
        info: Done
Succeeded
reference.assembly System...
        Microsoft.UpgradeAssistant.Transformers.DefaultAssemblyMapTransformer
        info: Removing assembly reference 'System' from project 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Done
        Microsoft.UpgradeAssistant.Transformers.AssemblyReferenceInplaceTransformer
        info: Done
Succeeded
reference.assembly System.configuration...
        Microsoft.UpgradeAssistant.Transformers.DefaultAssemblyMapTransformer
        info: Removing assembly reference 'System.configuration' from project 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Adding package System.Configuration.ConfigurationManager 7.0.0 to project C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj.
        info: Done
        Microsoft.UpgradeAssistant.Transformers.AssemblyReferenceInplaceTransformer
        info: Done
Succeeded
reference.assembly System.Data...
        Microsoft.UpgradeAssistant.Transformers.DefaultAssemblyMapTransformer
        info: Removing assembly reference 'System.Data' from project 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Done
        Microsoft.UpgradeAssistant.Transformers.AssemblyReferenceInplaceTransformer
        info: Done
Succeeded
reference.assembly System.ServiceModel...
        Microsoft.UpgradeAssistant.Transformers.DefaultAssemblyMapTransformer
        info: Removing assembly reference 'System.ServiceModel' from project 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Adding package System.ServiceModel.Primitives 6.0.0 to project C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj.
        info: Adding package System.ServiceModel.Http 6.0.0 to project C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj.
        info: Adding package System.ServiceModel.Duplex 6.0.0 to project C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj.
        info: Adding package System.ServiceModel.NetTcp 6.0.0 to project C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj.
        info: Adding package System.ServiceModel.Security 6.0.0 to project C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj.
        info: Adding package System.ServiceModel.Federation 6.0.0 to project C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj.
        info: Done
        Microsoft.UpgradeAssistant.Transformers.AssemblyReferenceInplaceTransformer
        info: Done
Succeeded
reference.assembly System.Xml...
        Microsoft.UpgradeAssistant.Transformers.DefaultAssemblyMapTransformer
        info: Removing assembly reference 'System.Xml' from project 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Done
        Microsoft.UpgradeAssistant.Transformers.AssemblyReferenceInplaceTransformer
        info: Done
Succeeded
dependencies.finalizer Finalize project dependencies...
        Microsoft.UpgradeAssistant.Msbuild.Transformers.ProjectDependenciesFinalizerTransformer
        info: Upgrading dependencies in project file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Removing reference  'System.configuration' from project file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Removing reference  'System.ServiceModel' from project file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Adding package reference  'System.Configuration.ConfigurationManager' to project file
'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Adding package reference  'System.ServiceModel.Primitives' to project file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Adding package reference  'System.ServiceModel.Http' to project file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Adding package reference  'System.ServiceModel.Duplex' to project file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Adding package reference  'System.ServiceModel.NetTcp' to project file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Adding package reference  'System.ServiceModel.Security' to project file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Adding package reference  'System.ServiceModel.Federation' to project file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'.
        info: Done
        Microsoft.UpgradeAssistant.Cli.Slices.Transformers.Project.RestoreProjectTransformer
        info: Restoring packages for 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj' ...
        info: Done
        Microsoft.UpgradeAssistant.Cli.Slices.Transformers.Project.BuildProjectTransformer
        info: Building project 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj'...
        info: Done
        Microsoft.UpgradeAssistant.Cli.Slices.Transformers.Project.ReloadProjectTransformer
        info: Reloading project...
        info: Done
Succeeded
file.config App.config...
Skipped
file.cs service.cs...
        Microsoft.UpgradeAssistant.Transformers.Code.CSharp.DefaultAttributeTypeMapTransformer
        info: Done
        Microsoft.UpgradeAssistant.Transformers.Code.CSharp.DefaultMemberMapTransformer
        info: Done
        Microsoft.UpgradeAssistant.Transformers.Code.CSharp.DefaultTypeMapTransformer
        info: Done
        Microsoft.UpgradeAssistant.Transformers.Code.CSharp.DefaultTypeMapUsingsTransformer
        info: Done
        Microsoft.UpgradeAssistant.Transformers.Code.CSharp.AssemblyAttributeTransformer
        info: Done
Succeeded
file.cs AssemblyInfo.cs...
        Microsoft.UpgradeAssistant.Transformers.Code.CSharp.DefaultAttributeTypeMapTransformer
        info: Done
        Microsoft.UpgradeAssistant.Transformers.Code.CSharp.DefaultMemberMapTransformer
        info: Done
        Microsoft.UpgradeAssistant.Transformers.Code.CSharp.DefaultTypeMapTransformer
        info: Done
        Microsoft.UpgradeAssistant.Transformers.Code.CSharp.DefaultTypeMapUsingsTransformer
        info: Done
        Microsoft.UpgradeAssistant.Transformers.Code.CSharp.AssemblyAttributeTransformer
        info: Setting property 'AssemblyTitle' to 'service' for project 'CalculatorService (C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj)'.
        info: Setting property 'Description' to 'SelfHost' for project 'CalculatorService (C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj)'.
        info: Setting property 'Company' to 'Microsoft' for project 'CalculatorService (C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj)'.
        info: Setting property 'Product' to 'service' for project 'CalculatorService (C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj)'.
        info: Setting property 'Copyright' to 'Copyright @ Microsoft 2004' for project 'CalculatorService
(C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj)'.
        info: Setting property 'AssemblyVersion' to '1.0.*' for project 'CalculatorService (C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\CalculatorService.csproj)'.
        info: Removing attribute '[assembly: AssemblyTitle("service")]' from the file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\Properties\AssemblyInfo.cs' at
position (18,0).
        info: Removing attribute '[assembly: AssemblyDescription("SelfHost")]' from the file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\Properties\AssemblyInfo.cs'
at position (19,0).
        info: Removing attribute '[assembly: AssemblyConfiguration("")]' from the file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\Properties\AssemblyInfo.cs' at
position (20,0).
        info: Removing attribute '[assembly: AssemblyCompany("Microsoft")]' from the file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\Properties\AssemblyInfo.cs' at
position (21,0).
        info: Removing attribute '[assembly: AssemblyProduct("service")]' from the file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\Properties\AssemblyInfo.cs' at
position (22,0).
        info: Removing attribute '[assembly: AssemblyCopyright("Copyright @ Microsoft 2004")]' from the file
'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\Properties\AssemblyInfo.cs' at position (23,0).
        info: Removing attribute '[assembly: AssemblyVersion("1.0.*")]' from the file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\Properties\AssemblyInfo.cs' at
position (36,0).
        info: Applying changes to file 'C:\dev\samples\core\porting\upgrade-assistant-wcf-framework\CalculatorSample\CalculatorService\Properties\AssemblyInfo.cs'.
        info: Done
Succeeded
Complete: 9 succeeded, 0 failed, 1 skipped.
Shereef commented 1 year ago

dotnet tool install --global upgrade-assistant --version 0.4.421302 works around that issue