When I attempt to deploy DACPACs via SqlPackage.exe,
I encounter the error below :
An unexpected failure occurred: Object reference not set to an instance of an object..
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.ReverseEngineerPopulators.Sql90TableBaseColumnPopulator`1.InsertElementIntoParent(SqlColumn element, TElement parent, ReverseEngineerOption option)
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.ReverseEngineerPopulators.ChildModelElementPopulator`2.CreateChildElement(TParent parent, EventArgs e, ReverseEngineerOption option)
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.ReverseEngineerPopulators.ChildModelElementPopulator`2.PopulateAllChildrenFromCache(IDictionary`2 cache, SqlReverseEngineerRequest request, OrdinalSqlDataReader reader, ReverseEngineerOption option)
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.ReverseEngineerPopulators.TopLevelElementPopulator`1.Populate(SqlReverseEngineerRequest request, OrdinalSqlDataReader reader, ReverseEngineerOption option)
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlReverseEngineerImpl.ExecutePopulators(ReliableSqlConnection conn, IList`1 populators, Int32 totalPopulatorsCount, Int32 startIndex, Boolean progressAlreadyUpdated, ReverseEngineerOption option, SqlReverseEngineerRequest request)
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlReverseEngineerImpl.ExecutePopulatorsInPass(SqlReverseEngineerConnectionContext context, ReverseEngineerOption option, SqlReverseEngineerRequest request, Int32 totalCount, Tuple`2[] populatorsArray)
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlReverseEngineerImpl.PopulateBatch(SqlReverseEngineerConnectionContext context, SqlSchemaModel model, ReverseEngineerOption option, ErrorManager errorManager, SqlReverseEngineerRequest request, SqlImportScope importScope)
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlReverseEngineer.PopulateAll(SqlReverseEngineerConnectionContext context, ReverseEngineerOption option, ErrorManager errorManager, Boolean filterManagementScopedElements, SqlImportScope importScope, Boolean optimizeForQuery, ModelStorageType modelType)
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentEndpointServer.ImportDatabase(SqlReverseEngineerConstructor constructor, DeploymentEngineContext context, ErrorManager errorManager)
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentEndpointServer.OnLoad(ErrorManager errors, DeploymentEngineContext context)
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.PrepareModels()
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.InitializePlanGeneratator()
at Microsoft.SqlServer.Dac.DacServices.<>c__DisplayClass21.<CreateDeploymentArtifactGenerationOperation>b__1f(Object operation, CancellationToken token)
at Microsoft.SqlServer.Dac.Operation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.ReportMessageOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)
at Microsoft.SqlServer.Dac.OperationExtension.Execute(IOperation operation, DacLoggingContext loggingContext, CancellationToken cancellationToken)
at Microsoft.SqlServer.Dac.DacServices.GenerateDeployScript(DacPackage package, String targetDatabaseName, DacDeployOptions options, Nullable`1 cancellationToken)
at Microsoft.Data.Tools.Schema.CommandLineTool.DacServiceUtil.<>c__DisplayClasse.<DoDeployAction>b__4(DacServices service)
at Microsoft.Data.Tools.Schema.CommandLineTool.DacServiceUtil.ExecuteDeployOperation(String connectionString, String filePath, MessageWrapper messageWrapper, Boolean sourceIsPackage, Boolean targetIsPackage, Func`1 generateScriptFromPackage, Func`2 generateScriptFromDatabase)
at Microsoft.Data.Tools.Schema.CommandLineTool.DacServiceUtil.DoDeployAction(DeployArguments parsedArgs, Action`1 writeError, Action`2 writeMessage, Action`1 writeWarning)
at Microsoft.Data.Tools.Schema.CommandLineTool.Program.DoDeployActions(CommandLineArguments parsedArgs)
at Microsoft.Data.Tools.Schema.CommandLineTool.Program.Run(String[] args)
at Microsoft.Data.Tools.Schema.CommandLineTool.Program.Main(String[] args)
Below is the command I run:
SET vardeploy2=/Action:Script
set varBlockOnDriftParameter=/p:BlockWhenDriftDetected=False
"SSDTBinaries\SqlPackage.exe" %vardeploy2% %varBlockOnDriftParameter% /SourceFile:"dacpacs\DBName.dacpac" /Profile:"Profiles\%1.DBName.Publish.xml" >> Log.txt 2>>&1
I deploy to a SQL Server 2008 R2. The SqlPackage.exe version is 11.0.2820.0.
The issue is intermittent, which suggests it's not related to the DACPAC being deployed or the destination database's schema. My best guess is that something about the state of the database is causing the problem.
Still, I haven't been able to identify anything unusual at the time of the failures.
When recreating the issue locally, using schema locks results in a different error message.
Has anyone know of a solution?
Upgrade to a more resent SQL Server Data Tools.
Related
During startup of an AspNetCore application, we are seeing this exception get thrown:
An error occurred while starting the application.
Win32Exception: The wait operation timed out
Unknown location
SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
System.Data.SqlClient.SqlCommand+<>c.<ExecuteDbDataReaderAsync>b__122_0(Task<SqlDataReader> result)
Win32Exception: The wait operation timed out
Show raw exception details
SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
System.Data.SqlClient.SqlCommand+<>c.<ExecuteDbDataReaderAsync>b__122_0(Task<SqlDataReader> result)
System.Threading.Tasks.ContinuationResultTaskFromResultTask<TAntecedentResult, TResult>.InnerInvoke()
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, object state)
System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref Task currentTaskSlot)
Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteAsync(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary<string, object> parameterValues, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable<T>+AsyncEnumerator.BufferlessMoveNext(DbContext _, bool buffer, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync<TState, TResult>(Func<DbContext, TState, CancellationToken, Task<TResult>> operation, Func<DbContext, TState, CancellationToken, Task<ExecutionResult<TResult>>> verifySucceeded, TState state, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync<TState, TResult>(Func<DbContext, TState, CancellationToken, Task<TResult>> operation, Func<DbContext, TState, CancellationToken, Task<ExecutionResult<TResult>>> verifySucceeded, TState state, CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable<T>+AsyncEnumerator.MoveNext(CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor+AsyncSelectEnumerable<TSource, TResult>+AsyncSelectEnumerator.MoveNext(CancellationToken cancellationToken)
Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider+ExceptionInterceptor<T>+EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken)
System.Linq.AsyncEnumerable.Aggregate_<TSource, TAccumulate, TResult>(IAsyncEnumerable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> accumulator, Func<TAccumulate, TResult> resultSelector, CancellationToken cancellationToken)
What is interesting about this case is that the exception is thrown instantaneously - we make a request to the app, the startup code is initiated and the exception is thrown all within a second. Also, if we start a trace on the DB using SQL profiler, we are not seeing any statement being executed on the server.
If we recycle the app pool, the problem goes away. What could be causing this? My only guess is that some bad state is cached in the EF Core layer which is causing EF to throw the exception without even attempting to make a request to the DB.
Here are some relevant versions on the environment:
.NET Core 4.6.30411.01 X64 v4.0.0.0
Microsoft.AspNetCore.Hosting version 2.1.1-rtm-30846
Microsoft Windows 10.0.14393
EDIT 1:
The code has been requested, here is the code that throws the exception:
public async Task<List<OperationalMessagingQueue>> GetAllIncludeMessageAndMarketsAsNoTrackingAsync()
{
return await DbContext.GetSet<OperationalMessagingQueue>().AsNoTracking()
.Include(q => q.Messages)
.ThenInclude(m => m.OperationalMessage.EcfClaimNotify.Markets)
.ToListAsync();
}
When the exception is thrown, the call stack always starts in the startup code, Startup.Configure(), as per this binding in UseStartup():
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
I receive the error message Unable to determine the serialization information for a => a.CurrentProcessingStep when I try to Update my document.
I'm using the Mongo .NET Driver version 2.8 and .NET Framework 4.7.2.
I'm building the filter and update statements using the builder helpers from the library.
Here is the relevant section of my document class:
[BsonIgnoreExtraElements]
[DebuggerDisplay("{Term}, Rule Status = {_ruleStatus}, Current Step = {_currentProcessingStep}")]
public class SearchTermInfo : AMongoConnectedObject
{
[BsonElement("CurrentProcessingStep")]
private ProcessingStep _currentProcessingStep;
[BsonElement("RuleStatus")]
private RuleStatus _ruleStatus;
[BsonDateTimeOptions(Kind = DateTimeKind.Local)]
public DateTime AddDateTime { get; set; }
[BsonIgnore]
[JsonIgnore]
public ProcessingStep CurrentProcessingStep
{
get => _currentProcessingStep;
set => AddHistoryRecord(value);
}
[BsonIgnore]
[JsonIgnore]
public RuleStatus RuleStatus
{
get => _ruleStatus;
set => AddHistoryRecord(value);
}
I'm building the filter with this code:
FilterDefinition<SearchTermInfo> filter = Builders<SearchTermInfo>.Filter.And(
Builders<SearchTermInfo>.Filter.Eq(a => a.Id, recordId),
Builders<SearchTermInfo>.Filter.Or(
Builders<SearchTermInfo>.Filter.Eq(a => a.CurrentProcessingStep, currentStep),
Builders<SearchTermInfo>.Filter.Exists("CurrentProcessingStep", false)
)
);
Then I execute the update:
UpdateResult results =
searchTermInfoCollection.MongoCollection.UpdateOne(filter, update, null, cancellationToken);
and I get this error:
? ex
{"Unable to determine the serialization information for a => a.CurrentProcessingStep."}
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233079
HelpLink: null
InnerException: null
Message: "Unable to determine the serialization information for a => a.CurrentProcessingStep."
Source: "MongoDB.Driver"
StackTrace: " at MongoDB.Driver.ExpressionFieldDefinition`2.Render(IBsonSerializer`1 documentSerializer, IBsonSerializerRegistry serializerRegistry, Boolean allowScalarValueForArrayField)
at MongoDB.Driver.SimpleFilterDefinition`2.Render(IBsonSerializer`1 documentSerializer, IBsonSerializerRegistry serializerRegistry)\r\n
at MongoDB.Driver.OrFilterDefinition`1.Render(IBsonSerializer`1 documentSerializer, IBsonSerializerRegistry serializerRegistry)\r\n
at MongoDB.Driver.AndFilterDefinition`1.Render(IBsonSerializer`1 documentSerializer, IBsonSerializerRegistry serializerRegistry)\r\n
at MongoDB.Driver.MongoCollectionImpl`1.ConvertWriteModelToWriteRequest(WriteModel`1 model, Int32 index)\r\n
at System.Linq.Enumerable.<SelectIterator>d__5`2.MoveNext()\r\n
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n
at MongoDB.Driver.Core.Operations.BulkMixedWriteOperation..ctor(CollectionNamespace collectionNamespace, IEnumerable`1 requests, MessageEncoderSettings messageEncoderSettings)\r\n
at MongoDB.Driver.MongoCollectionImpl`1.CreateBulkWriteOperation(IEnumerable`1 requests, BulkWriteOptions options)\r\n
at MongoDB.Driver.MongoCollectionImpl`1.BulkWrite(IClientSessionHandle session, IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken)\r\n
at MongoDB.Driver.MongoCollectionImpl`1.<>c__DisplayClass23_0.<BulkWrite>b__0(IClientSessionHandle session)\r\n
at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSession[TResult](Func`2 func, CancellationToken cancellationToken)\r\n
at MongoDB.Driver.MongoCollectionImpl`1.BulkWrite(IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken)\r\n
at MongoDB.Driver.MongoCollectionBase`1.UpdateOne(FilterDefinition`1 filter, UpdateDefinition`1 update, UpdateOptions options, Func`3 bulkWrite)\r\n
at MongoDB.Driver.MongoCollectionBase`1.UpdateOne(FilterDefinition`1 filter, UpdateDefinition`1 update, UpdateOptions options, CancellationToken cancellationToken)\r\n
at SaFileIngestion.FileProcessorEngine.LockRecord(Int64 recordId, ProcessingStep currentStep, CancellationToken cancellationToken)
in D:\\[File Path]\\SaFileIngestion\\FileProcessorEngine.cs:line 195"
TargetSite: {MongoDB.Driver.RenderedFieldDefinition`1[TField] Render(MongoDB.Bson.Serialization.IBsonSerializer`1[TDocument], MongoDB.Bson.Serialization.IBsonSerializerRegistry, Boolean)}
I've also tried to build the filter with this code:
Builders<SearchTermInfo>.Filter.Eq("CurrentProcessingStep", currentStep),
It was my impression that I should be able to build an expression using the property accessor, even though it is flagged as BsonIgnore, since the private field has been attributed with BsonElementAttribute with the same name as the ignored property accessor.
Any guidance provided is appreciated.
Thanks
I eventually resolved this. I don't remember the exact solution as it was over a year ago. I do remember there was something wrong with the way the query was being constructed.
I'm not finding much on this, and after spending most of the day...I'm looking for help..
The exception I get is this:
Unable to cast COM object of type 'System.__ComObject' to interface
type 'IFabricSecretStoreClient'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{38C4C723-3815-49D8-BDF2-68BFB536B8C9}' failed due to the following
error: No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE)).
I'm able to instantiate the proxy to the Stateful Service with this code:
var servicekey = new ServicePartitionKey(0);
var queryserviceUri = new Uri("fabric:/XXXX/xxxxxxxxxx");
var proxyHandle = ServiceProxy.Create<IAnInterfaceName>(queryserviceUri, servicekey, TargetReplicaSelector.PrimaryReplica);
Then I use the proxy:
var result = await proxyHandle.OperationOnServiceContract(dataPackage);
At this point I get the error...
Stacktrace...
at System.Fabric.FabricClient.CreateNativeClient(IEnumerable1
connectionStringsLocal) at
System.Fabric.Interop.Utility.<>c__DisplayClass27_0.<WrapNativeSyncInvoke>b__0()
at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func1
func, String functionTag, String functionArgs) at
System.Fabric.Interop.Utility.WrapNativeSyncInvoke(Action action,
String functionTag, String functionArgs) at
System.Fabric.Interop.Utility.RunInMTA(Action action) at
System.Fabric.FabricClient.InitializeFabricClient(SecurityCredentials
credentialArg, FabricClientSettings newSettings, String[]
hostEndpointsArg) at
Microsoft.ServiceFabric.Services.Client.ServicePartitionResolver.<>c.b__21_0()
at
Microsoft.ServiceFabric.Services.Client.ServicePartitionResolver.GetClient()
at
Microsoft.ServiceFabric.Services.Client.ServicePartitionResolver.ResolveHelperAsync(Func5
resolveFunc, ResolvedServicePartition previousRsp, TimeSpan
resolveTimeout, TimeSpan maxRetryInterval, CancellationToken
cancellationToken, Uri serviceUri) at
Microsoft.ServiceFabric.Services.Communication.Client.CommunicationClientFactoryBase1.GetClientAsync(Uri
serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector
targetReplicaSelector, String listenerName, OperationRetrySettings
retrySettings, CancellationToken cancellationToken) at
Microsoft.ServiceFabric.Services.Remoting.V2.FabricTransport.Client.FabricTransportServiceRemotingClientFactory.GetClientAsync(Uri
serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector
targetReplicaSelector, String listenerName, OperationRetrySettings
retrySettings, CancellationToken cancellationToken) at
Microsoft.ServiceFabric.Services.Communication.Client.ServicePartitionClient1.GetCommunicationClientAsync(CancellationToken
cancellationToken) at
Microsoft.ServiceFabric.Services.Communication.Client.ServicePartitionClient1.InvokeWithRetryAsync[TResult](Func2
func, CancellationToken cancellationToken, Type[]
doNotRetryExceptionTypes) at
Microsoft.ServiceFabric.Services.Remoting.V2.Client.ServiceRemotingPartitionClient.InvokeAsync(IServiceRemotingRequestMessage
remotingRequestMessage, String methodName, CancellationToken
cancellationToken) at
Microsoft.ServiceFabric.Services.Remoting.Builder.ProxyBase.InvokeAsyncV2(Int32
interfaceId, Int32 methodId, String methodName,
IServiceRemotingRequestMessageBody requestMsgBodyValue,
CancellationToken cancellationToken) at
Microsoft.ServiceFabric.Services.Remoting.Builder.ProxyBase.ContinueWithResultV2[TRetval](Int32
interfaceId, Int32 methodId, Task1 task) at
XXXXWeb.Controllers.XXXController.OperationOnServiceContract(XXXRequest
xxxRequest) in
C:\Users\codputer\Source\Repos\xxxxxx\xxxx.Web\Controllers\XXXController.cs:line
44
oh I'm using this for a listener:
protected override IEnumerable<ServiceReplicaListener> CreateServiceReplicaListeners()
{
return this.CreateServiceRemotingReplicaListeners();
}
As noted on these issues:
#476#Azure/service-fabric-issues
#1374#Azure/service-fabric-issues
#262#Microsoft/service-fabric
These COM issues happens whenever you use newer Nuget packages targeting older version of service fabric runtime, this kind of error occurs.
You should always use the packages targeted to the same version of your cluster runtime, on last case, use package older than the cluster version.
Like the title suggests I have a small program that has been running in production for the last 3 months. Last week it started to error out on an AddRange line with this error message:
"Message=Keyword not supported: 'file'."
And nothing in the inner exception. Here is the offending function where I can no longer get to the SaveChanges() line.
private static void SaveToDB(List<MarketNew> inMarketNews)
{
proxy.MarketNews.AddRange(inMarketNews);
proxy.SaveChanges();
}
cheers
bob
edit-
If I try to manually add them one at a time I still receive the following exception.
System.ArgumentException was caught
HResult=-2147024809
Message=Keyword not supported: 'file'.
Source=System.Data
StackTrace:
at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)
at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<SetConnectionString>b__18(DbConnection t, DbConnectionPropertyInterceptionContext`1 c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.SetConnectionString(DbConnection connection, DbConnectionPropertyInterceptionContext`1 interceptionContext)
at System.Data.Entity.Infrastructure.SqlConnectionFactory.CreateConnection(String nameOrConnectionString)
at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
at System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()
at System.Data.Entity.Internal.LazyInternalContext.get_ProviderName()
at System.Data.Entity.Internal.DefaultModelCacheKeyFactory.Create(DbContext context)
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
at System.Data.Entity.Internal.Linq.InternalSet`1.AddRange(IEnumerable entities)
at System.Data.Entity.DbSet`1.AddRange(IEnumerable`1 entities)
at GetMarketNews.Program.SaveToDB(List`1 inMarketNews) in e:\Tableau\Custom Utilities\MarketNews\GetMarketNews\GetMarketNews\Program.cs:line 195
InnerException:
The exception indicates that there is a problem with your connection string. While the program itself may not have been changed in months, can you confirm that the config file (or however you set your connection string) has not been changed?
If you still can't find it from this, I would suggest you check out the value of the connection string at runtime (e.g. put a breakpoint on the AddRange line, and look at proxy.Database.ConnectionString). I suspect you'll find the "file" keyword in the connection string.
I installed the latest dotConnect for PostgreSQL. Im trying to insert a record in the Postgres DB. I have a geometry column what gives me errors. Here is the code:
using (var context = new WKP_DBEntities())
{
var Location = DbGeometry.PointFromText(string.Format("POINT({0} {1})", 157873, 364282), 28992);
var record = new monitoring_object()
{
geometry = Location,
last_changed_by = "ssg",
};
context.monitoring_object.Add(record);
context.SaveChanges();
}
Here is the error message:
System.Data.Entity.Infrastructure.DbUpdateException was unhandled
HResult=-2146233087
Message=An error occurred while updating the entries. See the inner exception for details.
Source=EntityFramework
StackTrace:
at System.Data.Entity.Internal.InternalContext.SaveChanges()
at System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
at System.Data.Entity.DbContext.SaveChanges()
at ConsoleApplicationGEOdata.Program.Main(String[] args) in c:\Users\Stefan\Documents\Visual Studio 2012\Projects\ConsoleApplicationGEOdata\ConsoleApplicationGEOdata\Program.cs:line 38
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Data.UpdateException
HResult=-2146233087
Message=An error occurred while updating the entries. See the inner exception for details.
Source=System.Data.Entity
StackTrace:
at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
at System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager entityCache)
at System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)
at System.Data.Entity.Internal.InternalContext.SaveChanges()
InnerException: System.ArgumentException
HResult=-2147024809
Message=Cannot convert value
Source=Devart.Data.PostgreSql
StackTrace:
at Devart.Data.PostgreSql.af.a(Object A_0, Type A_1, Encoding A_2)
at Devart.Data.PostgreSql.af.a(String A_0, Encoding A_1, PgSqlType A_2, Object A_3, Int32 A_4, Boolean A_5)
at Devart.Data.PostgreSql.PgSqlCommand.a(String A_0, Encoding A_1, ArrayList A_2, Boolean A_3)
at Devart.Data.PostgreSql.PgSqlCommand.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords)
at Devart.Common.DbCommandBase.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at Devart.Data.PostgreSql.Entity.y.a(CommandBehavior A_0)
at Devart.Common.Entity.i.b(CommandBehavior A_0)
at Devart.Data.PostgreSql.Entity.y.b(CommandBehavior A_0)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)
at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
InnerException:
What am I doing wrong?
Your code works in our environment:
a) dotConnect for PostgreSQL v 6.7.287
b) SharpMap v1 RC3
c) Postgis 2.0
d) DDL:
CREATE TABLE monitoring_object
(
id serial NOT NULL,
geometry geometry,
last_changed_by character varying
);
Please give us the following information:
1) the version of your SharpMap. Be aware that current release of dotConnect for PostgreSQL supports SharpMap 1.0 RC3 ( http://sharpmap.codeplex.com/releases/view/106717 ). The 1.0 Final version will be supported soon
2) the version of your Postgis. It should be of the 2.0 (or higher) version. You can check it by executing "select postgis_version()" in the database
3) the DDL script of your monitoring_object table
4) if possible send us a small test project
The corresponding Devart documentation is available at http://blogs.devart.com/dotconnect/enhanced-entity-framework-spatials-support-for-oracle-mysql-and-postgresql.html .