I'm upgrading from 4.20 to 4.40.3 and working my way through the process (normal theme pains and such). The final piece is that the copyright banner doesn't resolve when I put it in a theme, which worked without issue in 4.20. From the error log:
...\www\Themes\MyThemeA\Views\Shared\Components\Footer\Default.cshtml(132,31): error CS0103: The name 'OfficialSite' does not exist in the current context
The code is (when placed in a theme):
Powered by <a href="@(OfficialSite.Main)">nopCommerce</a>
I haven't made any major changes to that file, only some minimal html/styling changes. Am I missing a using statement? Maybe hard code the url? I can live without it in the meantime, but does anyone know the trick to getting that to work? Thanks.
I even removed all my code, with exception to the minor modifications you have to make to the widget zone line. Therefore, it's basically the default file that exists at: www/Views/Shared/Components/Footer/Default.cshtml path
With exception to this line (which shows up a couple lines after the copyright banner):
@await Component.InvokeAsync("Widget", new { widgetZone = "footer" })
I thought you were onto something with the _ViewImports.cshtml file as I can't remember ever even giving that a look. Mine was last modified on 2017, definitely not recent.
I just swapped that file out for the one in the DefaultClean theme (which matches the one you posted) and still the same error (I also restarted/recycled the site after swapping the file).
To answer your first question, it works fine when it's in the regular Views structure. It's only when I add it to my theme that it starts giving that 'OfficialSite' context error.
Excellent, I was leaning towards your first solution, but more prefer your second. Anyway, both simple, compact fixes for when I'm trying to remember again a year or more from now on the next upgrade. Thanks again for your speedy help!