Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Example Does Not Work Out of Box #122

Closed
khalidabuhakmeh opened this Issue · 7 comments

7 participants

@khalidabuhakmeh

I have run into two issues:

  1. When I run it right out of the box (changing the connection string) I get a dialect == null exception.

System.ArgumentNullException was unhandled
HResult=-2147467261
Message=Value cannot be null.
Parameter name: dialect
Source=EventStore.Persistence.SqlPersistence
ParamName=dialect
StackTrace:
at EventStore.Persistence.SqlPersistence.SqlPersistenceFactory..ctor(IConnectionFactory factory, ISerialize serializer, ISqlDialect dialect, TransactionScopeOption scopeOption, Int32 pageSize) in c:\Projects\EventStore\src\proj\EventStore.Persistence.SqlPersistence\SqlPersistenceFactory.cs:line 42
at EventStore.SqlPersistenceWireup.<>c__DisplayClass4.<.ctor>b__1(NanoContainer c) in c:\Projects\EventStore\src\proj\EventStore.Wireup\SqlPersistenceWireup.cs:line 22
at EventStore.NanoContainer.<>c__DisplayClass1`1.b__0(NanoContainer c) in c:\Projects\EventStore\src\proj\EventStore.Wireup\NanoContainer.cs:line 17
at EventStore.ContainerRegistration.Resolve(NanoContainer container) in c:\Projects\EventStore\src\proj\EventStore.Wireup\NanoContainer.cs:line 88
at EventStore.NanoContainer.ResolveTService in c:\Projects\EventStore\src\proj\EventStore.Wireup\NanoContainer.cs:line 42
at EventStore.PersistenceWireup.Build() in c:\Projects\EventStore\src\proj\EventStore.Wireup\PersistenceWireup.cs:line 59
at EventStore.Wireup.Build() in c:\Projects\EventStore\src\proj\EventStore.Wireup\Wireup.cs:line 61
at EventStore.Wireup.Build() in c:\Projects\EventStore\src\proj\EventStore.Wireup\Wireup.cs:line 61
at EventStore.Example.MainProgram.WireupEventStore() in c:\Projects\EventStore\doc\EventStore.Example\MainProgram.cs:line 34
at EventStore.Example.MainProgram.Main() in c:\Projects\EventStore\doc\EventStore.Example\MainProgram.cs:line 19
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
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:

  1. When I try to run it in memory, I get a performance counter issue.

System.InvalidOperationException was unhandled
HResult=-2146233079
Message=The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.
Source=System
StackTrace:
at System.Diagnostics.PerformanceCounter.InitializeImpl()
at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)
at EventStore.Diagnostics.PerformanceCounters..ctor(String instanceName) in c:\Projects\EventStore\src\proj\EventStore.Core\Diagnostics\PerformanceCounters.cs:line 70
at EventStore.Diagnostics.PerformanceCounterPersistenceEngine..ctor(IPersistStreams persistence, String instanceName) in c:\Projects\EventStore\src\proj\EventStore.Core\Diagnostics\PerformanceCounterPersistenceEngine.cs:line 67
at EventStore.PersistenceWireup.Build() in c:\Projects\EventStore\src\proj\EventStore.Wireup\PersistenceWireup.cs:line 68
at EventStore.Wireup.Build() in c:\Projects\EventStore\src\proj\EventStore.Wireup\Wireup.cs:line 61
at EventStore.Wireup.Build() in c:\Projects\EventStore\src\proj\EventStore.Wireup\Wireup.cs:line 61
at EventStore.Example.MainProgram.WireupEventStore() in c:\Projects\EventStore\doc\EventStore.Example\MainProgram.cs:line 34
at EventStore.Example.MainProgram.Main() in c:\Projects\EventStore\doc\EventStore.Example\MainProgram.cs:line 19
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
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:

I do get the project to run if I run it in memory and don't have the perfomance counters on.

Thanks in advance,

Khalid Abuhakmeh

@scoarescoare

Yeah I just found this too. How does this go uncaught in such a popular project?

@joliver
@scoarescoare

Yeah. It just looks like an ISqlDialect isn't registered property:

I suspect this: this.Container.Register<ISqlDialect>(c => null); // auto-detect

I manually registed MsSql:

.UsingSqlPersistence("EventStore") // Connection string is in app.config
.WithDialect(new MsSqlDialect())
.EnlistInAmbientTransaction() // two-phase commit

Which seemed to help but now I'm getting another (probably unrelated) exception: this.counters = new PerformanceCounters(instanceName);
which results in the inner exception Requested registry access is not allowed.

@joliver
@scoarescoare

Yeah - no issues out of the box with v3. Thanks.

@kblooie kblooie was assigned
@damianh damianh referenced this issue from a commit
@damianh damianh Issue #122 - Specify dialect. 83672d0
@damianh damianh closed this
@jeremyklamer

I still recieve this error with master branch, changing to version 3.0 solved the issue.

@leonfs

To solve the problem with the Performance Counters it's necessary to remove the following line within WireupEventStore() method on MainProgram.cs

.TrackPerformanceInstance("example")

//line 45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.