Works fine when targeting .NET 3.5. When trying to run the code in
VS2010 targeting .NET 4 it runs into problems with mscorlib.
Any ideas?
Eric Williams
--ERROR AS FOLLOWS--
Unhandled Exception: Spark.Compiler.CompilerException:
Dynamic view compilation failed. (0,0):
error CS1703:
An assembly with the same identity 'mscorlib, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been
imported. Try removing one of the duplicate references.
1
2 [global::Spark.SparkViewAttribute(
3 Templates = new string[] {
4 "sample.spark"
5 })]
6 public class Viewba973fbcc82b4686a5213cfd1edc2138 :
SparkConsole.EmailView
7 {
8
9
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
10 private static System.Guid _generatedViewId = new
System.Guid("ba973fbcc82b4686a5213cfd1edc2138");
11 public override System.Guid GeneratedViewId
12 { get { return _generatedViewId; } }
13
14
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
15 private void RenderViewLevel0()
16 {
17 #line hidden
18 Output.Write("Dear ");
19 #line default
20 try
21 {
22
23 #line 1 "sample.spark"
24 Output.Write(user.Name);
25 #line default
26 }
27 catch(System.NullReferenceException)
28 {
29 Output.Write("${user.Name}");
30 }
31 #line hidden
32 Output.Write(",\r\nThis is an email.\r\nSincerely,\r\nSpark
View Engine\r\n");
33 #line default
34 }
35
36
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
37 public override void Render()
38 {
39 RenderViewLevel0();
40 }
41 }
at Spark.Compiler.BatchCompiler.Compile(Boolean debug, String
languageOrExtension, String[] sourceCode) in c:\Code\Spark\src\Spark
\Compiler\BatchCompiler.cs:line 165
at
Spark.Compiler.CSharp.CSharpViewCompiler.CompileView(IEnumerable`1
viewTemplates, IEnumerable`1 allResources) in c:\Code\Spark\src\Spark
\Compiler\CSharp\CSharpViewCompiler.cs:line 30
at Spark.SparkViewEngine.CreateEntryInternal(SparkViewDescriptor
descriptor, Boolean compile) in c:\Code\Spark\src\Spark
\SparkViewEngine.cs:line 260
at Spark.SparkViewEngine.CreateEntry(SparkViewDescriptor
descriptor) in c:\Code\Spark\src\Spark\SparkViewEngine.cs:line 238
at Spark.SparkViewEngine.CreateInstance(SparkViewDescriptor
descriptor) in c:\Code\Spark\src\Spark\SparkViewEngine.cs:line 220
at SparkConsole.Program.Main(String[] args) in C:\Users\user
\Documents\Visual Studio 2010\Projects\SparkConsole\Program.cs:line 29