I recently upgraded from Umbraco 10.x (.NET 6 Core) to 13.x (.NET 8 Core). Since then the pipeline to build the project has not been failing or complaining but I suspect it is still building in .NET 6 somehow as it doesn’t run. I can also compare the following files after a local publish vs. the pipeline’s output.
myproj.deps.json has { “runtimeTarget”: { “name”: “.NETCoreApp,Version=v6.0″ …
myproj.runtimeconfig.json has ” { “runtimeOptions” : { “tfm”: “net6.0” …
Local build/publish those have 8.0.
Trying solutions from similar posts I’ve added a task step of “Use .NET Core”
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk 8.x'
inputs:
version: 8.x
I even added a dotnet info to prove that 8 was there:
steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet info'
inputs:
command: custom
custom: '--info'
But when it gets to the build step I get the following error:
steps:
- task: DotNetCoreCLI@2
displayName: Build
inputs:
projects: '**/myproj.csproj'
arguments: '--configuration $(BuildConfiguration) --no-restore --framework net8.0'
##[error]C:hostedtoolcachewindowsdotnetsdk8.0.204SdksMicrosoft.NET.SdktargetsMicrosoft.PackageDependencyResolution.targets(266,5): Error NETSDK1005: Assets file ‘D:a8sDevMainmyprojobjproject.assets.json’ doesn’t have a target for ‘net8.0’. Ensure that restore has run and that you have included ‘net8.0’ in the TargetFrameworks for your project.
Same result with or without –framework net8.0.
Even though I’m not doing NuGet specifically I tried adding the following with no change.
steps:
- task: NuGetToolInstaller@1
displayName: 'Use NuGet 5.8'
inputs:
versionSpec: 5.8
I have also tried changing the host from windows-latest to windows-2022. No change.
I even tried changing the following item in the project file from TargetFramework to TargetFrameworks.
<TargetFramework>net8.0</TargetFramework>
ANY ideas or help would be greatly appreciated.
Thanks
user3447577 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.