.Net framework error

  • Thread starter Thread starter Jeremy Sage
  • Start date Start date
J

Jeremy Sage

We are getting occasional errors in our application being reported by users.
Unfortunately the information is very limited and usually the report just
consists of a ".Net framework error".

The application is a front end for a SQL Server 2005 Express database,
written in VB in VS 2008 but targetting the .Net framework version 2.0. We
had a previous version using a standard setup program installation but now
have a later version using Click Once. Clients mainly running Vista.

There are only two instances that we have detailed error information on and
these show the following:
"System.Configuration.ConfigurationErrorsException: Configuration system
failed to initialize ---> System.Configuration.ConfigurationErrorsException:
Root element is missing." (and refers to the user.config file)
and
"System.Data.SqlClient.SqlException: An error has occurred while
establishing a connection to the server. When connecting to SQL Server 2005,
this failure may be caused by the fact that under the default settings SQL
Server does not allow remote connections. (provider: SQL Network Interfaces,
error: 26 - Error Locating Server/Instance Specified)"

In the second instance, the user could connect to the database using sqlcmd
so as SQL is running and the user can connect I thought it may be the
connection string in the app config file. As the first error message implies
a problem with the user config file I wondered if the two problems were
connected.

We do not have any more detail to indicate how many errors there are, the
frequency of them, or how many of the errors are either of the above or
whether there are other errors. However, there are a few workarounds that
users have developed that may shed some light:
- perform a system restore (presumably to before a Windows update but no
info on which one)
- run as a different user (though this may only provide a temporary
solution before the error appears again)
- run the older 'non-ClickOnce' application (again, this may only be a
temporary solution)

Unfortunately, I have not managed to reproduce the error and the information
coming back from users is limited so it has been difficult to fault find. I
am hoping that the above information will be sufficient for someone to help
identify the problems or at least help in some more fault-finding.

Thanks in advance,
Jeremy
 
Hello Jeremy,

From my search on the net, the first issue may result from the user.config
file corrupted which is probably caused by an unsafe shutdown.

Please see discussions about other applications that face the similar
problem,
http://neosmart.net/forums/showthread.php?t=1786
http://code.google.com/p/wittytwitter/issues/detail?id=77

All of options your list, "Perform a system restore", "run as a different
user", "run the older non-ClickOnce version" lead to effect as repairing
the user.config. So they can work around the issue. Currently, a better
solution will be catching the exception and reset the user.config file
programmatically. There is an article doing this in the codeproject. Please
have a read on,
http://www.codeproject.com/KB/dotnet/CorruptUserConfig.aspx

I am not sure if the second issue is related to this. But if so, the above
codeproject article will recovery it, I think. After using the above
remedy, if they are still encountering the second issue, please feel free
to report back.

Have a good day!

Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Colbert Zhou said:
Hello Jeremy,

From my search on the net, the first issue may result from the user.config
file corrupted which is probably caused by an unsafe shutdown.

Thanks for the reply. We have just had another report of the error. This
time we managed to get some more information and in this case the user.config
file was there but completely empty. This seems to be consistent with what
you have said.

I noticed the Code Project article in my search and I will see if I can use
this as a solution. I will try and report back with progress.

We are still not sure whether the errors are predominantly user.config file
problems but we are trying to get more information from users. If it is the
application config file in some cases I do not know what the solution is.

Thanks for your help and if anyone else has any additional information then
please post.

Jeremy
 
Back
Top