iT Synergy Blogs

Growing Innovation - Soluciones a problemas reales

  • Facebook
  • Instagram
  • LinkedIn
  • Phone
  • Twitter
  • YouTube

Copyright © 2025 · iT Synergy·

Exception Handling – Enterprise Library
Exception Handling – Enterprise Library avatar

February 20, 2013 By Jaime Alonso Páez torres Leave a Comment

Objetivo

Ofrecer una introducción al manejo de excepciones que se pueden presentar en una aplicación web e incluir su registro en el event viewer.

Prerrequisitos

  • Enterprise Library 5.0.
  • Visual Studio

Pasos

La versión de Enterprise Library que se uso es la 5.0

1. Instalar Enterprise Library 5.0.

2. Adicionar las referencias a los siguientes assemblies, en el proyecto web o proyecto de cara al usuario:

Microsoft.Practices.EnterpriseLibrary.Common, Microsoft.Practices.ServiceLocation, Microsoft.Practices.Unity, Microsoft.Practices.Unity.Interception, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Microsoft.Practices.EnterpriseLibrary.Logging

3. En el archivo web.config y dentro del elemento <configuration>, colocar las siguientes lineas que incluye el manejo de las excepciones y el logging de las mismas.

 

<configSections>
<section name=”loggingConfiguration” type=”Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ requirePermission=”true”/>
<section name=”exceptionHandling” type=”Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ requirePermission=”true”/>
</configSections>

<loggingConfiguration name=”Logging Application Block” tracingEnabled=”true” defaultCategory=”General” logWarningsWhenNoCategoriesMatch=”true”>
<listeners>
<add name=”FormatEventLog TraceListener” type=”Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ listenerDataType=”Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ source=”NombreDeAplicacion” formatter=”Text Formatter” log=”Application” machineName=””/>
</listeners>
<formatters>
<add type=”Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ template=”Timestamp: {timestamp}{newline}Message: {message}{newline}Category: {category}{newline}Priority: {priority}{newline}EventId: {eventid}{newline}Severity: {severity}{newline}Title: {title}{newline}Activity ID: {property(ActivityId)}{newline}Machine: {localMachine}{newline}App Domain: {localAppDomain}{newline}ProcessId: {localProcessId}{newline}Process Name: {localProcessName}{newline}Thread Name: {threadName}{newline}Win32 ThreadId:{win32ThreadId}{newline}Extended Properties: {dictionary({key} – {value}{newline})}” name=”Text Formatter”/>
</formatters>
<categorySources>
<add switchValue=”All” name=”General”>
<listeners>
<add name=”FormatEventLog TraceListener”/>
</listeners>
</add>
<add switchValue=”Error” name=”Exceptions”>
<listeners>
<add name=”FormatEventLog TraceListener”/>
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue=”All” name=”All Events”/>
<notProcessed switchValue=”All” name=”Unprocessed Category”/>
<errors switchValue=”All” name=”Logging Errors &amp; Warnings”>
<listeners>
<add name=”FormatEventLog TraceListener”/>
</listeners>
</errors>
</specialSources>
</loggingConfiguration>

 

<exceptionHandling>
<exceptionPolicies>
<add name=”ServiceLayerExceptionPolicy“>
<exceptionTypes>
<add name=”Exception” type=”System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ postHandlingAction=”NotifyRethrow”>
<exceptionHandlers>
<add name=”Logging Handler” type=”Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ logCategory=”Exceptions” eventId=”100″ severity=”Error” title=”TituloaVisualizarEnEventViewer” formatterType=”Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling” priority=”0″/>
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
</exceptionPolicies>
</exceptionHandling>

 

Las partes señaladas en color rojo, indican el nombre de la aplicación web, el nombre de la política de excepciones definida en el Enterprise Library y el titulo que recibirá los errores registrados en el event viewer.

4.  Para garantizar un manejo centralizado de errores,  se implementa el evento Application_Error del global.asax.cs

Filed Under: .NET Tagged With: Enterprise Library 5.0, Exception Handling, Logging

Consultas en SQL Server 2012 utilizando Full Text Search
Consultas en SQL Server 2012 utilizando Full Text Search avatar

February 12, 2013 By Yully Arias Castillo Leave a Comment

Algunas veces es necesario realizar consultas complejas de palabras o frases en una tabla, SQL Server ofrece la funcionalidad de Full Text Search que permite ejecutar consultas de textos sobre una tabla o una vista en una base de datos.

A continuación se describe como crear un Full Text Index sobre la tabla a consultar.

1. Crear el FULL TEXT CATALOG.

clip_image001[6]

1. Se nombra el Full Text Catalog y se selecciona la opción OK.

clip_image003[9]

2. Hacer clic derecho sobre el Full Text Catalog creado, en properties se selecciona la tabla y los campos donde se realizaran las búsquedas.

clip_image005[9]

3. Para realizar la búsqueda por los campo seleccionados se ejecuta el siguiente query:

clip_image007[9]

La sentencia SQL hace una búsqueda de la palabra “Mark” en los campos FirstName, LastName o City

Se pueden utilizar la cláusula CONTAINS cuando se requiere una búsqueda exacta o aproximada del criterio de búsqueda o FREE TEXT para las búsquedas que se necesitan que coincidan con el significado y no con la palabra exacta.

Para más información ver el siguiente link http://msdn.microsoft.com/en-us/library/ms142571.aspx

Filed Under: SQL, SQL Server

