当我尝试从浏览器运行它时,我遇到了一个包含以下内容的YSOD:
[ArgumentNullException: Value cannot
be null. Parameter name: dictionary]
System.Collections.Generic.Dictionary2..ctor(IDictionary
2
dictionary, IEqualityComparer`1
comparer) +12700827
System.Web.Compilation.CompilationUtil.CreateCodeDomProviderWithPropertyOptions(Type
codeDomProviderType) +84
System.Web.Compilation.CompilationUtil.CreateCodeDomProviderNonPublic(Type
codeDomProviderType) +16
System.Web.Compilation.AssemblyBuilder..ctor(CompilationSection
compConfig, ICollection
referencedAssemblies, CompilerType
compilerType, String
outputAssemblyName) +469
System.Web.Compilation.CompilerType.CreateAssemblyBuilder(CompilationSection
compConfig, ICollection
referencedAssemblies, String
generatedFilesDir, String
outputAssemblyName) +127
System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
+675 System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
+46 System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean
isPrecompiledApp) +11321455
System.Web.Compilation.BuildManager.CompileGlobalAsax()
+50 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
+872
我查看了使用Reflector的方法,看看它是否能给我更多的上下文,并发现它在第一行失败了
private static CodeDomProvider CreateCodeDomProviderWithPropertyOptions(Type codeDomProviderType) { IDictionary<string, string> providerOptions = new Dictionary<string, string>(GetProviderOptions(codeDomProviderType)); //Snip }
这让我相信我在我的Web.config中为F#CodeDom指定的propertyOptions是不正确的.但是,如果我删除它们,我会收到同样的错误.
<system.codedom> <compilers> <compiler language="F#;f#;fs;fsharp" extension=".fs" warningLevel="4" type="Microsoft.FSharp.Compiler.CodeDom.FSharpAspNetCodeProvider, FSharp.Compiler.CodeDom"> <providerOption name="CompilerVersion" value="v4.0"/> <providerOption name="WarnAsError" value="false"/> </compiler> </compilers> </system.codedom>
有关纠正此错误的任何想法?
这是VS2010 Beta2中的ASP.NET中的一个错误(它已被修复,因此将在下一版本中使用).它影响任何第三方CodeDOM提供商,我不相信有任何解决方法.