I just ran into this error when I was trying to open a freshly installed DNN 5.6.1 website using vs 2010. In searching for a solution I found this DNN thread and I also found this thread http://forums.asp.net/p/1550353/3799820.aspx
In the forums.asp.net thread I found good detailed answers(read all the way through to the end of my explanation for the full answer)
First detail:
In the web.config file, within the <system.web> tags, insert the httpRuntime element with the attribute requestValidationMode="2.0". Also add the validateRequest="false" attribute in the pages element.
Example:
<configuration>
<system.web>
<httpRuntime requestValidationMode="2.0" />
</system.web>
<pages validateRequest="false">
</pages>
</configuration>
2. Detail was that the <pages validateRequest="false"> was not needed - I did not add this to my web.config
3. I found that this is already in the web.config
<httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="8192" requestLengthDiskThreshold="8192" />
So I only had added the requestValidationMode="2.0" to the end to create the following -
<httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="8192" requestLengthDiskThreshold="8192" requestValidationMode="2.0" />
This corrected the problem.
Question:
Earlier in the DNN thread Cathlin said that this is handled by DNN at the server level and this only occurs if you open it in vs2010 - why is this line not in the web.config when it is released. There was a short-time where creating a local DNN was a breeze, you simply created a folder, unzipped the DNN installation, opened the website in visual studio, and did an auto install and then you were ready to work. It is important that ease be carried forward. Now if I have to modify the web.config before I can work in vs 2010 we have gone backwards in productivity!
Hope this detail helps others.
Judy