jira-azuredevops-migrator icon indicating copy to clipboard operation
jira-azuredevops-migrator copied to clipboard

Wallymathieu upgrade to vs2017 format

Open Alexander-Hjelm opened this issue 1 year ago • 7 comments

Supersedes https://github.com/solidify/jira-azuredevops-migrator/pull/860

Alexander-Hjelm avatar Dec 29 '23 08:12 Alexander-Hjelm

The build pipeline is now failing. Additionally I can no longer build the solution locally. See the error output below.

I'm closing the PR. Feel free to work on it and reopen https://github.com/solidify/jira-azuredevops-migrator/pull/860 if you feel strongly that this is something that should be merged @wallymathieu

Starting: NuGet restore
==============================================================================
Task         : NuGet
Description  : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Azure Artifacts and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task.
Version      : 2.231.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/nuget
==============================================================================
Caching tool: NuGet 5.9.3 x64
Found tool in cache: NuGet 5.9.3 x64
Resolved from tool cache: 5.9.3
Using version: 5.9.3
Found tool in cache: NuGet 5.9.3 x64
C:\Windows\system32\chcp.com 65001
Active code page: 65001
Detected NuGet version 5.9.3.3 / 5.9.3+e58482f869e18a390b0a557bc15d2f2240eeb023.e58482f869e18a390b0a557bc15d2f2240eeb023
C:\hostedtoolcache\windows\NuGet\5.9.3\x64\nuget.exe sources Add -NonInteractive -Name NuGetOrg -Source https://api.nuget.org/v3/index.json -ConfigFile D:\a\1\Nuget\tempNuGet_15295.config
Package source with Name: NuGetOrg added successfully.
C:\hostedtoolcache\windows\NuGet\5.9.3\x64\nuget.exe restore D:\a\1\s\src\WorkItemMigrator\WorkItemMigrator.sln -Verbosity Detailed -NonInteractive -ConfigFile D:\a\1\Nuget\tempNuGet_15295.config
D:\a\1\s\src\WorkItemMigrator\Migration.WIContract\Migration.WIContract.csproj : error : Version 6.0.417 of the .NET SDK requires at least version 17.0.0 of MSBuild. The current available version of MSBuild is 16.11.2.50704. Change the .NET SDK specified in global.json to an older version that requires the MSBuild version currently available.
NuGet Version: 5.9.3.3
D:\a\1\s\src\WorkItemMigrator\Migration.WIContract\Migration.WIContract.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
MSBuild auto-detection: using msbuild version '16.11.2.50704' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
D:\a\1\s\src\WorkItemMigrator\JiraExport\jira-export.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
MSBuild P2P timeout [ms]: 120000
D:\a\1\s\src\WorkItemMigrator\Migration.Common\Migration.Common.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\bin\msbuild.exe "C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\mey431lg.kup.nugetinputs.targets" /t:GenerateRestoreGraphFile /nologo /nr:false /v:q /p:NuGetRestoreTargets="C:\Users\VssAdministrator\AppData\Local\Temp\NuGetScratch\10tdzfgu.dlb.nugetrestore.targets" /p:RestoreUseCustomAfterTargets="True" /p:RestoreTaskAssemblyFile="C:\hostedtoolcache\windows\NuGet\5.9.3\x64\nuget.exe" /p:RestoreSolutionDirectory="D:\a\1\s\src\WorkItemMigrator\\" /p:RestoreConfigFile="D:\a\1\Nuget\tempNuGet_15295.config" /p:SolutionDir="D:\a\1\s\src\WorkItemMigrator\\" /p:SolutionName="WorkItemMigrator"
D:\a\1\s\src\WorkItemMigrator\WorkItemImport\wi-import.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
NuGet.CommandLine.ExitCodeException: Exception of type 'NuGet.CommandLine.ExitCodeException' was thrown.
D:\a\1\s\src\WorkItemMigrator\Migration.Common.Log\Migration.Common.Log.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
   at NuGet.CommandLine.MsBuildUtility.<GetProjectReferencesAsync>d__6.MoveNext()
D:\a\1\s\src\WorkItemMigrator\tests\Migration.Jira-Export.Tests\Migration.Jira-Export.Tests.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
--- End of stack trace from previous location where exception was thrown ---
D:\a\1\s\src\WorkItemMigrator\tests\Migration.Common.Tests\Migration.Common.Tests.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
D:\a\1\s\src\WorkItemMigrator\tests\Migration.WIContract.Tests\Migration.WIContract.Tests.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
D:\a\1\s\src\WorkItemMigrator\tests\Migration.Wi-Import.Tests\Migration.Wi-Import.Tests.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.
   at NuGet.CommandLine.RestoreCommand.<GetDependencyGraphSpecAsync>d__68.MoveNext()

Alexander-Hjelm avatar Dec 29 '23 08:12 Alexander-Hjelm

The error says that you don't have a recent enough msbuild version. What probably should be done then is to make sure that the image is recent enough: https://github.com/solidify/jira-azuredevops-migrator/blob/master/azure-pipelines.yml#L4-L5

wallymathieu avatar Dec 29 '23 10:12 wallymathieu

From the error it looks like there has been some additions to the csproj that have been merged in

https://github.com/solidify/jira-azuredevops-migrator/blob/wallymathieu-upgrade-to-vs2017-format/src/WorkItemMigrator/JiraExport/jira-export.csproj#L83C2-L103

In the new format, there is no need to explicitly include c#-files for compilation.

I don't feel strongly about this feature. It is mostly in order to be able to run on later .net than .net-framework.

wallymathieu avatar Dec 31 '23 15:12 wallymathieu

Tried to delete explicit includes in JiraExport.exe, but now no files are created by the build.

I will have to look into this at a later time.

Alexander-Hjelm avatar Dec 31 '23 17:12 Alexander-Hjelm

That sounds odd to say the least. When I build it locally it builds into bin/release/net6 even though there is only one targetframework.

Another way to compile it into a "publish" executable would be to execute :

dotnet publish -c release src/WorkItemMigrator/JiraExport -o ./JiraExport

to build into a specific folder. I guess that would imply that one would need to adjust the publish flow for both tools.

wallymathieu avatar Dec 31 '23 18:12 wallymathieu

This time it complains on a missing jira-export.dll, probably because for .net. we get more files than for .net than framework. Perhaps it would be better to add PublishSingleFile: https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli

On my machine that produces: image

image

Those should files without extensions will have the extension exe on Windows.

wallymathieu avatar Dec 31 '23 19:12 wallymathieu

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Jan 02 '24 07:01 sonarqubecloud[bot]