I´m using LINQ to SQL classes from a database. When i try to create a new instance it crashes:
DataLayerDataContext dataLayerDataContext = new DataLayerDataContext();
Stack Trace:
[HttpException (0x80004005): Could not load type 'DataLayerDataContext'.]
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +8941051
System.Web.UI.WebControls.LinqDataSourceView.get_ContextType() +107
What could be the problem?
If you are keeping your
DataContextseparate from your working project, then you need to add theconnection stringsto the database from theDataContext projectto the working project’s config file as well for it to work.