0

Having just the @inherits Custom.Hybrid.Razor12 at the top of the template breaks it when using DNN objects.

... The type or namespace name 'Portal' does not exist in the namespace 'Dnn' (are you missing an assembly reference?)...

Adding @inherits ToSic.Sxc.Dnn.RazorComponent fixes it, everything displays properly.

My question is do I need both or just the latter? Everything seems to work fine if I remove @inherits Custom.Hybrid.Razor12, but perhaps there's a better way to have the DNN objects without breaking the template. Or it may be a bug?

DNNdiva
  • 25
  • 6

1 Answers1

1

I think Daniel (iJungleBoy) already answered this in the comments here. Correct way to get access to Dnn Stuff while using Modern 2sxc Hybrid Views

"to get the Dnn object you must use the base class Custom.Dnn.Razor12 - it's only difference is the Dnn object. That cannot work on Hybrid, because Oqtane won't have a Dnn object - otherwise it's the same as Custom.Hybrid.Razor12"

Jeremy Farrance
  • 740
  • 6
  • 11