Configuration exception when migrating a ASP.NET application to a Azure webrole

by Damiaan Peeters 31. March 2011 01:50

Ok.  I found why I got a configuration exception every time I launched my azure project (in visual studio 2010). 

I have installed Azure Tools 1.4, on my Visual Studio 2010 SP1.

The problem

When I launched the appFabric / Azure Compute Emulator, I got a my visual studio telling my that I he didn’t have any trace or disassembly information. 

The most annoying part of this situation is that my WebRole Entry point wasn’t started neither.

This was the error (cut some path’s out to keep it readable).

System.Configuration.ConfigurationErrorsException was unhandled
  Message=Configuration system failed to initialize
  Source=System.Configuration
  BareMessage=Configuration system failed to initialize
  Line=0
  StackTrace:
       at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
       at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName)
       at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
       at System.Configuration.ConfigurationManager.GetSection(String sectionName)
       at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
       at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()
       at System.Diagnostics.DiagnosticsConfiguration.Initialize()
       at System.Diagnostics.DiagnosticsConfiguration.get_IndentSize()
       at System.Diagnostics.TraceInternal.InitializeSettings()
       at System.Diagnostics.TraceInternal.get_Listeners()
       at System.Diagnostics.Trace.get_Listeners()
       at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.Initialize(String[] args)
       at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.Initialize(String[] args)
       at Microsoft.WindowsAzure.Hosts.WaIISHost.Program.RunEntryPoint(Parameters parameters)
       at Microsoft.WindowsAzure.Hosts.WaIISHost.Program.Main(String[] args)
  InnerException: System.Configuration.ConfigurationErrorsException
       Message=Configuration file [CUT].WL.dll.config does not have root <configuration> tag (C:\Users\[CUT]\approot\bin\[CUT].WL.dll.config line 2)
       Source=System.Configuration
       BareMessage=Configuration file [CUT].WL.dll.config does not have root <configuration> tag
       Filename=C:\Users\damiaan.COMM-IT\[CUT]\approot\bin\[CUT].WL.dll.config
       Line=2
       StackTrace:
            at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
            at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
            at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
            at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
       InnerException:

Solution

So what does it mean.  If you open up the config file mentioned in the (inner) exception. You might notice this is not a complete configuration file.  For me it was my App.Settings file. 

What I did?  I moved my app.Settings into my Web.config file.  And gone was the error.

I think this is a bug. So, I posted it to Microsoft Connect so you can review it overthere:

https://connect.microsoft.com/VisualStudio/feedback/details/654955/system-configuration-configurationerrorsexception-when-starting-website-hosted-by-azure-appfabric-compute-emulator#tabs

Error: Update can only be called on a valid data item.

by Damiaan Peeters 31. August 2010 20:12

I had this in a ListView with an EntityDatasource.  But only the ListView had to do something with it…

Cause & solution

You did a copy paste from the EditItemTemplate to the InsertItemTemplate. 

The edit command is not allowed use the Insert command.

Change this:

<asp:Button ID="UpdateButton" runat="server" CommandName="Update"  Text="Update" />

To:

<asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />

Security leak op Abonnementen.be?

by Damiaan Peeters 6. June 2010 21:58

Ik weet niet wat er aan de hand is, maar ik wilde mijn abonnement op Trends aanpassen. 

Surf ik naar abonnementen.be. Krijg ik daar eerst een compleet franse pagina.  Om vervolgens na één klik toch de nederlandse pagina’s te zien te krijgen.

Helaas krijg ik bij mijn abonnement beheren de gegevens van totaal iemand anders te zien.  ZELFS als ik op uitloggen klik en terug op mijn abonnementen beheren. 

image

EXECUTE permission denied on object 'aspnet_CheckSchemaVersion', database 'myDB', schema 'dbo'.

by Damiaan Peeters 7. April 2009 18:27

Problem

Today I launched the aspnet_regsql.exe.  Unfortunately I received the following error:

EXECUTE permission denied on object 'aspnet_CheckSchemaVersion', database 'myDB', schema 'dbo'.

Solution

Take the properties of the “NT Autority\Network Service” user.  Select the myDB database and add all the necessary Roles like aspnet_Membership_FullAccess to the user. 

image

In the screenshot are all the databaseroles added.

Tags: ,

Asp.Net | SQL

Error attaching database to Microsoft SQL Server 2005 in Windows Vista (Business)

by Damiaan Peeters 12. April 2008 14:38

Today, I couldn't attach a database of my previous pc to my new MSSQL Server installation.

I got this strange error message in Microsoft SQL Server Management Studio.

[more]

I got this error message:

image 

Attach database failed for Server 'STELLA'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Unable to open the physical file "E:\MSSQL\InfoBase.mdf". Operating system error 5: "5(error not found)". (Microsoft SQL Server, Error: 5120)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3054&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476

 

Solution

The solution was very easy.  Launch Microsoft SQL Server Management Studio as Administrator.

Who.I.am

Certified Umbraco Master, Part of Umbraco Certified partner comm-it, .Net and Azure developer, seo lover. Magician in my spare time.

Month List