Getting build errors after upgrading my sitefinity site to 1

Posted by nickster65 on 02-Mar-2020 20:37

So I've followed all the steps in this article regarding upgrading my sitefinity project. After I finish all the steps and try to build, I get this error about 8 times:

Assembly 'Telerik.Sitefinity.ContentModules' with identity 'Telerik.Sitefinity.ContentModules, Version=10.2.6604.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' uses 'Telerik.Sitefinity.Model, Version=10.2.6604.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' which has a higher version than referenced assembly 'Telerik.Sitefinity.Model' with identity 'Telerik.Sitefinity.Model, Version=9.0.6010.0, Culture=neutral, PublicKeyToken=b28c218413bdf563'

I tried solutions posted on similar questions to this one, but none of them worked and were all slightly different. Anyone know what's up?

All Replies

Posted by gauntt@upenn.edu on 02-Mar-2020 21:07

If you double-click on that message in the error window, do you get a prompt to add binding redirects to your web.config file? This will USUALLY fix those version mismatch errors. Check that there aren't any redirect from the previous version that should be rebinding to the new version you just installed.

If you still get the error, you can manually add the redirects. They are the lines in your webconfig that look like this in the runtime section:

           <dependentAssembly>

               <assemblyIdentity name="Telerik.Sitefinity.Model" publicKeyToken="B28C218413BDF563" culture="neutral" />

               <bindingRedirect oldVersion="0.0.0.0-12.2.7222.0" newVersion="12.2.7222.0" />

           </dependentAssembly>

Sometimes you have to track down where the mismatch is. You can go to Options -> Projects and Solutions -> Build and Run and set Build Output Verbosity to Detailed or Diagnostic. When you rebuild the output window will fill with thousands of lines of info. Select all and copy into a text editor and search through to see if you can find an old reference that should be updated or anything. Yeah, this is an annoying thing that comes up a lot on upgrades.

Posted by nickster65 on 02-Mar-2020 21:30

Yeah double clicking those errors just takes me to the file at which the error is being thrown.

Every error says that the issue pertains to the package "Telerik.Sitefinity.ContentModules". Do you think that there are more problematic packages that I have to worry about aswell?

Posted by gauntt@upenn.edu on 02-Mar-2020 21:49

Did you do the upgrade from 10 to 12 using the NuGet packages? When you are connected to the SItefinity NuGet source, you will see both of these:

Telerik.Sitefinity.All

Progress.Sitefinity

I have discovered you really need to use the Telerik.Sitefinity.All to do a full version update. If you did the Progress one, try going back and do the Telerik one.

Apart from that, it is strange that the references you are getting are to version 10.2. Something is not getting updated.

Did you have any binding redirects in your web.config already? I actually have made it part of my update procedure to cut all of those out and paste them into a text document. Then I run and double-click the error message and say OK to Visual Studio auto-creating all the binding redirects it needs. You might need to copy some back in so keep the text you cut out for reference.

Did you change the .net runtime on your project? You might need to delete everything out of the "Packages" folder and then open the Package Manager console window and run:

Update-Package -reinstall

That will ensure that the correct version of every package is used based on the .net runtime. Sitefinity 12.2 requires 4.7.2. ALso, make sure you have edited the properties of the main project to target .net 4.7.2. Before you run the console command, you can also manually do a find and replace in the Packages.config on all the "targetFramework" values to make sure every line is indicating "472", like this line:

<package id="Progress.Sitefinity" version="12.2.7222" targetFramework="net472" />

That's all I can think of.

Posted by nickster65 on 03-Mar-2020 13:24

I did change the target framework of the SitefinityWebApp Solution, but i do also have several other solutions included that i did not change the target framework of because i wasn't sure if that was necessary. The error is getting thrown for one of those other solutions so i guess ill try changing the targetframework for all of them and see what happens

Posted by nickster65 on 03-Mar-2020 13:39

Should i be running the "Install-Package Telerik.Sitefinity.All –Version 12.2.7200.0" command in all solutions or just the SitefinityWebApp one? Cause like I said the error i showed above was getting thrown in a different solution called "MVCWidgets"

EDIT:

Running this command in the MVCWidgets solution did solve that issue. Now 100s of other errors are flooding me though haha. Going to try and restart the whole upgrade process 1 more time with that in mind and see what happens

Posted by jread on 03-Mar-2020 14:51

All projects being consumed by the SitefinityWebApp should be on the same target framework or you will result in error as you have seen.  Also for the additional project you do not need Telerik.Sitefinity.All . I would Start with Telerik.Sitefinity.Core and work from there to resolve missing packages for each project.

Posted by gauntt@upenn.edu on 04-Mar-2020 14:56

If you have more issues, can you describe your setup a little more? Not sure what you mean by multiple "solutions". Do you mean multiple projects in your solution that includes the Sitefinity website project? As stated above, all references (DLLs) need to be targeting the same framework. If they are from NuGet, run the reinstall commandline to make sure they all get re-downlaoded. If you are building DLLs and sharing them between project/solutions then same thing. Make sure to update them all to the same framework.

Posted by gauntt@upenn.edu on 04-Mar-2020 14:56

If you have more issues, can you describe your setup a little more? Not sure what you mean by multiple "solutions". Do you mean multiple projects in your solution that includes the Sitefinity website project? As stated above, all references (DLLs) need to be targeting the same framework. If they are from NuGet, run the reinstall commandline to make sure they all get re-downlaoded. If you are building DLLs and sharing them between project/solutions then same thing. Make sure to update them all to the same framework.

Posted by nickster65 on 05-Mar-2020 15:10

Yeah i meant i have about 8 difference projects included in my sitefinity solution.

I basically went through and changed the target framework to 4.7.2 on every project, ran the "Update-Package -Reinstall" command, ran the "Install-Package Telerik.Sitefinity.All –Version 12.2.7200.0" command on all 8 projects, and i'm still getting flooded with all sorts of weird errors like this after I do a clean and rebuild:

Not entirely sure whats going on. I dont know much about the structure of this project, I was just tasked with upgrading it. Doesn't seem to be possible with my current knowledge unfortunately. I was hoping the process would be more straightforward but it doesn't look like it.

Posted by nickster65 on 05-Mar-2020 15:45

Well i was actually able to fix those errors by just waiting like 10 minutes for some reason... but now whenever i try to visit my site i get this error:

Posted by jread on 06-Mar-2020 20:41

Most likely you should not run Telerik.Sitefinity.All on all the project unless you want them all to act as web applications(Sitefinity).  Unfortunately there it's much help we can provider here with out deeper knowledge of your setup.  The typically Sitefinity solution would contain 1 SitefinityWebApp (Telerik.Sitefinity.All), the additional project are most likely extensions or custom widgets or business layers that might not even require Sitefinity at all.  But at a minimum any additional project that holds Sitefinity components will need at least Telerik.Sitefinity.Core && Telerik.DataAccess.Core.  

I would suggest you revert the changes that happen do to installing the "All" package.  I would then change the target framework for all project to 4.7.2.  If the project were previous using nuget use the Visual Studio UI to make sure all project have the same version of Sitefinity packages.

This thread is closed