[Mono-aspnet-list] 'ConnectionStringsSection' is not declared. It may be inaccessible due to its protection level.

Danny Hogan dhog12 at gmail.com
Fri Apr 15 00:46:03 UTC 2016


Good evening,

I'm trying to troubleshoot an installation of mono asp.net 4 on apach2 on a
rasberry pi.  I have a fully functioning ASP.Net web site that when I put
it on the rasberry pi mono gives me the error shown below.  Nothing in the
site's design was changed when it was moved to the pi so it should just
work.  The rasberry pi will run hello world and other simple ASPX pages I
feed it, it also runs HTML pages just fine so the installation seems to be
working.  Is there a special setting with mono I need to configure to use
certain features?  In my code below I un-comment Imports
System.Configuration (on the pi just to see if my mono needs broader
inclusion but then I get another error with hardly any details at all which
is even more confusing.  Is it odd that a perfectly working aspx site on
windows suddenly won't run on mono?  The site is built for asp.net 4.0.

Application Exception
System.Web.Compilation.CompilationExceptionerror VBNC30451:
'ConnectionStringsSection' is not declared. It may be inaccessible due to
its protection level.

*Description:* Error compiling a resource required to service this request.
Review your source file and modify it to fix this error.

*Details:* error VBNC30451: 'ConnectionStringsSection' is not declared. It
may be inaccessible due to its protection level.

*Error origin: *Compiler

*Error source file: *
/tmp/www-data-temp-aspnet-0/b64ce37f/App_Web_3d2f48ae_0.vb
*Exception stack trace:*
at System.Web.Compilation.AssemblyBuilder.BuildAssembly
(System.Web.VirtualPath virtualPath,
System.CodeDom.Compiler.CompilerParameters options) [0x00000] in <filename
unknown>:0 at System.Web.Compilation.AssemblyBuilder.BuildAssembly
(System.CodeDom.Compiler.CompilerParameters options) [0x00000] in <filename
unknown>:0 at System.Web.Compilation.AppCodeAssembly.Build (System.String[]
binAssemblies) [0x00000] in <filename unknown>:0 at
System.Web.Compilation.AppCodeCompiler.Compile () [0x00000] in <filename
unknown>:0 at System.Web.HttpApplicationFactory.InitType
(System.Web.HttpContext context) [0x00000] in <filename unknown>:0
*Error source context:*

*Error lines:* 21, 24
19: 20: ' Get the connectionStrings section. 21: Dim
connectionStringsSection As ConnectionStringsSection =
WebConfigurationManager.GetSection("connectionStrings") 22: 23: ' Get the
connectionStrings key,value pairs collection.
Full error source code: (click to hide):
1: #ExternalSource("/var/www/AA/App_Code/DB.vb",1) 2: Imports
Microsoft.VisualBasic 3: Imports MySql.Data.MySqlClient 4: Imports
System.Data 5: Imports System.Web.Configuration 6: Imports System.Web 7:
'Imports System.Configuration 8: 9: 10: 11: 12: 13: Public Class DB 14: Dim
strConnStr As String 15: Dim objConn As New MySqlConnection 16: Sub New()
17: strConnStr = "Server=[withheld]; Port=3306; Database=[withheld]; Uid=
[withheld]; Pwd=[withheld];" 18: 19: 20: ' Get the connectionStrings
section. 21: Dim connectionStringsSection As ConnectionStringsSection =
WebConfigurationManager.GetSection("connectionStrings") 22: 23: ' Get the
connectionStrings key,value pairs collection. 24: Dim connectionStrings As
ConnectionStringSettingsCollection =
connectionStringsSection.ConnectionStrings 25: 26: strConnStr =
connectionStrings(1).connectionString.toString() 27: 28: 29: 30: 31: 32:
33: End Sub
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20160414/036a7c92/attachment.html>


More information about the Mono-aspnet-list mailing list