Spark View Engine "An assembly with the same simple name" error

1.2k Views Asked by At

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.

2

There are 2 best solutions below

2
On

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

0
On

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