Bryan Soltis

Senior Software Engineer
MCSD.NET, MCAD, MCP

About Bryan

I am Senior Software Engineer at Bit-Wizards Custom Software Solutions, Inc.  I mainly do web-based development using ASP.NET, AJAX, & other web technologies.  I have created numerous websites, CMS sites, and a few SilverLight applications.  In my spare time I love doing anything athletic, (attempt to) play  music, watch movies, and spend time with my wife and daughter.

LINQ to XML Build Errors

Friday, August 28, 2009 06:05 | posted by: bryan

I've built several sites that utilize LINQ to read XML files.  And repeatedly I come across an issue where I seemingly have everything in the right place and coded, yet it does not compile. 

Problem:

 

The solution:

Make sure you have the following section your web.config:

<system.codedom>
<compilers>
<
compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<
providerOption name="CompilerVersion" value="v3.5"/>
<
providerOption name="WarnAsError" value="false"/>
</
compiler>
<
compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<
providerOption name="CompilerVersion" value="v3.5"/>
<
providerOption name="OptionInfer" value="true"/>
<
providerOption name="WarnAsError" value="false"/>
</
compiler>
</
compilers>
</
system.codedom>

 Basically this makes sure that .NET will use the right compiler version to execute your code.

 

Tags:

PermaLink   E-Mail Article   RSS Comment Feed  

Add comment


(Will show your Gravatar icon)
Click to change captcha
biuquote
  • Comment
  • Preview
Loading