illegal name-hiding: ‘XXXException’ hides ‘Company.Business.Schemas.XXXException’
illegal name-hiding: ‘XXXException’ hides ‘Company.Business.Schemas.XXXException’ avatar

January 29, 2013 By Jaime Alonso Páez torres Leave a Comment

Problema

El error señalado aparece después de intentar compilar un proyecto de BizTalk que posee esquemas autogenerados de una importación de un servicio web.

illegal name-hiding: ‘WFConfigException’ hides ‘Company.Business.Schemas.WFConfigException’

Su causa, es porque tanto el message part como el tipo interno poseen el mismo nombre, tal como se muestra en la figura.

image

Solución

El problema se centra sobre los contratos de las excepciones, lo que se hizo fue renombrar el tipo interno del message part.

image

Filed Under: BizTalk Tagged With: BizTalk, illegal name-hiding

  • « Previous Page
  • 1
  • …
  • 19
  • 20
  • 21
  • 22
  • 23
  • …
  • 72
  • Next Page »

Team


Marco
Antonio Hernández

Jaime
Alonso Páez

Luis
Carlos Bernal

Ana
María Orozco

Juan
Camilo Zapata

Carlos
Alberto Rueda

Sonia
Elizabeth Soriano

Diana
Díaz Grijalba

Alexandra
Bravo Restrepo

Bernardo
Enrique Cardales

Juan
Alberto Vélez

Jhon
Jairo Rodriguez

Diana
Paola Padilla

Gustavo
Adolfo Echeverry

Carlos
Andrés Vélez

Yully
Arias Castillo

Brayan
Ruiz

Jesús
Javier Hernández

Alejandro
Garcia Forero

Natalia
Zartha Suárez

Josué
Leonardo Bohórquez

Oscar
Alberto Urrea

Odahir
Rolando Salcedo

Jimmy
Quejada Meneses

Juan
Mauricio García

Mario
Andrés Cortés

Eric
Yovanny Martinez

Carolina
Torres Rodríguez

Tag Cloud

.NET (9) 940px (1) Analysis Services mdx (1) An attempt was made to load a program with an incorrect format. (1) ASP.NET MVC (1) Azure (3) Backup (1) BAM (7) BAM API (1) BAMTraceException (2) BI (3) BizTalk (24) Business Intelligence (6) C# (2) caracteristicas de publicacion (2) Content Editor (3) ESB (15) ESB Toolkit (3) General (4) habilitar caracteristicas (3) indexes (2) Integration Services (2) Master Page (3) MDX (2) MSE (11) net.tcp (2) Office 365 (2) Oracle (2) Performance Point (2) Public Website (2) Receive Location (2) SDK (2) Servicio Web (2) Sharepoint 2010 (2) SharePoint 2013 (4) SharePoint Online (2) SOA (8) Soap Fault (2) Sort Months MDX (2) SQL Server (2) Visual (2) Visual Studio 2010 (2) WCF (19) Windows (3) Windows 8 (17)

Categories

  • .NET (33)
  • Analysis Services (1)
  • ASP.NET MVC (2)
  • Azure (7)
  • BAM (9)
  • BAM PrimaryImport (3)
  • BigData (1)
  • BizTalk (77)
  • BizTalk 2010 configurations (57)
  • BizTalk Application (60)
  • BizTalk Services (13)
  • Business Intelligence (4)
  • Cloud (3)
  • CMD (1)
  • CodeSmith – NetTiers (2)
  • CommandPrompt (1)
  • CRM OptionSet mapping component (1)
  • Desarrollo de software (6)
  • develop (6)
  • developers (3)
  • DropBox (1)
  • Dynamics (1)
  • Enterprise Architect (1)
  • Entity Framework (1)
  • Errores BizTalk (2)
  • ESB (27)
  • ETL (1)
  • Event Viewer (1)
  • Excel Services (1)
  • Foreach loop container (1)
  • General (4)
  • Gerencia de Proyectos (2)
  • Google (1)
  • Grouped Slices (1)
  • Human Talent (1)
  • IIS (4)
  • Integración (6)
  • Integration Services (3)
  • KingswaySoft (1)
  • Lync (1)
  • MSE (13)
  • Office 365 (2)
  • Oracle Data Adapter (2)
  • Performance Point (4)
  • Picklist (1)
  • Pivot Table (1)
  • Procesos (1)
  • Pruebas (1)
  • Public Website (2)
  • Reports (1)
  • SCRUM (1)
  • SDK (2)
  • SEO (1)
  • Servicios (2)
  • Sharepoint (9)
  • SharePoint 2010 (10)
  • SharePoint 2013 (4)
  • SharePoint Online (2)
  • SharpBox (1)
  • Shortcuts (1)
  • Sin categoría (1)
  • SOA (50)
  • SQL (5)
  • SQL Server (3)
  • SQL Server Management Studio (1)
  • SSIS (3)
  • SSL (1)
  • SSO (1)
  • Tracking Profile Editor (2)
  • Twitter (1)
  • Uncategorized (1)
  • Virtual Network (2)
  • Visual Studio 11 (1)
  • Visual Studio 2010 (2)
  • Visual Studio Online (1)
  • VMware (2)
  • WCF (24)
  • Web (1)
  • Web Api (1)
  • Windows (5)
  • Windows 8 (11)
  • Windows Azure (2)
  • Windows Live Write (1)
  • Windows Phone (7)
  • Windows Phone 8 (1)
  • Windows Scheduler (1)
  • windows8 (2)
  • WindowsRT (3)
  • WP7 SDK (1)

Manage

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org