ACA.NET Exception

Topics: Enterprise Library Core, Exception Handling Application Block, General discussion, Logging Application Block
Nov 27, 2012 at 10:08 AM

Hi I am getting the following error  while trying to run my website hoisted on IIS. 

How can I correct it? Previously the website was running fine . Since two days it is showing this error. We haven't changed any thing in the code. I had attached the error page and the code in which it is saying there is an error. Please someone reply fast and solve it and help me.

Server Error in '/WSSecurityManagement1' Application.

The following configuration nodes are invalid... Master Key at path Application/Master Key. Bad Data.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Avanade.ACA.Configuration.AcaConfigurationValidationException: The following configuration nodes are invalid... Master Key at path Application/Master Key. Bad Data.

Source Error:

Line 33:         private static object __stringResource;
Line 34:         
Line 35:         private Artists_ascx() {
Line 36:             if ((ASP.Artists_ascx.__initialized == false)) {
Line 37:                ASP.Artists_ascx.__stringResource = System.Web.UI.TemplateControl.ReadStringResource(typeof(ASP.Artists_ascx));


Source File: c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\wssecuritymanagement1\b53e0e58\197349d8\jfqwnihl.0.cs    Line: 35

Stack Trace:

[AcaConfigurationValidationException: The following configuration nodes are invalid...

Master Key at path Application/Master Key.
Bad Data.


]
   Avanade.ACA.Configuration.ConfigurationErrorCollection.ThrowException() +45
   Avanade.ACA.Configuration.ConfigurationNode.LoadChildren() +740
   Avanade.ACA.Configuration.RootApplicationConfigurationNode.Load(ConfigurationBroker broker, Type rootNodeType, ApplicationData appData, Boolean isRuntime) +188
   Avanade.ACA.Configuration.RootApplicationConfigurationNode.Load(Type rootNodeType, ApplicationData appData, Boolean isRuntime) +53
   Avanade.ACA.Configuration.RootApplicationConfigurationNode.LoadApplicationConfiguration(String configurationFile, String baseDirectory) +154
   Avanade.ACA.Configuration.RootApplicationConfigurationNode.LoadApplicationConfiguration() +60
   Avanade.ACA.Configuration.RootApplicationConfigurationNode..cctor() +31

[TypeInitializationException: The type initializer for "Avanade.ACA.Configuration.RootApplicationConfigurationNode" threw an exception.]
   Avanade.ACA.Configuration.RootApplicationConfigurationNode.get_Current() +0
   Avanade.ACA.Radar.ConfigurationHelper.GetRootAppConfigNode() +16
   Avanade.ACA.Radar.ConfigurationHelper.GetResourceNode(String resourceId) +127
   Avanade.ACA.Radar.RadarStrategyFactory.CreateConnectionStrategy(String resourceId) +27
   WSSecurity.RADAR.SecurityDataAccess..cctor()

[TypeInitializationException: The type initializer for "WSSecurity.RADAR.SecurityDataAccess" threw an exception.]
   WSSecurity.RADAR.SecurityDataAccess..ctor() +0
   WSSecurity.RADAR.SecurityManager..ctor()
   WSSecurity.Artists..ctor()
   ASP.Artists_ascx..ctor() in c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\wssecuritymanagement1\b53e0e58\197349d8\jfqwnihl.0.cs:35
   ASP.index_aspx.__BuildControlArtists1() in E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\index.aspx:27
   ASP.index_aspx.__BuildControlForm1() in E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\index.aspx:13
   ASP.index_aspx.__BuildControlTree(Control __ctrl) in E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\index.aspx:1
   ASP.index_aspx.FrameworkInitialize() in c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\wssecuritymanagement1\b53e0e58\197349d8\68kh5dbk.0.cs:0
   System.Web.UI.Page.ProcessRequest() +85
   System.Web.UI.Page.ProcessRequest(HttpContext context) +18
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87



Version Information: Microsoft .NET Framework Version:1.1.4322.2500; ASP.NET Version:1.1.4322.2470 

<!-- [AcaConfigurationValidationException]: The following configuration nodes are invalid... Master Key at path Application/Master Key. Bad Data. at Avanade.ACA.Configuration.ConfigurationErrorCollection.ThrowException() at Avanade.ACA.Configuration.ConfigurationNode.LoadChildren() at Avanade.ACA.Configuration.RootApplicationConfigurationNode.Load(ConfigurationBroker broker, Type rootNodeType, ApplicationData appData, Boolean isRuntime) at Avanade.ACA.Configuration.RootApplicationConfigurationNode.Load(Type rootNodeType, ApplicationData appData, Boolean isRuntime) at Avanade.ACA.Configuration.RootApplicationConfigurationNode.LoadApplicationConfiguration(String configurationFile, String baseDirectory) at Avanade.ACA.Configuration.RootApplicationConfigurationNode.LoadApplicationConfiguration() at Avanade.ACA.Configuration.RootApplicationConfigurationNode..cctor() [TypeInitializationException]: The type initializer for "Avanade.ACA.Configuration.RootApplicationConfigurationNode" threw an exception. at Avanade.ACA.Configuration.RootApplicationConfigurationNode.get_Current() at Avanade.ACA.Radar.ConfigurationHelper.GetRootAppConfigNode() at Avanade.ACA.Radar.ConfigurationHelper.GetResourceNode(String resourceId) at Avanade.ACA.Radar.RadarStrategyFactory.CreateConnectionStrategy(String resourceId) at WSSecurity.RADAR.SecurityDataAccess..cctor() [TypeInitializationException]: The type initializer for "WSSecurity.RADAR.SecurityDataAccess" threw an exception. at WSSecurity.RADAR.SecurityDataAccess..ctor() at WSSecurity.RADAR.SecurityManager..ctor() at WSSecurity.Artists..ctor() at ASP.Artists_ascx..ctor() in c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\wssecuritymanagement1\b53e0e58\197349d8\jfqwnihl.0.cs:line 35 at ASP.index_aspx.__BuildControlArtists1() in E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\index.aspx:line 27 at ASP.index_aspx.__BuildControlForm1() in E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\index.aspx:line 13 at ASP.index_aspx.__BuildControlTree(Control __ctrl) in E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\index.aspx:line 1 at ASP.index_aspx.FrameworkInitialize() in c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\wssecuritymanagement1\b53e0e58\197349d8\68kh5dbk.0.cs:line 0 at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) -->

 

 

This is the code in that page : 

//------------------------------------------------------------------------------// <autogenerated>//     This code was generated by a tool.//     Runtime Version: 1.1.4322.2500////     Changes to this file may cause incorrect behavior and will be lost if //     the code is regenerated.// </autogenerated>//------------------------------------------------------------------------------
namespace ASP {    using System;    using System.Collections;    using System.Collections.Specialized;    using System.Configuration;    using System.Text;    using System.Text.RegularExpressions;    using System.Web;    using System.Web.Caching;    using System.Web.SessionState;    using System.Web.Security;    using System.Web.UI;    using System.Web.UI.WebControls;    using System.Web.UI.HtmlControls;    using ASP;            [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]    public class Artists_ascx : WSSecurity.Artists {                private static bool __initialized = false;                private static object __stringResource;                private Artists_ascx() {            if ((ASP.Artists_ascx.__initialized == false)) {               ASP.Artists_ascx.__stringResource = System.Web.UI.TemplateControl.ReadStringResource(typeof(ASP.Artists_ascx));                ASP.Artists_ascx.__initialized = true;            }        }                protected override bool SupportAutoEvents {            get {                return false;            }        }                protected ASP.Global_asax ApplicationInstance {            get {                return ((ASP.Global_asax)(this.Context.ApplicationInstance));            }        }                public override string TemplateSourceDirectory {            get {                return "/WSSecurityManagement1";            }        }                private System.Web.UI.Control __BuildControlTextBox1() {            System.Web.UI.WebControls.TextBox __ctrl;                        #line 6 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl = new System.Web.UI.WebControls.TextBox();                        #line default            #line hidden            this.TextBox1 = __ctrl;                        #line 6 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.ID = "TextBox1";                        #line default            #line hidden                        #line 6 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.Width = System.Web.UI.WebControls.Unit.Parse("104px", System.Globalization.CultureInfo.InvariantCulture);                        #line default            #line hidden            return __ctrl;        }                private System.Web.UI.Control __BuildControlLinkButton1() {            System.Web.UI.WebControls.LinkButton __ctrl;                        #line 6 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl = new System.Web.UI.WebControls.LinkButton();                        #line default            #line hidden            this.LinkButton1 = __ctrl;                        #line 6 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.ID = "LinkButton1";                        #line default            #line hidden                        #line 6 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.Font.Size = System.Web.UI.WebControls.FontUnit.Parse("Smaller", System.Globalization.CultureInfo.InvariantCulture);                        #line default            #line hidden                        #line 6 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.Font.Names = new string[] {                    "Arial"};                        #line default            #line hidden            System.Web.UI.IParserAccessor __parser = ((System.Web.UI.IParserAccessor)(__ctrl));                        #line 6 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __parser.AddParsedSubObject(new System.Web.UI.LiteralControl("Search"));                        #line default            #line hidden            return __ctrl;        }                private System.Web.UI.Control __BuildControlLinkButton2() {            System.Web.UI.WebControls.LinkButton __ctrl;                        #line 7 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl = new System.Web.UI.WebControls.LinkButton();                        #line default            #line hidden            this.LinkButton2 = __ctrl;                        #line 7 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.ID = "LinkButton2";                        #line default            #line hidden                        #line 7 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.Font.Names = new string[] {                    "Arial"};                        #line default            #line hidden                        #line 7 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.Font.Size = System.Web.UI.WebControls.FontUnit.Parse("Smaller", System.Globalization.CultureInfo.InvariantCulture);                        #line default            #line hidden            System.Web.UI.IParserAccessor __parser = ((System.Web.UI.IParserAccessor)(__ctrl));                        #line 7 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __parser.AddParsedSubObject(new System.Web.UI.LiteralControl("Clear"));                        #line default            #line hidden            return __ctrl;        }                private System.Web.UI.Control __BuildControllstArtist() {            System.Web.UI.WebControls.ListBox __ctrl;                        #line 11 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl = new System.Web.UI.WebControls.ListBox();                        #line default            #line hidden            this.lstArtist = __ctrl;                        #line 11 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.ID = "lstArtist";                        #line default            #line hidden                        #line 11 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.Width = System.Web.UI.WebControls.Unit.Parse("176px", System.Globalization.CultureInfo.InvariantCulture);                        #line default            #line hidden                        #line 11 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.SelectionMode = System.Web.UI.WebControls.ListSelectionMode.Multiple;                        #line default            #line hidden                        #line 11 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.Height = System.Web.UI.WebControls.Unit.Parse("83px", System.Globalization.CultureInfo.InvariantCulture);                        #line default            #line hidden                        #line 11 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __ctrl.AutoPostBack = true;                        #line default            #line hidden            return __ctrl;        }                private void __BuildControlTree(System.Web.UI.Control __ctrl) {            System.Web.UI.IParserAccessor __parser = ((System.Web.UI.IParserAccessor)(__ctrl));                        #line 1 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __parser.AddParsedSubObject(this.CreateResourceBasedLiteralControl(0, 381, true));                        #line default            #line hidden                        #line 1 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            this.__BuildControlTextBox1();                        #line default            #line hidden                        #line 1 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __parser.AddParsedSubObject(this.TextBox1);                        #line default            #line hidden                        #line 1 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            this.__BuildControlLinkButton1();                        #line default            #line hidden                        #line 1 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __parser.AddParsedSubObject(this.LinkButton1);                        #line default            #line hidden                        #line 1 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n\t\t\t"));                        #line default            #line hidden                        #line 1 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            this.__BuildControlLinkButton2();                        #line default            #line hidden                        #line 1 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __parser.AddParsedSubObject(this.LinkButton2);                        #line default            #line hidden                        #line 1 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __parser.AddParsedSubObject(this.CreateResourceBasedLiteralControl(381, 289, true));                        #line default            #line hidden                        #line 1 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            this.__BuildControllstArtist();                        #line default            #line hidden                        #line 1 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __parser.AddParsedSubObject(this.lstArtist);                        #line default            #line hidden                        #line 1 "E:\inetpub\wwwroot\CMSManagement\WSSecurityManagement\Artists.ascx"            __parser.AddParsedSubObject(new System.Web.UI.LiteralControl("\r\n\t\r\n\r\n"));                        #line default            #line hidden        }                protected override void FrameworkInitialize() {            SetStringResourcePointer(ASP.Artists_ascx.__stringResource, 670);            this.__BuildControlTree(this);        }    }}

 

 

Editor
Nov 28, 2012 at 5:43 AM

Your issue seems similar to http://entlib.codeplex.com/discussions/397609.  Based on that post it sounds like a .NET upgrade patch caused the issue.

Unfortunately, my advice would be similar.  You could also see if uninstalling any recent .NET patches (not generally recommended but if gets a production system up and running then probably worth it).

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Dec 3, 2012 at 12:39 PM

Hi,

I have the same problem here.

Somebody as idetified the KB who makes this issue?

Have someone resolved this problem?

Thx in advance

Dec 4, 2012 at 11:12 PM

Anyone needing the solution, please email me and I will send the project files and instructions to fix.

 

staceyham01@hotmail.com

Dec 5, 2012 at 9:27 AM

Hi

Problem solved by installing Patch ACA Masterkey 3.1

 

Thx

Dec 10, 2012 at 7:53 PM

Hi goustaf ... can you plz share the patch or let me know where i can find same. I need it on urgent basis. Thanks.

Dec 11, 2012 at 12:01 PM
Hi,

As i cant send msi or zip files to gmail accounts I have splitted the msi.

1) Rename ACA 3.1 Patch MasterKey.bat.toRename to ACA 3.1 Patch MasterKey.bat
2) Launch it, it will generate the file ACA 3.1 Patch MasterKey.msi
3) Run ACA 3.1 Patch MasterKey.msi in your server it shall work.

regards



From: [email removed]
To: [email removed]
Date: Mon, 10 Dec 2012 12:53:43 -0800
Subject: Re: ACA.NET Exception [entlib:404711]

From: sandeepyadavlko
Hi goustaf ... can you plz share the patch or let me know where i can find same. I need it on urgent basis. Thanks.
Read the full discussion online.
To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)
To start a new discussion for this project, email entlib@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Sep 27, 2013 at 4:11 PM
Can you also send me the ACA.net 3.1 patch? Got the same error as above. :(
Sep 27, 2013 at 6:56 PM
Hi,
I was not able to find the patch myself. I manually changed how I do security as follow:


I am using a VB.Net 2003 solution, not sure about you. Here is what I found; when the ACA.NET MasterKey storage strategy deserialize the masterkey.dat, it tries to force the binding to the MasterKey version from the GAC. For some reason, when KB265635 is applied, that portion of the code fail. However, I found that if we removed that step, the deserialization succeed.
Since the application is using the signed version from the GAC of the ACA.NET libraries, I created a master key custom storage strategy as describe in the ACA.NET documentation. Here are the instructions to implement the workaround.
Important:
- The existing masterkey.dat will need to be updated.
- All existing encrypted strings will no longer be readable and will have to be re-entered and re-encrypted.
Step 1: Add the new master key custom storage strategy project to the solution.
1. Uncompress the yournamespace.Security.Cryptography.zip under the solution folder source code
2. Add the yournamespace.Security.Cryptography.MasterKey to the solution.
3. Add reference to yournamespace.Security.Cryptography.MasterKey in the client project. (Only required to ensure the yournamespace.Security.Cryptography.MasterKey.dll get copied to the Client bin folder.)
4. Build yournamespace.Security.Cryptography.MasterKey
Step 2: Update the application configuration file to use the new master key custom storage strategy,
1. Copy yournamespace.Security.Cryptography.MasterKey.dll to C:\Program Files\Avanade\ACA.NET 3.0\Bin\ (Required so the ACA.NET Configurator Manager find the reference of yournamespace.Security.Cryptography.MasterKey.dll)
2. Open the app.config in the ACA.NET Configurator Manager
3. Right Click on “Master Key\MasterKeyInstance” node and select “Change Master Key”
4. Click “MasterKeyInstanceTypeName“, then click “Load an assembly …”, then select “C:\Program Files\Avanade\ACA.NET 3.0\Bin\ yournamespace.Security.Cryptography.MasterKey.dll and finally select “CustomFileMasterInstance”.
5. Change the “StorageLocation” to the desired location of the “masterkey.dat” file (ie. c:\masterkey.dat or somewhere else)
6. Click on “TypeName” and select the desired encryption. (ie. TripleDES)
7. Update the “IV” and/or “Keys” if desired. (Right down the selected “IV” and/or “Keys”)
8. Update all encrypted connection string password.
9. Save the configuration.
You will notice that the AvanadeACASecurityCryptoStore.config file will get update to point to the new master key custom storage strategy.