HOL Validation Ex. 11 (EntLib6)

Topics: Validation Application Block
Jun 15, 2014 at 4:02 PM
Hi, currently I'm having a problem completing Exercise 11 of Validation Module, I've follow through the HOL carefully, even I tried to use the "After" Solution (The complete solution), but it showed an error specified below:
The thread 0x1e24 has exited with code 259 (0x103).
'ValidationHOL.vshost.exe' (CLR v4.0.30319: ValidationHOL.vshost.exe): Loaded 'D:\EntLib6HOL\Validation\exercises\Lab11\Before\ValidationHOL\bin\Debug\ValidationHOL.exe'. Symbols loaded.
'ValidationHOL.vshost.exe' (CLR v4.0.30319: ValidationHOL.vshost.exe): Loaded 'D:\EntLib6HOL\Validation\exercises\Lab11\Before\ValidationHOL\bin\Debug\Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.dll'. Cannot find or open the PDB file.
'ValidationHOL.vshost.exe' (CLR v4.0.30319: ValidationHOL.vshost.exe): Loaded 'D:\EntLib6HOL\Validation\exercises\Lab11\Before\ValidationHOL\bin\Debug\Microsoft.Practices.EnterpriseLibrary.Validation.dll'. Cannot find or open the PDB file.
'ValidationHOL.vshost.exe' (CLR v4.0.30319: ValidationHOL.vshost.exe): Loaded 'D:\EntLib6HOL\Validation\exercises\Lab11\Before\ValidationHOL\bin\Debug\Microsoft.Practices.EnterpriseLibrary.Common.dll'. Cannot find or open the PDB file.
'ValidationHOL.vshost.exe' (CLR v4.0.30319: ValidationHOL.vshost.exe): Loaded 'D:\EntLib6HOL\Validation\exercises\Lab11\Before\ValidationHOL\bin\Debug\ValidationHOL.BusinessLogic.dll'. Symbols loaded.
'ValidationHOL.vshost.exe' (CLR v4.0.30319: ValidationHOL.vshost.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.dll
The program '[12032] ValidationHOL.vshost.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
The program '[12032] ValidationHOL.vshost.exe: Program Trace' has exited with code 0 (0x0).
How to fix this issue? Thanks in advance.
Jun 16, 2014 at 7:50 AM
I ran the After solution and it is OK on my machine. The posted StackTrace is for the Before version. I would re-verify the After solution (maybe re-extract to another directory in case it was modified) and compare the modified Before to the working After using a diff tool to see what differences are.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Jun 16, 2014 at 8:23 AM
Edited Jun 16, 2014 at 8:24 AM
randylevy wrote:
I ran the After solution and it is OK on my machine. The posted StackTrace is for the Before version. I would re-verify the After solution (maybe re-extract to another directory in case it was modified) and compare the modified Before to the working After using a diff tool to see what differences are.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Hi Randy,

Thanks for your response, actually I've tried to run the "After" solution without any modification, it was running indeed, but when I remove the SSN Validator from the App.config and add the validator again, the SSNValidator seems missing as specified in below screenshot:
Image

I've tried to build it first, but it didn't work, is it because my Visual Studio Version is 2013?

Thanks in advance.
Jun 17, 2014 at 7:21 AM
It looks like the Enterprise Libraries v6 binaries path has a rogue space in it.

Click on the solution, then hit F4 to bring up the properties window. Remove the space before "ValidationHOL.CustomValidators\bin\Debug". The value should look like:
packages\EnterpriseLibrary.Common.6.0.1304.0\lib\NET45;packages\EnterpriseLibrary.Validation.6.0.1304.0\lib\NET45;packages\EnterpriseLibrary.Validation.Integration.WinForms.6.0.1304.0\lib\NET45;ValidationHOL.CustomValidators\bin\Debug

With that set properly then the ValidationHOL.CustomValidators.dll will be copied to the proper location and the validator will appear in the tool.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Jun 17, 2014 at 8:17 AM
randylevy wrote:
It looks like the Enterprise Libraries v6 binaries path has a rogue space in it.

Click on the solution, then hit F4 to bring up the properties window. Remove the space before "ValidationHOL.CustomValidators\bin\Debug". The value should look like:
packages\EnterpriseLibrary.Common.6.0.1304.0\lib\NET45;packages\EnterpriseLibrary.Validation.6.0.1304.0\lib\NET45;packages\EnterpriseLibrary.Validation.Integration.WinForms.6.0.1304.0\lib\NET45;ValidationHOL.CustomValidators\bin\Debug

With that set properly then the ValidationHOL.CustomValidators.dll will be copied to the proper location and the validator will appear in the tool.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
I've tried with your solution, I'm able to select SSNValidator from the context menus, but unfortunately after I added the SSNValidator and Run the application, it showed the same error with before solution specified below:
The program '[1048] ValidationHOL.vshost.exe' has exited with code 0 (0x0).
The program '[1048] ValidationHOL.vshost.exe: Program Trace' has exited with code 0 (0x0).
The thread 0x29d0 has exited with code 259 (0x103).
The thread 0x1de4 has exited with code 259 (0x103).
'ValidationHOL.vshost.exe' (CLR v4.0.30319: ValidationHOL.vshost.exe): Loaded 'D:\EntLib6HOL\Validation\exercises\Lab11\After\ValidationHOL\bin\Debug\ValidationHOL.exe'. Symbols loaded.
'ValidationHOL.vshost.exe' (CLR v4.0.30319: ValidationHOL.vshost.exe): Loaded 'D:\EntLib6HOL\Validation\exercises\Lab11\After\ValidationHOL\bin\Debug\Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WinForms.dll'. Cannot find or open the PDB file.
'ValidationHOL.vshost.exe' (CLR v4.0.30319: ValidationHOL.vshost.exe): Loaded 'D:\EntLib6HOL\Validation\exercises\Lab11\After\ValidationHOL\bin\Debug\Microsoft.Practices.EnterpriseLibrary.Validation.dll'. Cannot find or open the PDB file.
'ValidationHOL.vshost.exe' (CLR v4.0.30319: ValidationHOL.vshost.exe): Loaded 'D:\EntLib6HOL\Validation\exercises\Lab11\After\ValidationHOL\bin\Debug\Microsoft.Practices.EnterpriseLibrary.Common.dll'. Cannot find or open the PDB file.
'ValidationHOL.vshost.exe' (CLR v4.0.30319: ValidationHOL.vshost.exe): Loaded 'D:\EntLib6HOL\Validation\exercises\Lab11\After\ValidationHOL\bin\Debug\ValidationHOL.BusinessLogic.dll'. Symbols loaded.
'ValidationHOL.vshost.exe' (CLR v4.0.30319: ValidationHOL.vshost.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
A first chance exception of type 'System.ArgumentNullException' occurred in mscorlib.dll
The program '[13468] ValidationHOL.vshost.exe: Program Trace' has exited with code 0 (0x0).
The program '[13468] ValidationHOL.vshost.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
Do you have any solution? Is this issue caused by the Visual Studio Version? Thanks in advance.
Jun 18, 2014 at 6:19 AM
There is another issue with the Lab: the default constructor for SSNValidatorData needs to set the type of the validator (the XML was being rendered without a type which causes an error). The solution is to modify the SSNValidatorData default constructor to set the type:
        public SSNValidatorData()
        {
            Type = typeof(SSNValidator);
        }
~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Marked as answer by jazzyhacker on 6/22/2014 at 3:35 PM
Jun 18, 2014 at 8:19 AM
randylevy wrote:
There is another issue with the Lab: the default constructor for SSNValidatorData needs to set the type of the validator (the XML was being rendered without a type which causes an error). The solution is to modify the SSNValidatorData default constructor to set the type:
        public SSNValidatorData()
        {
            Type = typeof(SSNValidator);
        }
~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Dear Randy,

Actually I can't access the member "Type" that you mentioned.

Thanks in advance.
Jun 20, 2014 at 5:18 AM
That's very strange; SSNValidatorData is an instance of NameTypeConfigurationElement which contains a Type property.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Jun 22, 2014 at 11:36 PM
randylevy wrote:
That's very strange; SSNValidatorData is an instance of NameTypeConfigurationElement which contains a Type property.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Dear Randy,

Now it's working, I'm forgot to build my project, because it never been built before. Thanks for your solution. :)