views:

223

answers:

2

I am trying out the Spark view engine with ASP MVC but get the error below when displaying a view. The view references model objects that are in a different assembly to the main web application (MyApp.Model.dll). I am stuck on the cause or resolution to this.

Dynamic view compilation failed. 0,0): error CS1704: An assembly with the same simple name 'MyApp.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side.

A: 

It sounds like you're referencing the same assembly multiple times in your view. Instead of using the <use assembly=""> element you might want to use the <use namesace=""> element

lomaxx
Thanks. I am also a bit confused about the _global.spark file and how it relates to this and spark engine setup in the global.aspx. Is there any good reference on this?
Craig
I had a look at this but am not using <use assembly=""> anywhere and the problem still occurs.
Craig
A: 

Craig I got the same problem, if I modify some class in assembly X and do a build, I got this error at runtime for the assembly X.

But after a "rebuild" (not "build") it's working.

For me it has been in the middle of a project. It comes maybe from an update ?

Matthieu

Matthieu