Upgrading to Umbraco 13
j
I am trying to upgrade to U13 from latest 12 but I run into heaps of issues. After upgrading VS multiple times and installing dotnet 8.0 SDK etc I try to run my project. It wants to find the source for System.Globalization\GlobalizationMode.cs for debugging. Have you experienced similar problems and managed to proceed with the upgrade? What did you do in that case? Cheers and happy X-mas!
I tried to start a brand new 13 project and it worked fine. Tried to migrate Program and Startup to new Program.cs but it seems exception is thrown before it reaches my code. May it be some trash from .NET 7 config etc that causes this? Any ideas what typically must be done when upgrading from 12 to 13?
a
I'm currently performing an upgrade from v9 to v13 at the moment. My typical go to approach is: 1. Clean the solution 2. Manually delete the bin & obj folders just in case there's anything bad left over 3. Manually delete the \umbraco\Data\TEMP folder to ensure any caches or indexes are flushed as they can cause boot problems. 4. Rebuild solution If you've managed to get a successful build with your project configured as .Net 8 and Umbraco 13, then I can't see any reason why you wouldn't be able to get this up and running.
j
Thanks Andy! I tried all the steps but with the same result 😦 I don't even hit the first breakpoint in Program.cs My current approach is to create a brand new 13 project and transfer my existing views etc to that one. I started the U12 project recently so there is not too many files in it yet. https://cdn.discordapp.com/attachments/1186658230437413024/1186937974127083560/image.png?ex=65951121&is=65829c21&hm=248f365f84f8cffbc15711106646bad800e152311a01b6534d0cd41beee69d1a&
Ok. I managed to create a new U13 project and transfer my code to that project and then with uSync transfer all content and settings. So now it seems I am up and running in 13.0.2
(but still I wonder if it should be this complicated to upgrade Umbraco....)
a
May sound a little radical, but perhaps use a tool such as Beyond Compare to do a folder compare to see if you can see any core differences between the two projects. In most cases it's probably something obvious.
j
Sounds like a good idea! I'm afraid I'm a bit to pressed with time right now to do this 😦 But thank you very much for your response!
@Andy Boot forget above. I actually followed your advice and I found this in my first project file: While in the new I got this: Updated it and the first project started as expected. Makes sense since the exception wanted to locate System.Globalization.cs Should not a Nuget upgrade of Microsoft.ICU.ICU4C.Runtime handle this? 🤔
a
Ah! I've encountered this a couple of times, even raised on a thread / post on Discord about an error on the ICU version. Had you given me an error with that particular package name within it I'd have had a lightbulb moment to help you out sooner haha. I think NuGet is responsible for updating your
<PackageReference>
entires within the csproj, but I don't think it can actively modify other elements, unlike the old web.config days where packages would perform all sorts of changes. Glad you managed to solve it, sometimes you have to go around the houses to figure these things out and pass on that knowledge to future projects.
s
Umbraco 13 runs fine with either v68 or v72 of the ICU package but the
RuntimeHostConfigurationOption
version needs to be in sync with the
PackageReference
, so:
Copy code
xml
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="72.1.0.3" />

<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="72.1.0.3" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
or:
Copy code
xml
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />

<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
What you might have had happen is:
Copy code
xml
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />

<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="72.1.0.3" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
which installs v68, but tries to use v72, which is not available.
Just tested this out, that's exactly what happens when you do NuGet upgrade of the ICU package (tried on CLI, VS and Rider). And @Andy Boot seems to be completely right, it looks like it can't update the conditional element in your csproj so that's where it gets stuck. How annoying.
260 Views