I'm creating an ASP.NET MVC application using F# on IIS 7.
When I attempt to run it from the browser, I'm met with a YSOD containing the following:
[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
I looked up the method using Reflector to see if it could give me any more context and found that it was failing on the first line
private static CodeDomProvider CreateCodeDomProviderWithPropertyOptions(Type codeDomProviderType)
{
IDictionary<string, string> providerOptions = new Dictionary<string, string>(GetProviderOptions(codeDomProviderType));
//Snip
}
It leads me to believe that the propertyOptions I've specified in my Web.config for the F# CodeDom are incorrect. However, if I remove them I receive the same error.
<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>
Any ideas on correcting this error?