Error 2 Build failed due to validation errors in *.dbml
-
Thursday, November 29, 2012 3:48 PM
I am getting the following error message in a C# 2008 application and I do not know what to look at to resolve the problem:
Error2 Build failed due to validation errors in C:\RPT.dbml. Open the file and resolve the issues in the Error List, then try rebuilding the project.There is nothing showing me where the exact error is coming from. There is a reference setup for System.Configuration.
The following code is from the RPT.designer.cs
namespace cli
{
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Data;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using System.Linq.Expressions;
using System.ComponentModel;
using System;
using System.Configuration;
[System.Data.Linq.Mapping.DatabaseAttribute(Name="DEV")]
public partial class RPTDataContext : System.Data.Linq.DataContext
{private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
public RPTDataContext() :
base(ConfigurationManager.ConnectionStrings["DEVConnectionString"].ConnectionString.ToString(), mappingSource)
{
OnCreated();
}The following code is from RPT.cs file:
namespace cli
{
partial class RPTDataContext
{
}
}Here is the code in the app.config file:
<connectionStrings>
<add name="DEVConnectionString"
connectionString="Data Source=xxx;Initial Catalog=PROD1;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>Thus can you tell me and/or show me in code how to fix this problem?
All Replies
-
Thursday, November 29, 2012 4:03 PM
Hi,
there is a fix to this problem at this post : http://www.jonathanjungman.com/blog/post/Visual-Studio-Build-failed-due-to-validation-errors-in-dbml-file.aspx
Hope this may help!
One good question is equivalent to ten best answers.
- Marked As Answer by wendy elizabeth Sunday, December 02, 2012 5:13 PM
-
Friday, November 30, 2012 10:39 AM
While your dbml is not so big, did you try to completely remove it and recreate again?Please Mark as Reply and Vote as Helpful if I helped.
Also please visit my blog http://msguy.net/- Marked As Answer by wendy elizabeth Sunday, December 02, 2012 5:13 PM

