Monday, September 25

unhandled exception of type 'system.typeinitializationexception' in WPF

I was playing around with a Windows Presentation Foundation app and wanted to add Spring.NET to it. I added in the with the references to Spring.Core and Spring.AOP after using NuGet to add them to the project. 
 
   
     

     

   
 

Running the application, it immediately threw a 'System.TypeInitializationException'.

I tried to remove the section name, then the section Group, but the same exception occurred. I gave in and did a search on the exception and StackOverflow had the answer. The startup must be the last section of the App.config file:
 
   
 




Thursday, September 7

Spring.NET config error

Leaving out this section in App.config:

 
   
     

     

   
 

Gives you this error stack:


System.TypeInitializationException: The type initializer for 'Spring.Context.Support.ContextRegistry' threw an exception. ---> Common.Logging.ConfigurationException: Failed obtaining configuration for Common.Logging from configuration section 'common/logging'. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section spring. (c:\users\tjmadden\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe.Config line 3)
   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)
   --- End of inner exception stack trace ---
   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 Common.Logging.Configuration.DefaultConfigurationReader.GetSection(String sectionName) in c:\_oss\common-logging\src\Common.Logging.Portable\Logging\Configuration\DefaultConfigurationReader.cs:line 64
   at Common.Logging.LogManager.<>c__DisplayClass6.b__3() in c:\_oss\common-logging\src\Common.Logging.Portable\Logging\LogManager.cs:line 472
   at Common.Logging.Configuration.ArgUtils.<>c__DisplayClass5.b__4() in c:\_oss\common-logging\src\Common.Logging.Portable\Logging\Configuration\ArgUtils.cs:line 292
   at Common.Logging.Configuration.ArgUtils.Guard[T](Function`1 function, String messageFormat, Object[] args) in c:\_oss\common-logging\src\Common.Logging.Portable\Logging\Configuration\ArgUtils.cs:line 318
   --- End of inner exception stack trace ---
   at Common.Logging.Configuration.ArgUtils.Guard[T](Function`1 function, String messageFormat, Object[] args) in c:\_oss\common-logging\src\Common.Logging.Portable\Logging\Configuration\ArgUtils.cs:line 330
   at Common.Logging.Configuration.ArgUtils.Guard(Action action, String messageFormat, Object[] args) in c:\_oss\common-logging\src\Common.Logging.Portable\Logging\Configuration\ArgUtils.cs:line 290
   at Common.Logging.LogManager.BuildLoggerFactoryAdapter() in c:\_oss\common-logging\src\Common.Logging.Portable\Logging\LogManager.cs:line 470
   at Common.Logging.LogManager.get_Adapter() in c:\_oss\common-logging\src\Common.Logging.Portable\Logging\LogManager.cs:line 203
   at Common.Logging.LogManager.GetLogger(Type type) in c:\_oss\common-logging\src\Common.Logging.Portable\Logging\LogManager.cs:line 422
   at Spring.Context.Support.ContextRegistry..cctor() in c:\_prj\spring-net\src\Spring\Spring.Core\Context\Support\ContextRegistry.cs:line 58
   --- End of inner exception stack trace ---
   at Spring.Context.Support.ContextRegistry.GetContext()
   at ConsoleApplication1.Program.Main(String[] args) in c:\users\tjmadden\documents\visual studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 19

Saturday, August 26

Creston Presentation

When I worked remotely for a previous company, the wourl fly emplyees to their offices in California periodically to meet face to face. One of the activities we would do was to gather in the conference room that had a projector. Employees would be asked to present on project status, new information, and other topics of interest to the group. As speakers switched in and out there were that lull as a laptop was disconnected from the cable leading to the projector and another laptop connected. Each time this happened attendees would break off to check email or respond to messages. It always intteruped the flow of the meeting.

The Air Media box connects to a project or monitor and makes it available through the local WIFI network. It uses the existing nework to there is no need to logic to another network with a different user id and password. It allows for up to 32 devices to connect to one box and displays can be switched easily. 

Connecting that may desvices can be used for collaboration spaces. Small tables or workstations are used by groups for students to work togehter on a task, assignment, or project. Traditionally, if a group wished to share a finding to the class, they would need to gather everyone around the one table, or wires would need to be run to connect to a big screen. Air Media eliminates the wires and allows more flexible ways to present information.

There are free apps for IPad and Android tables as will and phones. Personally, I don't think I would be able to read notes from a phone. This does allow an instructor to pick up a tablet and move among the class to keep students engaged and learning.

Open collaboration is not always appropriate in all settings. An instructor can deliver a lecture from a podium in the traditional manner. Howerver, no more trying to find the video cable and where to connect it to a laptop, much less how to connect the cable to a tablet or IPad.

Having given you and example of Air Media's use, I will now show the steps to connect to one. Here is the screen that the projecto will show. At the top is the devices address. On your computer, you would enter the address in a web browser. A small app will download and you will need to run it. The app may prompt you for a code displayed in the upper right hand corner of the big screen. This code insures that you are connecting to the intended screen. Having a business calls accidentally displaying a spreadsheet in an anatomy class is bad, and may worse showing an anatomy diagram in a business class.

Click connect and your display is show on the screen. You can load up the lectures, photos, and other materials to begin teaching.

This concludes the presentation.

Saturday, May 27

ASP.NET Notes

Components of ASP.NET:


  1. Common Language Runtime (CLR)
  2. .NET Framework Class Library
  3. Common Language Specifications
  4. Common Type System
  5. Metadata and Assemblies
    1. Metadata is the binary information describing the program which is either stored in a PE file or in memory. Assembly is a logical unit consisting of the assembly manifest, type metadata, IL code, and resources such as images.
  6. Windows and Forms
  7. ASP.NET and ASP.NET AJAX
    1. AJAX allows page updates without reloading
  8. ADO.NET
    1. Access to databases and XML
  9. Windows Workflow Foundation (WF)
  10. Windows Presentation Foundation (WPF)
  11. Windows Communication Foundation (WCF)
  12. Windows Cardspace
  13. LINQ
ASP.NET Life Cycle specifies how:
  • ASP.NET processes pages to produce dynamic output
  • The application and its pages are instantiated and processed.
  • ASP.NET compiles the page dynamically
Life cycle can be divided into two groups:

  1. Application Life Cycle
  2. Page Life Cycle
Application Life Cycle
The application life cycle has the following states:
  • The user makes a request for accessing application resource, a page, Browser sends the request to the web server.
  • A unified pipeline receives the first request and the following events take place:
    • An object of class ApplicationManager is created.
    • An object of class HostingEnvironment is created.
    • Top level items in the application are compiled.
  • Response object are created:
    • HttpContext
    • HttpRequest
    • HttpResponse
  • An instance of HttpApplication is created and assigned to the request.
  • The request is processed by the application class. Events are parsed.
ASP.NET Page Life Cycle Phases:
  • Initialization
  • Instantiation
  • Restoration and maintenance of the state
  • Execution of the event handler codes
  • Page Rendering

Stages:

  • Page Request
  • Starting of the page lifecycle
  • Page initialization
  • Page load
  • Validation
  • Postback event handling
  • Page Rendering
  • Unload
Events:
  • PreInit - overload OnPreInit
  • Init - overload OnInit
  • InitComplete
  • Load ViewState
  • Load PostData
  • PreLoad - overload OnPreLoad
  • Load - overload OnLoad
  • LoadComplete - overload OnLoadComplete
  • PreRender
  • PreRender Complete
  • SaveState Complete - override Render
  • Unload