Update from 5.0 - 5.2, News does not exist in the namespace Telerik.SiteFinity
I've just updated a portal for a new client running SiteFinity from 5.0 - 5.2 on the path to update fully to 6.3, updated via Project Manager, did all the web config and project changes, and I'm trying to compile and I get this error:
Error 24 The type or namespace name 'News' does not exist in the namespace 'Telerik.Sitefinity' (are you missing an assembly reference?)
and
Error 26 'Telerik.Sitefinity.Fluent.FluentSitefinity' does not contain a definition for 'NewsItems' and no extension method 'NewsItems' accepting a first argument of type 'Telerik.Sitefinity.Fluent.FluentSitefinity' could be found (are you missing a using directive or an assembly reference?)
Here's the code it references in controls/newsItem.ascx.cs:
Telerik.Sitefinity.News.Model.NewsItem newsItem = App.WorkWith().NewsItem(NewsBaseId).Get();
Any ideas?
Hi Brian,
Please check and ensure that the references (including in your custom projects in the solution, if any) are correct. You need to add using in your code to Telerik.Sitefinity.dll as there is braking changes related, in Sitefinity 5.1. More information could be found in that article.
In addition, you could also try to use the Native API. Query news examples could be found here.
Regards,
Svetoslav Manchev
Telerik
Hello Brian,
I have check the following example on Sitefinity version 5.2 and it works fine:
using System;using System.Linq;using Telerik.Sitefinity;using Telerik.Sitefinity.News.Model;namespace SitefinityWebApp.Examples public partial class TestSamples : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) var newsBaseId = new Guid("ec9f30fe-1906-4d8c-99ae-212066192cfe"); var item = GetNews(newsBaseId); protected NewsItem GetNews(Guid newsBaseId) Telerik.Sitefinity.News.Model.NewsItem newsItem = App.WorkWith().NewsItems().Get().Where(i => i.Id == newsBaseId).FirstOrDefault(); return newsItem; I have resolved this, somehow the project lost the reference to Telerik.SiteFinity.ContentModules, I re-added it. When I do a clean build some DLLs get deleted in the bin folder, I have a backup and have to copy them back, any way to fix that?
The latest issue I am trying to resolve is going from 6.1 to 6.3 I get this error:
The configuration 'DynamicModulesConfig' is not registered
Hello Brian,
I have answer you in the support ticket. Once we have resolution, you could share it with the community.
Regards,
Svetoslav Manchev
Telerik