Missing reference

Jun 20, 2015 at 1:19 AM
I'm getting ...

There was an error while rendering the template: System.Web.HttpCompileException (0x80004005): c:\inetpub\vhosts\test1.patapscoresearch.com\httpdocs\Portals\0\2sxc\NADA_Data_NADAChartTemplate.cshtml(10): error CS0012: The type 'System.Data.Objects.DataClasses.EntityObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetCompiledType(String virtualPath) at ToSic.SexyContent.Engines.RazorEngine.CreateWebPageInstance() at ToSic.SexyContent.Engines.RazorEngine.InitWebpage() at ToSic.SexyContent.Engines.RazorEngine.Init() at ToSic.SexyContent.Engines.EngineBase.Init(Template template, App app, ModuleInfo hostingModule, IDataSource dataSource, InstancePurposes instancePurposes, SexyContent sexy) at ToSic.SexyContent.SexyViewContentOrApp.ProcessView(PlaceHolder phOutput, Panel pnlError, Panel pnlMessage)

Where do I add this? To DNN's web.config or to the 2sic web.config file?
Jun 20, 2015 at 1:28 AM
DNN web.config seems to be the answer.
Coordinator
Jun 22, 2015 at 6:28 AM
Actually the error is probably misleading. There are cases where the compiler sees the term "Entity" and thinks it must be something from System.Data - The correct solution is usually not to add this, but to improve the code a bit so the compiler knows that Entity is a EAV-term.

could you post the first 15 lines of code and mark line 10 which the system is complaining about?
Jun 23, 2015 at 12:57 AM
Yes. the error message was misleading. I was passing the wrong entity to the template and not understanding that it was getting confused for a very good reason: the template was looking for stuff that wasn't there. Giving it good data resulted in expected behavior!
Marked as answer by jncraig on 6/22/2015 at 5:57 PM