First, my apologies - I am not a C# or asp developer, but I know enough to be dangerous. I inherited a couple of aspx pages on our website that were developed by people no longer with the company. These pages have worked for years running in IIS 7.5 on Windows 2012 and ASP .NET 4.5. We recently upgraded to IIS 10, Windows 2016, and ASP .NET 4.7.2. These two pages work just as before except when they hit LINQ calls. If I comment that code out, the pages work (as much as they can without the LINQ functions).
What I'm trying to understand is what is missing that would cause these to fail. I do not have access to Visual Studio due to corporate restrictions, so remote debugging is not an option. I have been trying to figure this out the old fashion way by commenting stuff out to narrow down the problem. As soon as I uncomment the LINQ calls, it fails. Based on the stack trace below, it looks something is missing that causes it to not compile. As best I can tell, I have all the DLLs that I had before. I have searched other threads, but they all seem to talk about updating the VS project. I don't have VS, just an aspx page, again that worked in earlier incarnations of IIS and ASP .NET.
Exception information:
Exception type: HttpCompileException
Exception message: c:\inetpub\wwwroot\STPUserComapre.aspx(187): error CS0012: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
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.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)