I am getting the error shown below in an application.
It is an asp.net web application (with no reference to LLBLGen, everything is plain datasets)
I am calling a webservice, which calls out to another project, which performs a select from SQL Server into a dataset. No LLBLGen Entity objects are involved, yet I am getting an error which seems to indicate that they are somehow. I am using the the DbUtils.CreateConnection and DbUtils.CreateDataAdapter; see example code below, I have marked the two places they are used.
(BTW, in googling this error there are references to the 'Unable to generate a temporary class ' error being to do with permissions; I have added ASPNET, IWAM?, and IUSR? to my local administrators group, but it had no effect).
Any idea at all??
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: Unable to generate a temporary class (result=1). error CS0012: The type 'SD.LLBLGen.Pro.ORMSupportClasses.EntityBase' is defined in an assembly that is not referenced. You must add a reference to assembly 'SD.LLBLGen.Pro.ORMSupportClasses.NET20, Version=2.6.0.0, Culture=neutral, PublicKeyToken=ca73b74ba4e3ff27'. at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence) at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies) at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence) at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Evidence evidence) at System.Web.Services.Protocols.SoapServerType..ctor(Type type, WebServiceProtocols protocolsSupported) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) --- End of inner exception stack trace ---
<WebMethod()> _
Public Function fGetDataTable(TableName) As DataTable
Return SQLServer.GetTableAsDatatable(TableName)
End Function
Public Shared Function GetTableAsDatatable(ByVal TableName As String) As DataTable
Dim sql As String = String.Format("select * from {0}", TableName)
Return SQLServer.GetDataset(TableName, TableName).Tables(0)
End Function
Public Shared Function GetDataset(ByVal sql As String, ByVal TableName As String) As DataSet
Dim ds As New DataSet()
Using connection As System.Data.Common.DbConnection = SQLServer.GetConnection()
If sql.Trim.Length < 6 OrElse sql.Trim.ToUpper.Substring(0, 6) <> "SELECT" Then sql = "SELECT * FROM " & sql
'* --------------------- LLBLGen --------------------------->
Dim da As System.Data.Common.DbDataAdapter = DbUtils.CreateDataAdapter()
da.MissingSchemaAction = MissingSchemaAction.AddWithKey
da.SelectCommand = New SqlClient.SqlCommand(sql, CType(connection, SqlClient.SqlConnection))
da.Fill(ds)
ds.Tables(0).TableName = TableName
End Using
Return ds
End Function
Private Shared Function GetConnection() As DbConnection
'* --------------------- LLBLGen --------------------------->
Return CType(DbUtils.CreateConnection(), SqlClient.SqlConnection)
End Function
If I bypass the webservice and call this code directly, it works just fine, but calling it via a webservice causes a problem. After the da.Fill(ds) completes, there should be no further interaction with LLBLGen code, should there??