Problems running the latest Samples

27 views
Skip to first unread message

Seán Fitzgerald

unread,
Jul 31, 2011, 11:01:47 AM7/31/11
to ncqrs-dev
Hi all,

I'm currently looking nCQRS as part of research into a Masters Thesis
I've started doing on CQRS.

Basically, I'm trying to run the samples that are included on the full
download. I've pulled the latest code from Github.

When I run the MyNotes app, I get an error when I try to save a note:
"Operation could destabilize the runtime."

This occurs on the return statement here:
public JObject Serialize(object theEvent, out string
eventName)
{
eventName =
_typeResolver.EventNameFor(theEvent.GetType());
return JObject.FromObject(theEvent, _serializer);
}

I've updated the connection strings as well so I don't think this is
DB related.

Also, when I run the AppV1 project, I get the following error:
"Could not find a type for event
'AwesomeApp.Events.PersonCreatedEvent'
Parameter name: type
Actual value was AwesomeApp.Events.PersonCreatedEvent."

Has anyone else seen these errors?

Thanks for any help,
Seán.

Seán Fitzgerald

unread,
Jul 31, 2011, 2:38:46 PM7/31/11
to ncqrs-dev
Ok, I managed to sort out the "Operation could destabilize the
runtime" issue by following the instructions at the bottom of this:
http://groups.google.com/group/ravendb/browse_thread/thread/18306358fd0ae547

"Thought i answer this as the problem came up for me, even when using
the
latest Nuget package.

The problem has to do with IntelliTrace (in Visual Studio 2010
Ultimate). A
solution is to ignore JSON.NET in IntelliTrace. This is done by:

*Debug -> Options and Settings -> IntelliTrace -> Modules -> Add
*Newtonsoft**

Hope this helps, it did for me. "

Seán Fitzgerald

unread,
Jul 31, 2011, 3:09:38 PM7/31/11
to ncqrs-dev
I've managed to get the MyNotes sample working.

However, I've coming across a different error in the Versioning app:
"Could not find a type for event
'AwesomeApp.Events.PersonCreatedEvent'
Parameter name: type
Actual value was AwesomeApp.Events.PersonCreatedEvent."

So, I replaced the InitializeEventStore() code:
typeResolver.AddAllEventsInAssembly(typeof(Program).Assembly);
with:
typeResolver.AddEvent(typeof(NameChangedEvent));
typeResolver.AddEvent(typeof(PersonCreatedEvent));

But, now I'm getting the following error in
MsSqlServerEventStore.SaveEvent:
"Implicit conversion from data type nvarchar to varbinary(max) is not
allowed. Use the CONVERT function to run this query."

My raw.Data value in the following code:
command.Parameters.AddWithValue("Data", raw.Data);
...is a string type, so I imagine I'm missing a configuration call
somewhere?

I also have a very basic app that does a simple CreatePerson, and I'm
getting the very same error.

Again, thanks for any help.
Sean.

On Jul 31, 7:38 pm, Seán Fitzgerald <seanfi...@gmail.com> wrote:
> Ok, I managed to sort out the "Operation could destabilize the
> runtime" issue by following the instructions at the bottom of this:http://groups.google.com/group/ravendb/browse_thread/thread/18306358f...

mynkow

unread,
Jul 31, 2011, 3:12:24 PM7/31/11
to ncqr...@googlegroups.com
the note sample should work without modifying the code. Did you manage to run the note sample?

Seán Fitzgerald

unread,
Jul 31, 2011, 3:18:13 PM7/31/11
to ncqrs-dev
OK, I figure it out.

The CreateEventStore.sql script contains the following:
[Data] [varbinary](max) NOT NULL

I changed it to:
[Data] [varchar](max) NOT NULL

...and it all ran!

So, to summarise:
1. *Debug -> Options and Settings -> IntelliTrace -> Modules -> Add
*Newtonsoft**
2. Replace:
typeResolver.AddAllEventsInAssembly(typeof(Program).Assembly);
with:
typeResolver.AddEvent(typeof(NameChangedEvent));
typeResolver.AddEvent(typeof(PersonCreatedEvent));
3. In CreateEventStore.sql script, replace:
[Data] [varbinary](max) NOT NULL
With:
[Data] [varchar](max) NOT NULL

One last question: when I ran through the "Building a simple website
using Ncqrs" example, the nCQRS code created the Events & EventSources
table automatically - was this removed in the latest version?

Thanks!
Sean.

Seán Fitzgerald

unread,
Jul 31, 2011, 3:23:45 PM7/31/11
to ncqrs-dev
Yes, the note sample is working now - but only because of the
Intellisense change. It's possibly because I'm working on VS2010
Ultimate that it occurred on my machine..

Cristobal Galleguillos Katz

unread,
Aug 18, 2011, 12:21:10 AM8/18/11
to ncqrs-dev
Seán, the Versioning samples are running out of the box now, thanks to
your comments.
You can get the latest version from GitHub.

Thanks!
Reply all
Reply to author
Forward
0 new messages