Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Upgrading code files from U7 to U8. The following line of code now throws error CS0103: The name 'ApplicationContext' does not exist in the current context.
using Umbraco.Core; var db = ApplicationContext.Current.DatabaseContext.Database;
Please advise.
Hi Rob
Try var db = DatabaseContext.Database; instead
var db = DatabaseContext.Database;
@Henrik That doesn't exist like that in v8 either ;-)
@Rob see my answer here: https://our.umbraco.com/forum/umbraco-8/96175-cant-find-applicationcontext#comment-304141
Alrighty. Was worth a try :)
Had the same issue, but with ApplicationContext.Current.Services.RelationService; and it working for me removingApplicationContext.Current.
ApplicationContext.Current.Services.RelationService;
ApplicationContext.Current.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Upgrading code files from U7 to U8
Upgrading code files from U7 to U8. The following line of code now throws error CS0103: The name 'ApplicationContext' does not exist in the current context.
Please advise.
Hi Rob
Try
var db = DatabaseContext.Database;
instead@Henrik That doesn't exist like that in v8 either ;-)
@Rob see my answer here: https://our.umbraco.com/forum/umbraco-8/96175-cant-find-applicationcontext#comment-304141
Alrighty. Was worth a try :)
Had the same issue, but with
ApplicationContext.Current.Services.RelationService;
and it working for me removingApplicationContext.Current.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.