c# - Can not convert to System.Guid -
trying set ravendb 3.5 , nservicebus 6. after senter saga have set in nservicebus endpoint, enter handler. once handler finished, error msg.
system.argumentexception: not convert identity type system.guid because there not matching type converter registered in conventions' identitytypeconvertors
my code:
public static class autofacconfig { public static icontainer configureautofac() { var builder = new containerbuilder(); var resourcemanagerid = new guid("6c9abcbb-c7ca-4a67-a149-5142f633f535"); var dtcrecoverybasepath = environment.getfolderpath(environment.specialfolder.commonapplicationdata); var recoverypath = path.combine(dtcrecoverybasepath, "nservicebus.ravendb", resourcemanagerid.tostring()); builder.register(x => { var store = new documentstore { connectionstringname = "ravendb", resourcemanagerid = resourcemanagerid, transactionrecoverystorage = new localdirectorytransactionrecoverystorage(recoverypath) }; store.defaultdatabase = "mydb"; store.initialize(); store.conventions.identitypartsseparator = "-"; var _guidtypeconvertor = store.conventions .identitytypeconvertors .firstordefault(id => id.canconvertfrom(typeof(guid))); if (_guidtypeconvertor != null) store.conventions.identitytypeconvertors.remove(_guidtypeconvertor); return store; }) .as<idocumentstore>() .singleinstance(); builder.register<ifilesstore>(x => { var filestore = new filesstore() { url = "http://localhost:40000", defaultfilesystem = "myfs", }.initialize(); return filestore; }).singleinstance(); return builder.build(); } } in saga:
protected override void configurehowtofindsaga(sagapropertymapper<filetoordersagadata> mapper) { mapper.configuremapping<startfiletoordersagacommand>(m => m.dataid) .tosaga(s => s.dataid); } public async task handle(startfiletoordersagacommand message, imessagehandlercontext context) { // validation validatexmlcommand data.dataid = message.dataid; await context.send<validatexmlcommand>( x => { x.filename = message.filename; x.customerid = message.customerid; }); } here's stack trace:
system.argumentexception: not convert identity type system.guid because there not matching type converter registered in conventions' identitytypeconvertors @ raven.client.document.generateentityidontheclient.setpropertyorfield(type propertyorfieldtype, object entity, action`1 setidentifier, string id) in c:\builds\ravendb-stable-3.5\raven.client.lightweight\document\generateentityidontheclient.cs:line 167 @ raven.client.document.generateentityidontheclient.trysetidentity(object entity, string id) in c:\builds\ravendb-stable-3.5\raven.client.lightweight\document\generateentityidontheclient.cs:line 143 @ raven.client.document.inmemorydocumentsessionoperations.<generatedocumentkeyforstorageasync>d__99.movenext() in c:\builds\ravendb-stable-3.5\raven.client.lightweight\document\inmemorydocumentsessionoperations.cs:line 833 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ raven.client.document.inmemorydocumentsessionoperations.<storeasyncinternal>d__96.movenext() in c:\builds\ravendb-stable-3.5\raven.client.lightweight\document\inmemorydocumentsessionoperations.cs:line 803 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.persistence.ravendb.sagapersister.<save>d__0.movenext() in c:\buildagent\work\c4d62ce02b983878\src\nservicebus.ravendb\sagapersister\sagapersister.cs:line 24 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.sagapersistencebehavior.<invoke>d__1.movenext() in c:\buildagent\work\3206e2123f54fce4\src\nservicebus.core\sagas\sagapersistencebehavior.cs:line 133 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.loadhandlersconnector.<invoke>d__1.movenext() in c:\buildagent\work\3206e2123f54fce4\src\nservicebus.core\pipeline\incoming\loadhandlersconnector.cs:line 40 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.invokesaganotfoundbehavior.<invoke>d__0.movenext() in c:\buildagent\work\3206e2123f54fce4\src\nservicebus.core\sagas\invokesaganotfoundbehavior.cs:line 16 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.deserializelogicalmessagesconnector.<invoke>d__1.movenext() in c:\buildagent\work\3206e2123f54fce4\src\nservicebus.core\pipeline\incoming\deserializelogicalmessagesconnector.cs:line 31 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.persistence.ravendb.openasyncsessionbehavior.<invoke>d__1.movenext() in c:\buildagent\work\c4d62ce02b983878\src\nservicebus.ravendb\sessionmanagement\openasyncsessionbehavior.cs:line 21 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.invokeauditpipelinebehavior.<invoke>d__1.movenext() in c:\buildagent\work\3206e2123f54fce4\src\nservicebus.core\audit\invokeauditpipelinebehavior.cs:line 18 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.subscriptionreceiverbehavior.<invoke>d__1.movenext() in c:\buildagent\work\3206e2123f54fce4\src\nservicebus.core\routing\messagedrivensubscriptions\subscriptionreceiverbehavior.cs:line 29 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.processingstatisticsbehavior.<invoke>d__0.movenext() in c:\buildagent\work\3206e2123f54fce4\src\nservicebus.core\performance\statistics\processingstatisticsbehavior.cs:line 27 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.receiveperformancediagnosticsbehavior.<invoke>d__2.movenext() in c:\buildagent\work\3206e2123f54fce4\src\nservicebus.core\performance\statistics\receiveperformancediagnosticsbehavior.cs:line 40 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.transportreceivetophysicalmessageprocessingconnector.<invoke>d__1.movenext() in c:\buildagent\work\3206e2123f54fce4\src\nservicebus.core\pipeline\incoming\transportreceivetophysicalmessageprocessingconnector.cs:line 37 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.mainpipelineexecutor.<invoke>d__1.movenext() in c:\buildagent\work\3206e2123f54fce4\src\nservicebus.core\pipeline\mainpipelineexecutor.cs:line 32 --- end of stack trace previous location exception thrown -- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.receivestrategy.<tryprocessmessage>d__7.movenext() in c:\buildagent\work\3206e2123f54fce4\src\nservicebus.core\transports\msmq\receivestrategy.cs:line 109 --- end of stack trace previous location exception thrown --- @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ nservicebus.transactionscopestrategy.<processmessage>d__2.movenext() in c:\buildagent\work\3206e2123f54fce4\src\nservicebus.core\transports\msmq\transactionscopestrategy.cs:line 86 searched on find out abt this, i've got no clue guid , converter thingy is.
any guys? thx
store.conventions.identitytypeconvertors.remove(_guidtypeconvertor); is removing guid type convertor. why experiencing:
system.argumentexception: not convert identity type system.guid because there not matching type converter registered in conventions' identitytypeconvertors
you should remove line of code.
Comments
Post a Comment