November Happy Hour will be moved to Thursday December 5th.

Errors compiling after Episerver 8 update

Vote:
 

I just updated from Episerver 7.5 to 8 using NuGet package manager in Visual Studio 2012.

Properties for my visual studio project  is set to .NET Framework 4.5

When I'm compiling my test site I get following errors. Do I have to change anything manually in the References folder?

Error1Warning as Error: 'EPiServer.Core.CategoryList.GetCategoryName(int)' is obsolete: 'Use CategoryRepository.Get() to load individual categories by id and retrieve their name.'C:\EPiServer\ExampleEPiServerSite3\wwwroot\Business\Core\CategorizableExtensions.cs3178Alloy

Error2The best overloaded method match for 'EPiServer.DataFactory.GetPage(EPiServer.Core.PageReference, EPiServer.Core.LoaderOptions)' has some invalid argumentsC:\EPiServer\ExampleEPiServerSite3\wwwroot\Business\Core\ContentReferenceExtensions.cs5720Alloy

Error3Argument 2: cannot convert from 'EPiServer.Core.ILanguageSelector' to 'EPiServer.Core.LoaderOptions'C:\EPiServer\ExampleEPiServerSite3\wwwroot\Business\Core\ContentReferenceExtensions.cs5759Alloy

Error4Warning as Error: 'EPiServer.Core.LanguageSelectorContext' is obsolete: 'Simplify code in content providers to only use the Language property to get requested language (ILanguageSelector.Language). Removed usage of LanguageSelectorContext since fallback languages are now handled outside the provider.'C:\EPiServer\ExampleEPiServerSite3\wwwroot\Business\ContentProviders\ClonedContentProvider.cs16231Alloy

Error5Warning as Error: 'EPiServer.Core.ILanguageSelectorExtensions.SelectPageLanguage(EPiServer.Core.ILanguageSelector, EPiServer.Core.LanguageSelectorContext)' is obsolete: 'Simplify code in content providers to only use the Language property to get requested language (ILanguageSelector.Language). Removed usage of LanguageSelectorContext since fallback languages are now handled outside the provider.'C:\EPiServer\ExampleEPiServerSite3\wwwroot\Business\ContentProviders\ClonedContentProvider.cs16617Alloy

Error6Warning as Error: 'EPiServer.Core.ILanguageSelectorExtensions.SetInitializedLanguageBranch(EPiServer.Core.ILanguageSelector, EPiServer.Core.LanguageSelectorContext)' is obsolete: 'Simplify code in content providers to only use the Language property to get requested language (ILanguageSelector.Language). Removed usage of LanguageSelectorContext since fallback languages are now handled outside the provider.'C:\EPiServer\ExampleEPiServerSite3\wwwroot\Business\ContentProviders\ClonedContentProvider.cs17813Alloy

#119202
Mar 24, 2015 10:16
Vote:
 

Hi Dan,

you've hit some breaking changes. You don't need to change references, but you do need to change your code.

1. As the erorr says you need to modify the way you get categories.

2. Hard to say without seeing the code, but first of all you might want to use ServiceLocator.Current.GetInstance<IContentLoader>().Get<Contenttype>(...) instead of DataFactory.

3-6. LanguageSelector is now replaced with CultureInfo, so that needs to be changed where you use it.

#119203
Mar 24, 2015 10:59
Vote:
 

Thanks for the reply!

I'm using the Alloy test-site I got when installing Episerver 7.5

Do I have to modify the Alloy site or is there any way I can get a new Alloy site for Episerver 8?

/Dan

#119204
Mar 24, 2015 11:23
Vote:
 

If you use the latest version of the EPiServer CMS Visual Studio extension to create a new site with the Alloy templates they will be 8.0+ compatible.

#119205
Mar 24, 2015 11:42
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.