Upgrades Questions on upgrading to version 6.x.
Version 6.x > Upgrades > Error after upgrade 5.5R2 to 6 View modes: 
User avatar
Member
Member
Aon_Vlado - 4/25/2012 4:41:55 PM
   
Error after upgrade 5.5R2 to 6
I have 2 issues after upgrading from 5.5R2 to 6. I used Upgrade.exe and did not apply previously any patches to 5.5R2

1. Missing DLLs
For some reason all my DLLs disappeared from bin folder. I mean 3rd parties DLLs I use in my web parts. Is this what should be expected? Why?

2. Compilation Error
After running the site I got compilation error:
CS1502: The best overloaded method match for 'CMS.DataEngine.GeneralConnection.ExecuteQuery(string, CMS.SettingsProvider.QueryDataParameters)' has some invalid arguments
That call worked in version 5.5R2:
DataSet ds = cn.ExecuteQuery("selectbypartidplanid", parameters);
Any idea what changed?

Thanks,

User avatar
Kentico Support
Kentico Support
kentico_radekm2 - 4/26/2012 4:26:08 PM
   
RE:Error after upgrade 5.5R2 to 6
Hello.

1. Did not you delete your Bin folder before applied hotfix? Otherwise, we override just our assemblies with the current version, but do not delete 3rd party assemblies. I would recommend you to copy them back into the Bin folder from back-up you made before you ran the upgrade process.

2. If you see API reference file for version 6, you may find there is following method with parameters below:

CMS.DataEngine.GeneralConnection.ExecuteNonQuery
queryName (String)
Name of the query in format application.class.queryname
parameters (QueryDataParameters)
Query parameters

If this is not recognized in your project, could you please check version of the CMS.DataEngine assembly in your Bin folder, and make sure it is 6.0.xxxx? Also, can you re-add reference to this assembly for you Bin folder? Thank you.

Best Regards,
Radek Macalik

User avatar
Member
Member
Aon_Vlado - 4/26/2012 8:03:03 PM
   
RE:Error after upgrade 5.5R2 to 6
Let me list the steps I did:
1. Created new folder in web server, copied all files from working 5.5R2 version of our web site to it
2. Restored database from the same web site into a different named database
3. Changed the connection string
4. Downloaded http://www.kentico.com/Downloads/Updates/Upgrade_5_5R2_6_0.exe
5. Run Upgrade.exe and stepped through the wizard

I did it 3 times and bin folder after upgrade had 128 files instead of 149 I had prior the upgrade.

The CMS.DataEngine.dll in the bin folder is version 6.0.4297.34133
I do not understand how to add reference to that assembly – the CMS.DataEngine.dll is in bin folder. That should do it.
My question is: What could go wrong? Why has this failed. Is this not an automatic upgrade?

Thanks,
Vlado

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 4/29/2012 4:42:36 AM
   
RE:Error after upgrade 5.5R2 to 6
Hello,

Yes, the upgrade process should be automatic, however if a project is customized some issues may cause the automatic upgrade not to work properly. In those cases we suggest to upgrade the project manually per upgrade instructions included in the upgrade package. That said, please try to open your project in Visual Studio and remove all the dll files from the project. Now, copy over the correct dll files to the bin folder, add them and try to rebuild the project. If you used our API anywhere in the project and the site isn't compiling, please check if any code needs to be updated according to this blog post about API upgrading from version 5.5R2.

Best regards,
Boris Pocatko

User avatar
Member
Member
Aon_Vlado - 4/29/2012 2:01:45 PM
   
RE:Error after upgrade 5.5R2 to 6
Boris,
Thank you for pointing out the blog. It is exactly the same call where it fails and I see now how to rewrite our code.

Old code:

object[,] parameters = new object[3, 3];
parameters[0, 0] = "@UserID";
parameters[0, 1] = userId;
parameters[1, 0] = "@Points";
parameters[1, 1] = points;
parameters[2, 0] = "@Type";
parameters[2, 1] = Convert.ToInt32(type);
// Update user counts and add activity points
GeneralConnection conn = ConnectionHelper.GetConnection();
conn.ExecuteQuery("cms.user.UpdateUserCounts", parameters);


New code:

QueryDataParameters parameters = new QueryDataParameters();
parameters.Add("@UserID", userId);
parameters.Add("@Points", points);
parameters.Add("@Type", Convert.ToInt32(type));

// Update user counts and add activity points
ConnectionHelper.ExecuteQuery("cms.user.UpdateUserCounts", parameters);


Thanks again,

Vlado