I got this error recently in jquery.validate.js:
“Unable to get property ‘getAttribute’ of undefined or null reference”
Turns out the error was from a input type checkbox needing a name attribute and not just an Id attribute.
I got this error recently in jquery.validate.js:
“Unable to get property ‘getAttribute’ of undefined or null reference”
Turns out the error was from a input type checkbox needing a name attribute and not just an Id attribute.
I had a class library project that contains the Entity Framework .edmx file. In the same solution, I had a console application that consumed the class library project. But when I tried to run the console application to run a simple query on the DbContext object, got this error:
The type initializer for ‘System.Data.Entity.Internal.AppConfig’ threw an exception.
In the app.config:
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> </configSections> <connectionStrings> <add name="AdventureWorksLTEntities" connectionString="metadata=res://*/AWModel.csdl|res://*/AWModel.ssdl|res://*/AWModel.msl;provider=System.Data.SqlClient;provider connection string="data source=DNGUYEN-DESKTOP;initial catalog=AdventureWorksLT;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" /> </connectionStrings> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <parameters> <parameter value="v11.0" /> </parameters> </defaultConnectionFactory> </entityFramework> </configuration>
Make sure the <startup> element is AFTER the <connectionStrings> element.