Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 75643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:32:54+00:00 2026-05-10T20:32:54+00:00

Title says what i’m trying to do. I can successfully generate an assembly if

  • 0

Title says what i’m trying to do. I can successfully generate an assembly if i don’t specify the LinqOverTypedDatasets option, but i want my typed DataSet to support queries with LINQ.

My code outputs the error:

error CS0006: Metadata file 'System.Data.DataSetExtensions.dll' could not be found

The code:

//System.Data.DataSet myDataSet = << assume myDataSet is valid DataSet object >>;  Dictionary<string, string> options = new Dictionary<string, string>(); options.Add('CompilerVersion', 'v3.5');  using (CSharpCodeProvider cscp = new CSharpCodeProvider(options)) {     CodeNamespace ns = new CodeNamespace('DBSPPS');     CodeCompileUnit ccu = new CodeCompileUnit();      using (StringWriter schemaWriter = new StringWriter())     {         myDataSet.WriteXmlSchema(schemaWriter);         TypedDataSetGenerator.Generate(schemaWriter.ToString(),             ccu,             ns,             cscp,             TypedDataSetGenerator.GenerateOption.LinqOverTypedDatasets             );     }      StringWriter codeWriter = new StringWriter();      cscp.GenerateCodeFromNamespace(ns, codeWriter, new CodeGeneratorOptions());      CompilerParameters parameters = new CompilerParameters();     parameters.GenerateExecutable = false;     parameters.OutputAssembly = 'DBSPPS.dll';     parameters.ReferencedAssemblies.Add('System.dll');     parameters.ReferencedAssemblies.Add('System.Data.dll');     parameters.ReferencedAssemblies.Add('System.Xml.dll');     parameters.ReferencedAssemblies.Add('System.Data.DataSetExtensions.dll');      CompilerResults cr = cscp.CompileAssemblyFromSource(parameters,new string[]{ codeWriter.ToString() });      foreach (string msg in cr.Output)         Console.WriteLine(msg); } 

EDIT: figured this out, corrected code appears above! 🙂 The MSDN documentation is WRONG when it describes the setting the compiler version to 3.5. The value for CompilerVersion should be ‘v3.5’ NOT ‘3.5’ as the docs say.

I got the same compilation errors when i didn’t reference required assembiles (System.dll, etc), which was fixed by adding them to the ReferencedAssemblies collection of the CompilerParameters object. However, when i received the error message about System.Data.DataSetExtensions.dll, adding that assembly to the ReferencedAssemblies still resulted in the same error.

I noticed that System.Data.DataSetExtensions.dll isn’t in the location i expected it to be (\WINDOWS\Microsoft.NET\Framework\v3.5), but in \Program Files\Reference Assemblies\Microsoft\Framework\v3.5. I tried specifying the full path, that didn’t work either. I assumed that since the full path wasn’t specified for the other referenced assemblies, it found them in the GAC. Is this not the case for System.Data.DataSetExtensions.dll ? Or is there something else going on?

Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:32:54+00:00Added an answer on May 10, 2026 at 8:32 pm

    Try tweaking the config so it knows about 3.5 – see the config example here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.