<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">.NET at the train</title><subtitle type="html">General .NET development and other thoughts written while train time</subtitle><id>http://blogs.msdn.com/b/ralarcon/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ralarcon/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/ralarcon/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2011-11-16T23:32:39Z</updated><entry><title>Build problems after upgrading from TFS2010 to TFS2012</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ralarcon/archive/2013/04/10/build-problems-after-upgrading-from-tfs2010-to-tfs2012.aspx" /><id>http://blogs.msdn.com/b/ralarcon/archive/2013/04/10/build-problems-after-upgrading-from-tfs2010-to-tfs2012.aspx</id><published>2013-04-10T07:47:00Z</published><updated>2013-04-10T07:47:00Z</updated><content type="html">Recently our TFS Server have been upgraded to TFS2012 + QU1 + CU1. In order to be able to use our Build Server we have had to upgrade it from TFS2010 to TFS2012 as well and, of course, we have found a couple issues related to the build process templates that we had defined which do not allow us to make a builds successfully. 
 I have to mention that we have only found this errors with customized build process templates (the default build process templates worked fine). 
 The first error that we...(&lt;a href="http://blogs.msdn.com/b/ralarcon/archive/2013/04/10/build-problems-after-upgrading-from-tfs2010-to-tfs2012.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10409903" width="1" height="1"&gt;</content><author><name>Raúl Alarcón</name><uri>http://blogs.msdn.com/ralarcon/ProfileUrlRedirect.ashx</uri></author><category term="Build Process Template" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Build+Process+Template/" /><category term="TFS2010" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/TFS2010/" /><category term="TFS2012" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/TFS2012/" /></entry><entry><title>SSIS, SQL Agent, Credential, Proxies and the -1073741515 process exit code</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ralarcon/archive/2013/02/27/ssis-sql-agent-credential-proxies-and-the-1073741515-process-exit-code.aspx" /><id>http://blogs.msdn.com/b/ralarcon/archive/2013/02/27/ssis-sql-agent-credential-proxies-and-the-1073741515-process-exit-code.aspx</id><published>2013-02-27T09:55:00Z</published><updated>2013-02-27T09:55:00Z</updated><content type="html">Recently I have been dealing with a really weird error while trying to execute a SSIS package using a SQL Agent Job with a concrete user credential. The error that I've got was: 
 Executed as user: XXXXX. The step did not generate any output. The return value was unknown. The process exit code was -1073741515. The step failed. 
 And that's all! 
 Ok, I had in mind a hypothesis regarding the root cause: the user privilegies. The user was not managed/created by myself so the first thing I've done...(&lt;a href="http://blogs.msdn.com/b/ralarcon/archive/2013/02/27/ssis-sql-agent-credential-proxies-and-the-1073741515-process-exit-code.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10397517" width="1" height="1"&gt;</content><author><name>Raúl Alarcón</name><uri>http://blogs.msdn.com/ralarcon/ProfileUrlRedirect.ashx</uri></author><category term="SQL Server" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/SQL+Server/" /><category term="Job" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Job/" /><category term="SSIS" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/SSIS/" /></entry><entry><title>Useful T-SQL Scripts</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ralarcon/archive/2013/01/28/useful-t-sql-scripts.aspx" /><id>http://blogs.msdn.com/b/ralarcon/archive/2013/01/28/useful-t-sql-scripts.aspx</id><published>2013-01-28T08:08:00Z</published><updated>2013-01-28T08:08:00Z</updated><content type="html">A couple of very useful and heavy used T-SQL scripts... Finally, I have decided to post both in order to find them every time I need with out having to re-author: 
 1. Kill all existing connections to a certain database: 
 USE master 
 DECLARE @DataBaseName varchar(255) = '&amp;lt;YOUR_DATABASE_NAME&amp;gt;' 
 DECLARE @spid INT, @cnt INT, @sql VARCHAR(255) SELECT @spid = MIN(spid), @cnt = COUNT(*) FROM master..sysprocesses WHERE dbid = DB_ID(@DataBaseName) AND spid != @@SPID 
 PRINT 'Cleaning up process...(&lt;a href="http://blogs.msdn.com/b/ralarcon/archive/2013/01/28/useful-t-sql-scripts.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10388772" width="1" height="1"&gt;</content><author><name>Raúl Alarcón</name><uri>http://blogs.msdn.com/ralarcon/ProfileUrlRedirect.ashx</uri></author><category term="SQL Server" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/SQL+Server/" /><category term="T-SQL" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/T_2D00_SQL/" /></entry><entry><title>Error 1603 installing AppFabric 1.1 for Windows Server</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ralarcon/archive/2012/10/17/error-1603-installing-appfabric-1-1-for-windows-server.aspx" /><id>http://blogs.msdn.com/b/ralarcon/archive/2012/10/17/error-1603-installing-appfabric-1-1-for-windows-server.aspx</id><published>2012-10-17T21:31:00Z</published><updated>2012-10-17T21:31:00Z</updated><content type="html">I been dealing for some time with an error installing AppFabric 1.1. for Windows Server. All started when, after having AppFabric installed my laptop runs in a System Restore after having updated the video driver. The restore puts my system in a previous state where the installation of AppFabric isn't exists. 
 After that, I've tried to re-install AppFabric with the surprise of getting the following error: Microsoft.ApplicationServer.Setup.Core.SetupException: AppFabric installation failed because...(&lt;a href="http://blogs.msdn.com/b/ralarcon/archive/2012/10/17/error-1603-installing-appfabric-1-1-for-windows-server.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10360568" width="1" height="1"&gt;</content><author><name>Raúl Alarcón</name><uri>http://blogs.msdn.com/ralarcon/ProfileUrlRedirect.ashx</uri></author><category term="C#" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/C_2300_/" /><category term="Errors" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Errors/" /><category term="AppFabric" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/AppFabric/" /></entry><entry><title>Web App Performance Counters Compilation</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ralarcon/archive/2012/10/03/web-app-performance-counters-compilation.aspx" /><id>http://blogs.msdn.com/b/ralarcon/archive/2012/10/03/web-app-performance-counters-compilation.aspx</id><published>2012-10-03T05:54:00Z</published><updated>2012-10-03T05:54:00Z</updated><content type="html">In order measure the performance of a common web application (a web frontend connected to a database server), to which performance counters we have to pay attention?. If we are trying to diagnose a performance problem, where to start?. What does each performance counter means? When I have to get worried by a specific counter? 
 Well, there are hundreds of performance counters available, most of them related with others, and could be a little bit tricky to select which counters we want to gather...(&lt;a href="http://blogs.msdn.com/b/ralarcon/archive/2012/10/03/web-app-performance-counters-compilation.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10355405" width="1" height="1"&gt;</content><author><name>Raúl Alarcón</name><uri>http://blogs.msdn.com/ralarcon/ProfileUrlRedirect.ashx</uri></author><category term=".NET" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/-NET/" /><category term="Perfomance Counters" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Perfomance+Counters/" /><category term="SQL Server" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/SQL+Server/" /></entry><entry><title>IP Lockdown en Web Roles de Azure</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ralarcon/archive/2012/06/05/ip-lockdown-en-web-roles-de-azure.aspx" /><id>http://blogs.msdn.com/b/ralarcon/archive/2012/06/05/ip-lockdown-en-web-roles-de-azure.aspx</id><published>2012-06-05T15:43:29Z</published><updated>2012-06-05T15:43:29Z</updated><content type="html">En el proyecto actual hemos tenido la necesidad de limitar el acceso los Web Roles de manera que sólo determinadas IPs pueden alcanzar el sitio web público. Básicamente se trata de limitar la superficie de exposición de la aplicación ya que el objetivo de la solución desarrollada no es de ámbito global si no local (se podría decir que es una aplicación de Intranet). Si se busca en la web sobre “direcciones IPs, restricción y Azure”, puede ser que se llegue a encontrar algo sobre “ NetworkTrafficRules...(&lt;a href="http://blogs.msdn.com/b/ralarcon/archive/2012/06/05/ip-lockdown-en-web-roles-de-azure.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10315298" width="1" height="1"&gt;</content><author><name>Raúl Alarcón</name><uri>http://blogs.msdn.com/ralarcon/ProfileUrlRedirect.ashx</uri></author><category term="Despliegue" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Despliegue/" /><category term="Azure" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Azure/" /></entry><entry><title>Índices grandes en SQL Azure, error 40552</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ralarcon/archive/2012/03/07/indices-grandes-en-sql-azure-error-40552.aspx" /><id>http://blogs.msdn.com/b/ralarcon/archive/2012/03/07/indices-grandes-en-sql-azure-error-40552.aspx</id><published>2012-03-07T22:50:47Z</published><updated>2012-03-07T22:50:47Z</updated><content type="html">&lt;p&gt;El otro día, en el proyecto donde estoy trabajando ahora, me encontré con la siguiente situación: en una base de datos SQL Azure, sobre una tabla que tenía más de 10 millones de registros, necesito crear un índice para optimizar una serie de consultas. La tabla, contiene cerca de 100 campos y en el índice quiero incluir un número importante de ellos (unos 25).&lt;/p&gt;  &lt;p&gt;El resultado inicial, después de 15 minutos, es el siguiente:&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;&lt;em&gt;Msg 40552, Level 20, State 1, Line 1&lt;/em&gt;      &lt;br /&gt;&lt;em&gt;The session has been terminated because of excessive transaction log space usage. Try modifying fewer rows in a single transaction.&lt;/em&gt;      &lt;br /&gt;&lt;em&gt;Msg 0, Level 20, State 0, Line 0&lt;/em&gt;      &lt;br /&gt;&lt;em&gt;A severe error occurred on the current command. The results, if any, should be discarded.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;El problema lo entiendo perfectamente: estoy consumiendo mucho log de transacciones por que la tabla tiene muchas filas y estoy creando un índice bastante grande, pero… ¿¡QUE HAGO!?, yo necesito ese índice. Estos errores se enmarcan dentro de los errores de transitorios SQL Azure (en concreto de pérdida de conexión).&lt;/p&gt;  &lt;p&gt;Bien, dando una vuelta por la &lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/ff394106.aspx" target="_blank"&gt;documentación de los errores&lt;/a&gt; (muy buena por cierto) veo que menciona que a la hora de reconstruir un índice puedes utilizar la opción “WITH (ONLINE=ON)”. Pues no sólo vale para “reconstruir”, también vale para crear nuevos índices o borrar existentes.&lt;/p&gt;  &lt;p&gt;Ale, problema resuelto.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10279443" width="1" height="1"&gt;</content><author><name>Raúl Alarcón</name><uri>http://blogs.msdn.com/ralarcon/ProfileUrlRedirect.ashx</uri></author><category term="SQL Azure" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/SQL+Azure/" /><category term="Índices grandes" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/_CD00_ndices+grandes/" /></entry><entry><title>Configuración Avanzada (y flexible) en Windows Azure</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ralarcon/archive/2012/02/29/configuraci-243-n-avanzada-y-flexible-en-windows-azure.aspx" /><id>http://blogs.msdn.com/b/ralarcon/archive/2012/02/29/configuraci-243-n-avanzada-y-flexible-en-windows-azure.aspx</id><published>2012-02-29T22:58:00Z</published><updated>2012-02-29T22:58:00Z</updated><content type="html">&lt;p&gt;Entre @ridomin y yo hemos escrito un art&amp;iacute;culo sobre la configuraci&amp;oacute;n de aplicaciones en Windows Azure considerando todo el ciclo de vida de las aplicaciones y los requisitos que un proceso de construcci&amp;oacute;n de software formal tiene.&lt;/p&gt;
&lt;p&gt;Pod&amp;eacute;is leer la versi&amp;oacute;n en castellano &lt;a title="Configuraci&amp;oacute;n Avanzada en Windows Azure" href="http://blogs.msdn.com/b/ralarcon/p/configuracion-avanzada-windows-azure.aspx"&gt;aqu&amp;iacute; en mi blog&lt;/a&gt;&amp;nbsp;y la versi&amp;oacute;n en ingl&amp;eacute;s en el &lt;a href="http://blogs.msdn.com/b/rido/p/advanced_configuration_azure_applications.aspx"&gt;blog de Rido&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Este art&amp;iacute;culo es el primero de una serie en la que esperamos ir construyendo una herramienta para gestionar de forma avanzada, y desde un punto de vista novedoso, la configuraci&amp;oacute;n de las aplicaciones que se ejecutan en Azure.&amp;nbsp;Hemos escrito el articulo de los conceptos m&amp;aacute;s globales a los m&amp;aacute;s concretos, planteando un concepto de soluci&amp;oacute;n de la cual ya tenemos una PoC.&lt;/p&gt;
&lt;p&gt;Espero que os guste.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10274993" width="1" height="1"&gt;</content><author><name>Raúl Alarcón</name><uri>http://blogs.msdn.com/ralarcon/ProfileUrlRedirect.ashx</uri></author><category term="Windows Azure" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Windows+Azure/" /><category term=".NET" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/-NET/" /><category term="Azure" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Azure/" /><category term="Configuraci&amp;#243;n" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Configuraci_26002300_243_3B00_n/" /></entry><entry><title>Windows Azure y Classic Pipeline (Segunda Parte)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ralarcon/archive/2011/12/19/windows-azure-y-classic-pipeline-segunda-parte.aspx" /><id>http://blogs.msdn.com/b/ralarcon/archive/2011/12/19/windows-azure-y-classic-pipeline-segunda-parte.aspx</id><published>2011-12-19T22:27:15Z</published><updated>2011-12-19T22:27:15Z</updated><content type="html">&lt;p&gt;En la &lt;a href="http://blogs.msdn.com/b/ralarcon/archive/2011/11/16/windows-azure-y-classic-pipeline.aspx" target="_blank"&gt;primera parte&lt;/a&gt;, vimos los requisitos que teníamos que cumplir para poder ejecutar una aplicación web diseñada para IIS 6.0 en un IIS 7.0 ó 7.5, y por ende, para poderla ejecutar en Windows Azure. El principal requisito es que la aplicación pueda utilizar el Modo Clásico del pipeline de .NET.&lt;/p&gt;  &lt;p&gt;El único inconveniente de la solución aportada en la &lt;a href="http://blogs.msdn.com/b/ralarcon/archive/2011/11/16/windows-azure-y-classic-pipeline.aspx" target="_blank"&gt;primera parte&lt;/a&gt; es que sólo es apta para aplicación que utilicen la versión de .NET 2.0/3.5.&lt;/p&gt;  &lt;p&gt;Al ejecutar una aplicación en .NET 4.0 y que además utilice el pipeline clásico, nos encontraremos con un error 404 (File or directory not found), que la verdad, nos puede dejar un poco descolocados:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-88-84-metablogapi/6354.image_5F00_4.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-88-84-metablogapi/1586.image_5F00_thumb_5F00_1.png" width="644" height="333" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Como casi no nos lo podemos creer, nos vamos al servidor y vemos que el error tiene un pequeño matiz, el error es un 404.2:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-88-84-metablogapi/7840.image_5F00_5.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-88-84-metablogapi/1067.image_5F00_thumb.png" width="644" height="462" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Vemos que el problema está relacionado con el ISAPI que maneja las peticiones ASPX. &lt;a href="http://support.microsoft.com/kb/942040/en-us" target="_blank"&gt;Buscando literatura&lt;/a&gt; vemos que la raíz del problema es que, por defecto, el filtro ISAPI para .NET 4.0 no está activado por defecto. Podemos verlo en la siguiente imagen:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-88-84-metablogapi/8420.image_5F00_10.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-88-84-metablogapi/3124.image_5F00_thumb_5F00_4.png" width="644" height="286" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Bueno, una vez diagnosticado el problema sólo tenemos que buscar la manera de poder habilitar el filtro ISAPI para .NET 4.0 de manera automática (cómo ya explicamos en la &lt;a href="http://blogs.msdn.com/b/ralarcon/archive/2011/11/16/windows-azure-y-classic-pipeline.aspx" target="_blank"&gt;primera parte&lt;/a&gt;, al tratarse de Azure no podemos realizar las configuraciones manualmente). &lt;/p&gt;  &lt;p&gt;Buscando buscando, &lt;a href="http://www.iis.net/ConfigReference/system.webServer/isapiFilters" target="_blank"&gt;encontré&lt;/a&gt; la manera de modificar la sección de configuración de IIS que gestiona los filtros ISAPI (&lt;font face="Courier New"&gt;&amp;lt;isapiFilters&amp;gt;&lt;/font&gt;) y preparé un nuevo método dentro de nuestra clase &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleentrypoint.aspx" target="_blank"&gt;RoleEntryPoint&lt;/a&gt; para establecer la configuración necesaria, el método &lt;em&gt;AllowAspNet4Isapi&lt;/em&gt;:&lt;/p&gt;  &lt;div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);" id="codeSnippetWrapper"&gt;   &lt;div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet"&gt;     &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Sub&lt;/span&gt; AllowAspNet4Isapi()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;    Trace.WriteLine(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;AllowAspNet4ISAPI...&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;Dim&lt;/span&gt; serverManager &lt;span style="color: rgb(0, 0, 255);"&gt;As&lt;/span&gt; ServerManager = &lt;span style="color: rgb(0, 0, 255);"&gt;New&lt;/span&gt; ServerManager&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;Try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;Dim&lt;/span&gt; config &lt;span style="color: rgb(0, 0, 255);"&gt;As&lt;/span&gt; Configuration = ServerManager.GetApplicationHostConfiguration&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;Dim&lt;/span&gt; isapiCgiRestrictionSection &lt;span style="color: rgb(0, 0, 255);"&gt;As&lt;/span&gt; ConfigurationSection = config.GetSection(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;system.webServer/security/isapiCgiRestriction&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;Dim&lt;/span&gt; isapiCgiRestrictionCollection &lt;span style="color: rgb(0, 0, 255);"&gt;As&lt;/span&gt; ConfigurationElementCollection = isapiCgiRestrictionSection.GetCollection&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;Dim&lt;/span&gt; elems = isapiCgiRestrictionCollection.Where(&lt;span style="color: rgb(0, 0, 255);"&gt;Function&lt;/span&gt;(ce) ce.Attributes(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;description&amp;quot;&lt;/span&gt;).Value = &lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;ASP.NET v4.0.30319&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;For&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Each&lt;/span&gt; e &lt;span style="color: rgb(0, 0, 255);"&gt;As&lt;/span&gt; ConfigurationElement &lt;span style="color: rgb(0, 0, 255);"&gt;In&lt;/span&gt; elems&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;            Trace.WriteLine(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;Accessing to set 'allowed'=true...&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;            e.Attributes(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;allowed&amp;quot;&lt;/span&gt;).Value = &lt;span style="color: rgb(0, 0, 255);"&gt;True&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;Next&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;        serverManager.CommitChanges()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;Catch&lt;/span&gt; ex &lt;span style="color: rgb(0, 0, 255);"&gt;As&lt;/span&gt; Exception&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;        Trace.WriteLine(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;Se ha producido un error: &amp;quot;&lt;/span&gt; + ex.Message)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;        Trace.WriteLine(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;Exception: &amp;quot;&lt;/span&gt; + ex.ToString())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;Finally&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;        serverManager.Dispose()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;End&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;End&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Con este nuevo método y un pequeño refactoring, OnStart() queda como sigue:&lt;/p&gt;

&lt;div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);" id="codeSnippetWrapper"&gt;
  &lt;div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet"&gt;
    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Overrides&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Function&lt;/span&gt; OnStart() &lt;span style="color: rgb(0, 0, 255);"&gt;As&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Boolean&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;    &lt;span style="color: rgb(0, 128, 0);"&gt;'Configure Azure Tracing&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;    ConfigureTracing()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;    &lt;span style="color: rgb(0, 128, 0);"&gt;'Permitir el ISAPI de .NET 4.0&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;    AllowAspNet4Isapi()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;    &lt;span style="color: rgb(0, 128, 0);"&gt;'Configure Azure Pipeline&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;    SetClassicIISPipelineMode()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;Return&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;MyBase&lt;/span&gt;.OnStart()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;End&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Function&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Espero que os sea de utilidad, aunque repitiendo lo ya dicho en la &lt;a href="http://blogs.msdn.com/b/ralarcon/archive/2011/11/16/windows-azure-y-classic-pipeline.aspx" target="_blank"&gt;primera parte&lt;/a&gt;, mi recomendación personal es actualizar la aplicación para poder ejecutarla utilizando el modo integrado, que tiene bastantes ventajas sobre el clásico (&lt;a href="http://stackoverflow.com/questions/716049/what-is-the-difference-between-classic-and-integrated-in-iis7" target="_blank"&gt;ref1&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/es-ES/library/bb515251(v=vs.90).aspx" target="_blank"&gt;ref2&lt;/a&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10249380" width="1" height="1"&gt;</content><author><name>Raúl Alarcón</name><uri>http://blogs.msdn.com/ralarcon/ProfileUrlRedirect.ashx</uri></author><category term="Integrated Pipeline" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Integrated+Pipeline/" /><category term="Windows Azure" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Windows+Azure/" /><category term="Classic Pipeline" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Classic+Pipeline/" /><category term="Azure" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Azure/" /><category term="IIS" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/IIS/" /></entry><entry><title>Windows Azure y Classic Pipeline</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/ralarcon/archive/2011/11/16/windows-azure-y-classic-pipeline.aspx" /><id>http://blogs.msdn.com/b/ralarcon/archive/2011/11/16/windows-azure-y-classic-pipeline.aspx</id><published>2011-11-16T22:32:39Z</published><updated>2011-11-16T22:32:39Z</updated><content type="html">&lt;p&gt;Por defecto, Windows Azure únicamente puede ejecutar aplicaciones web sobre IIS7.5, o por decirlo de otra manera, aplicaciones que utilizan el pipeline de IIS en modo integrado. &lt;/p&gt;  &lt;p&gt;Aunque mi recomendación personal es actualizar la aplicación para poder ejecutarla utilizando el modo integrado, este post propone una alternativa para poder ejecutar una aplicación que necesite el pipeline en modo clásico, aunque sea como solución a corto plazo. Una buena referencia sobre como migrar aplicaciones de IIS 6.0 a IIS 7.0 está &lt;a href="http://www.google.es/url?sa=t&amp;amp;rct=j&amp;amp;q=iis%207.5%20%20pipeline%20integrated%20mode%20site%3Amicrosoft.com&amp;amp;source=web&amp;amp;cd=4&amp;amp;sqi=2&amp;amp;ved=0CCsQFjAD&amp;amp;url=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fbb515251.aspx&amp;amp;ei=2-DCTp_WO8nQ8gPUi93mCg&amp;amp;usg=AFQjCNFgqLkxA9PRYvCv1cFKKhuuWhLtaA" target="_blank"&gt;disponible aquí&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Para poder ejecutar una aplicación web diseñada para IIS 6.0 en un IIS 7.0 ó 7.5 simplemente tenemos que asegurarnos de que el &lt;em&gt;Application Pool&lt;/em&gt; que utiliza esté configurado con un pipeline en modo clásico. Un equipo con Windows 7 o Windows 2008 R2 y con el .NET Framework 4.0 instalado tendrá los siguientes &lt;em&gt;application pools&lt;/em&gt; por defecto:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-88-84-metablogapi/4478.image_5F00_2.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-88-84-metablogapi/1258.image_5F00_thumb.png" width="548" height="196" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;El error “&lt;a href="http://social.technet.microsoft.com/wiki/contents/articles/2944.aspx" target="_blank"&gt;Request is not available in this context&lt;/a&gt;” es uno de los más comunes que se reciben si una aplicación web desarrollada para utilizar el pipeline en modo clásico se ejecuta en modo integrado:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-88-84-metablogapi/1273.image_5F00_8.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-88-84-metablogapi/0272.image_5F00_thumb_5F00_3.png" width="482" height="239" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Como hemos dicho, para que una aplicación web pueda ejecutarse con un pipeline en modo clásico sólo tenemos que modificar su &lt;em&gt;application pool&lt;/em&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-88-84-metablogapi/3240.image_5F00_6.png"&gt;&lt;img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-88-84-metablogapi/8535.image_5F00_thumb_5F00_2.png" width="326" height="260" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Bien, el problema que se nos presenta en &lt;strong&gt;Windows Azure&lt;/strong&gt; es que, si queremos que nuestro cambio sea persistente y coherente con el modelo de Azure,&amp;#160; no podemos modificar la configuración manualmente ya que en el caso de que nuestro servidor(es) se regenerara, perderíamos dicha configuración.&lt;/p&gt;  &lt;p&gt;La única alternativa que tenemos es utilizar la infraestructura software de Windows Azure, concretamente la clase &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleentrypoint.aspx" target="_blank"&gt;RoleEntryPoint&lt;/a&gt;. Para ello, añadimos una clase en nuestra aplicación web que herede de &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleentrypoint.aspx" target="_blank"&gt;RoleEntryPoint&lt;/a&gt;, después sobre-escribiremos el método “OnStart()” con el siguiente código (esta vez Visual Basic .NET):&lt;/p&gt;  &lt;div style="margin: 20px 0px 10px; padding: 4px; border: 1px solid silver; width: 97.5%; text-align: left; line-height: 12pt; overflow: auto; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; cursor: text; direction: ltr; max-height: 200px; background-color: rgb(244, 244, 244);" id="codeSnippetWrapper"&gt;   &lt;div style="padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);" id="codeSnippet"&gt;     &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Overrides&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Function&lt;/span&gt; OnStart() &lt;span style="color: rgb(0, 0, 255);"&gt;As&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Boolean&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;Dim&lt;/span&gt; srvManager &lt;span style="color: rgb(0, 0, 255);"&gt;As&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;New&lt;/span&gt; ServerManager()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;Try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;Dim&lt;/span&gt; appSite = (From site &lt;span style="color: rgb(0, 0, 255);"&gt;In&lt;/span&gt; srvManager.Sites&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;                      Where site.Name.Contains(RoleEnvironment.CurrentRoleInstance.Role.Name)).FirstOrDefault()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;If&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Not&lt;/span&gt; appSite &lt;span style="color: rgb(0, 0, 255);"&gt;Is&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Nothing&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Then&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;Dim&lt;/span&gt; appPool = (From pool &lt;span style="color: rgb(0, 0, 255);"&gt;In&lt;/span&gt; srvManager.ApplicationPools&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;                      Where pool.Name = appSite.Applications(0).ApplicationPoolName).FirstOrDefault()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;If&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;Not&lt;/span&gt; appPool &lt;span style="color: rgb(0, 0, 255);"&gt;Is&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Nothing&lt;/span&gt;) &lt;span style="color: rgb(0, 0, 255);"&gt;Then&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;                appPool.ManagedPipelineMode = ManagedPipelineMode.Classic&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;                srvManager.CommitChanges()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;End&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;If&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;Else&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;            Trace.WriteLine(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;Unable to get AppSite reference&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;End&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;If&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;Catch&lt;/span&gt; ex &lt;span style="color: rgb(0, 0, 255);"&gt;As&lt;/span&gt; Exception&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;        Trace.WriteLine(&lt;span style="color: rgb(0, 96, 128);"&gt;&amp;quot;Exception: &amp;quot;&lt;/span&gt; + ex.ToString())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;Finally&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;        srvManager.Dispose()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;End&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;End&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: white;"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="margin: 0em; padding: 0px; width: 100%; text-align: left; color: black; line-height: 12pt; overflow: visible; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; direction: ltr; background-color: rgb(244, 244, 244);"&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Este código depende de la librería &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.administration(v=VS.90).aspx" target="_blank"&gt;Microsoft.Web.Administration&lt;/a&gt; por lo que tendrás que añadir la referencia en el proyecto.&lt;/p&gt;

&lt;p&gt;La siguiente vez que ejecutemos la aplicación en un contexto Azure (tanto en el emulador como en un entorno Windows Azure real), el pipeline se configurará automáticamente para utilizar el modo clásico. Si el Web Role se regenera, no hay problema, el método “OnStart()” será invocado de nuevo.&lt;/p&gt;

&lt;p&gt;Por último decir que &lt;strong&gt;este método sólo es válido si la aplicación utiliza .NET Framework 2.0/3.5&lt;/strong&gt;. Para poder ejecutar una aplicación &lt;em&gt;.NET Framework 4.0 en modo clásico &lt;/em&gt;hay que pasar por algún que otro inconveniente más y añadir más configuración (lo sé, no es algo que tenga mucho sentido, lo mejor sería actualizarla, pero hay de todo en la viña del Señor)… pero eso lo veremos en el siguiente post! &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10237897" width="1" height="1"&gt;</content><author><name>Raúl Alarcón</name><uri>http://blogs.msdn.com/ralarcon/ProfileUrlRedirect.ashx</uri></author><category term="Web" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Web/" /><category term="Integrated Pipeline" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Integrated+Pipeline/" /><category term="Windows Azure" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Windows+Azure/" /><category term="Classic Pipeline" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/Classic+Pipeline/" /><category term=".NET" scheme="http://blogs.msdn.com/b/ralarcon/archive/tags/-NET/" /></entry></feed>