ASP.NET-MVC – F # ASP.NET CODEDOM ProviderOptions

I am creating an ASP.NET MVC application using F# on IIS 7.

When I tried to run it from a browser, I encountered A YSOD containing the following:

[ArgumentNullException: Value cannot
be null. Parameter name: dictionary]
System.Collections.Generic.Dictionary 2..ctor(IDictionary2
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.BuildP rovidersCompiler.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 have checked the method of using Reflector and have a look Can it give me more context and found that it failed on the first line

private static CodeDomProvider CreateCodeDomProviderWithPropertyOptions(Type codeDomProviderType)
{
IDictionary providerOptions = new Dictionary(GetProviderOptions(codeDomProviderType));
//Snip
}

This makes me believe that I am on my Web The propertyOptions specified in the .config for F#CodeDom are incorrect. However, if I delete them, I get the same error.

< br /> 
type="Microsoft.FSharp.Compiler.CodeDom.FSharpAspNetCo deProvider,
FSharp.Compiler.CodeDom">




Any thoughts on correcting this error?

This is a bug in ASP.NET in VS2010 Beta2 (it has been fixed, so Will be used in the next version). It affects any third-party CodeDOM provider, I don’t believe there is any workaround.

I am creating an ASP.NET MVC application using F# on IIS 7 Program.

When I tried to run it from a browser, I came across a YSOD with the following content:

[ ArgumentNullException: Value cannot
be null. Parameter name: dictionary]
System.Collections.Generic.Dictionary2..ctor(IDictionary2
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, ICollec tion
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 checked the method of using Reflector to see if it can give me more context, and found that it failed on the first line

p>

private static CodeDomProvider CreateCodeDomProviderWithPropertyOptions(Type codeDomProviderType)
{
IDictionary providerOptions = new Dictionary(GetProviderOptions(codeDomProviderType)) ;
//Snip
}

This leads me to believe that the propertyOptions I specified for F#CodeDom in my Web.config are incorrect. However, if I delete them , I will receive the same error.



type="Microsoft.FSharp.Compiler.CodeDom.FSharpAspNetCodeProvider,
FSharp.Compiler.CodeDom">




Any thoughts on correcting this error?

This is a bug in ASP.NET in VS2010 Beta2 (it has been fixed, so it will be used in the next version). It affects any A third-party CodeDOM provider, I don’t believe there is any solution.

Leave a Comment

Your email address will not be published.