Silverlight HackSilverlight & related .NET technologies
https://silverlighthack.com/
http://www.rssboard.org/rss-specificationBlogEngine.NET 2.0.0.44en-GBhttps://silverlighthack.com/opml.axdhttp://www.dotnetblogengine.net/syndication.axdBart CzernickiSilverlight Hack0.0000000.000000Getting started with Visual Studio 11 Developer Preview with ASP.NET MVC4<p>Visual Studio 11 Developer Preview was released a couple weeks ago at the Microsoft BUILD 2011 conference. I have installed it side-by-side with Visual Studio 2010 Ultimate on two workstations and have had no problems. My biggest interest in Visual Studio 11 was the new web development features specifically HTML5 support, ASP.NET MVC 4 and the new Page Inspector (you can run the HTML5 support and ASP.NET MVC4 in Visual Studio 2010 BTW, but the Page Inspector is a real nice productivity boost). If you haven't seen it in action yet, Phil Haack has a great presentation from the BUILD Conference (<a title="Progressively enable the mobile web with ASP.NET MVC 4, HTML5, and jQuery Mobile" href="http://channel9.msdn.com/events/BUILD/BUILD2011/TOOL-803T" target="_blank">Progressively enable the mobile web with ASP.NET MVC 4, HTML5, and jQuery Mobile</a>)</p>
<p>There are some steps needed to get a complete ASP.NET MVC4 development environment up beyond downloading and installing the Visual Studio 2011 Developer Preview MSI.</p>
<p><strong>1) Download and install the Visual Studio 11 Developer Preview</strong></p>
<ul>
<li>You can download it from your MSDN subscription or <a title="Visual Studio 11 Developer Preview Download" href="http://msdn.microsoft.com/en-us/vstudio/hh127353" target="_blank">this download link</a></li>
</ul>
<p><strong>2) Install ASP.NET MVC4 with the Web Platform Installer</strong></p>
<ul>
<li>Web Platform Installer for ASP.NET MVC4 <a href="http://www.microsoft.com/web/gallery/install.aspx?appid=MVC4VS11&prerelease=true" target="_blank">download link</a></li>
<li><strong>Note:</strong> you can also install ASP.NET MVC3 for Visual Studio 11 Developer Preview. Why would you want to do that? ASP.NET MVC4 is HTML5 only and MVC4 is in a preview stage.
<ul>
<li><a href="http://www.microsoft.com/download/en/details.aspx?id=1491" target="_blank">Download link for ASP.NET MVC3 for Visual Studio 11 Developer Preview</a></li>
</ul>
</li>
</ul>
<p><strong>3) Install the Page Inspector via the Web Platform Installer</strong></p>
<ul>
<li><a href="http://go.microsoft.com/fwlink/?LinkID=227946" target="_blank">Download link for the Page Inspector</a></li>
</ul>
<p><strong>Note:</strong> If you get an error trying to to create a new ASP.NET MVC4 project stating that you need to install NuGet. Follow <a href="http://docs.nuget.org/docs/start-here/installing-nuget" target="_blank">these instructions here</a>. NuGet is a dependency for ASP.NET MVC4.</p>
<p>Now you should be on your way to more productive development now in ASP.NET MVC. It always annoyed me that I had to code-> build -> debug/inspect -> repeat..now the Page Inspector provides a nice IDE for manipulating HTML/CSS/Controller Code and get immediate feedback without the whole debug step and waiting for Visual Studio to launch my browser in IIS Express. <a href="http://blogs.msdn.com/b/webdevtools/archive/2011/09/22/page-inspector-for-visual-studio-11-developer-preview.aspx" target="_blank"> Here is a link of a full write-up of the Page Inspector</a> and how to enable it once you are ready to start coding.</p>
https://silverlighthack.com/post/2011/10/01/Getting-started-with-Visual-Studio-11-Developer-Preview-with-ASPNET-MVC4.aspx
[email protected]https://silverlighthack.com/post/2011/10/01/Getting-started-with-Visual-Studio-11-Developer-Preview-with-ASPNET-MVC4.aspx#commenthttps://silverlighthack.com/post.aspx?id=51bf0e96-c963-4b35-b4ee-eb24aea1443eSat, 01 Oct 2011 13:15:00 -0500Bart Czernickihttps://silverlighthack.com/pingback.axdhttps://silverlighthack.com/post.aspx?id=51bf0e96-c963-4b35-b4ee-eb24aea1443e5https://silverlighthack.com/trackback.axd?id=51bf0e96-c963-4b35-b4ee-eb24aea1443ehttps://silverlighthack.com/post/2011/10/01/Getting-started-with-Visual-Studio-11-Developer-Preview-with-ASPNET-MVC4.aspx#commenthttps://silverlighthack.com/syndication.axd?post=51bf0e96-c963-4b35-b4ee-eb24aea1443eOffice 365 - Using Silverlight in SharePoint Online<p><strong>Abstract: </strong><em>One of the core features of Office 365 is "SharePoint Online" essentially it is SharePoint 2010 Server in the "cloud" (it does not include a lot of the SharePoint 2010 Enterprise features). In my Silverlight 4 Business Intelligence book I dedicate a chapter to integrating Silverlight into SharePoint 2010 and I have blogged about it on this site as well. However, in this blog article I want to show how the same Silverlight integration concepts apply to Office 365 - SharePoint Online.</em></p>
<p><strong>Background Info:</strong> <em>Microsoft launched Office 365 June 28th 2011 as a SaaS BPOS (Business Productivity Online Suite) which offers some great features including: SharePoint, Exchange Online, Lync Server and Office Web Apps. These services can are completely online delivered in a SaaS model requiring no local infrastructure (think of it as Microsoft Small Business Server in the cloud).</em></p>
<p>In SharePoint Online you get a basic SharePoint 2010 team site that you can begin adding content. The most basic way to add content is to upload documents, pictures etc. and use the SharePoint Online team site as a document library. Even though SharePoint Online doesn't include all the advanced enterprise SharePoint 2010 Server features, it does have some very powerful integration features such as web parts (which you can develop using <a href="http://channel9.msdn.com/Series/Office-365-Developer-Training-Kit-Labs/Session-2-Part-1-Developing-for-SharePoint-Online-with-Sandbox-Solutions">SharePoint Online Sandbox Solutions</a>).</p>
<p>Web Parts have been the modular components used as building blocks since SharePoint 2003. There are some web parts that are provided out of the box in SharePoint that allow you to add content in them or you can create your own. Creating your own custom web parts even in SharePoint 2010 is not a trivial task (the web part API created in .NET 2.0 has been not updated and creating Ajax-like web parts, that communicate and maintain state is NOT trivial). This is where Silverlight web part integration in SharePoint 2010 really shines. SharePoint 2010 and SharePoint Online both include a Silverlight web part, which allows you to host any Silverlight application (XAP file) inside the team site.</p>
<p>Instructions to add a Silverlight Application (internet URL of a XAP file) to Office 365 SharePoint Online:</p>
<ol>
<li>Log into your SharePoint Team Site
<ul>
<li>You can add a new page or edit the existing one</li>
</ul>
</li>
<li>From the top left menu select <strong>"Site Actions" -> "Edit Page"</strong> <img src="http://bartczernickiblogs.blob.core.windows.net/silverlighthackimages/Office365_EditPage.png" alt="" />
<p> </p>
<ul>
<li>This will put the page in edit mode where you can add aditional content</li>
</ul>
</li>
<li>From the Ribbon menu select <strong>"Insert" -> "More Web Parts"</strong>
<p> </p>
<img src="http://bartczernickiblogs.blob.core.windows.net/silverlighthackimages/Office365_InsertMoreWebParts.png" alt="" />
<p> </p>
<ul>
<li>A dialog will appear listing all the avaiable web parts. <strong>Select the "Silverlight Web Part"</strong></li>
<p> </p>
<img src="http://bartczernickiblogs.blob.core.windows.net/silverlighthackimages/Office365_SilverlightWebPart.png" alt="" />
<p> </p>
<li>Click the "Add" button located on the top right</li>
</ul>
</li>
<li>You should have an empty Silverlight Web Part located on a SharePoint page. Now you need to add a Silverlight application (XAP file) to surface on the Silverlight Web Part.
<ul>
<li>With the web part click the "open the tool pane" link</li>
<li>On right-hand side click the "Configure..." button</li>
<li>Enter a URL location of the Silverlight XAP file (this can be a remote URL or URL of the XAP file within SharePoint Online Document library). Click OK after entering a valid URL
<ul>
<li>I used a XAP file from my web site: http://www.silverlightbusinessintelligence.com/Content/SilverlightXAPs/SilverlightBusinessIntelligenceSite.xap</li>
</ul>
</li>
<li>Apply a specific height and width for the web part (otherwise the configuration pane will not let you proceed)</li>
<p> </p>
<img src="http://bartczernickiblogs.blob.core.windows.net/silverlighthackimages/Office365_Configure.png" alt="" />
<p> </p>
<li>Click Apply and then save the page (save diskette icon on the top left) and the Silverlight Web Part should render your Silverlight Application.</li>
</ul>
</li>
</ol>
<p><strong>What is the big deal with Silverlight and SharePoint Online integration?</strong></p>
<ul>
<li>Silverlight applications you do not have to write custom ASP.NET web parts (which gets complicated real quick mixing Ajax, state, communication, security and deployment). Silverlight applications are much easier to write since you do not have to learn the web part framework or use the <a href="http://channel9.msdn.com/Series/Office-365-Developer-Training-Kit-Labs/Session-2-Part-1-Developing-for-SharePoint-Online-with-Sandbox-Solutions" target="_blank">SharePoint Online Sandbox Solutions</a>.</li>
<li>Existing Silverlight applications just work with minimal "SharePoint or Web Part" coding required.</li>
<li>Silverlight gives you client-side web part communication out of the box. Web part communication is not trivial in custom web parts and even then you get "old school" post backs if you use the provided web part communication model. With Silverlight web parts you can use the messaging API or Javascript HTML bridge to communicate between non-Silverlight web parts.</li>
</ul>
<p>In summary, SharePoint Online is one of the places that Silverlight integration really shines (even over the oncoming HTML5 wave). Existing Silverlight applications can be easily added to a SharePoint Online team site. Furthermore, Silverlight allows the easy creation of new web part components that can be hosted externally and connected to other web services (using SharePoint, OData or other).</p>
https://silverlighthack.com/post/2011/07/19/Office-365-Using-Silverlight-in-the-SharePoint-Team-Site.aspx
[email protected]https://silverlighthack.com/post/2011/07/19/Office-365-Using-Silverlight-in-the-SharePoint-Team-Site.aspx#commenthttps://silverlighthack.com/post.aspx?id=17ba98c3-4d76-4883-bf8b-addf2adcc411Tue, 19 Jul 2011 20:40:00 -0500Bart Czernickihttps://silverlighthack.com/pingback.axdhttps://silverlighthack.com/post.aspx?id=17ba98c3-4d76-4883-bf8b-addf2adcc4113https://silverlighthack.com/trackback.axd?id=17ba98c3-4d76-4883-bf8b-addf2adcc411https://silverlighthack.com/post/2011/07/19/Office-365-Using-Silverlight-in-the-SharePoint-Team-Site.aspx#commenthttps://silverlighthack.com/syndication.axd?post=17ba98c3-4d76-4883-bf8b-addf2adcc411Lower the cost of Azure pricing through Tools, Promotions and Technology Decisions<p><strong>Abstract: In this article I will show some techniques to lower the costs of using the Windows Azure Platform. We will look at three different methods of lowering the cost of Azure: via tools, promotions and technology architecture decisions that can dramatically impact costs of using the Azure cloud platform.</strong></p>
<p><span style="font-size: medium;"><strong>Tools: Azure Platform Pricing Calculator</strong></span></p>
<p>The first step in understanding your costs and how to lower them in Azure is to forecast the costs of the services in Azure. Until recently this was largely a manual effort and an architect or technical business owner would have to sift through pricing grids (<a href="http://www.microsoft.com/windowsazure/offers/popup/popup.aspx?lang=en&locale=en-us&offer=MS-AZR-0003P" target="_blank">like this one</a>) and tally the numbers yourself.</p>
<p>Microsoft has released the <a href="http://www.microsoft.com/windowsazure/pricing-calculator/" target="_blank">Azure Platform Pricing Calculator</a> that allows you to easily select the services you need and determine their costs very easily. This not only allows you to make planning easier, but it also can dramatically lower your costs by showing you cheaper options available (i.e. promotions or smaller instances of Compute). The Azure Platform Pricing Calculator can also show you the different costs associated with architectural options (i.e. having a 100gig SQL Server database is about $1,000/month versus table storage of the same size is $15/month + minimal costs with storage transactions).</p>
<div style="text-align: center;"><img src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/6170.TCOCalculator.png" alt="" /></div>
<div style="text-align: center;"> </div>
<div style="text-align: left;"> </div>
<div style="text-align: left;"><span style="font-size: large;"><strong>Promotions & AzureOffers: Look at All the different Microsoft Azure options</strong></span></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">Microsoft is really pushing Windows Azure. A lot of their core evangelists, program managers and sales teams are pushing the platform to the enterprise. Furthermore, there are a lot of deals to attract business owners, consultants, developer hobbyists as well. <strong>Make sure you shop around for the BEST deal.</strong></div>
<div style="text-align: left;"></div>
<div style="text-align: left;"><strong>Free Trials:</strong></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">These will probably change, but there are several different FREE trials available to try Azure and lower your costs. </div>
<div style="text-align: left;">
<ul>
<li>Microsoft offers a no credit card required 30-day trial of Windows Azure Platform trial here.</li>
<li>Microsoft offers a credit card required offer until September 30th, 2011 FREE trial <a href="http://www.microsoft.com/windowsazure/free-trial/" target="_blank">here</a>.</li>
</ul>
<div><strong>MSDN Subscriptions:</strong></div>
<div> </div>
<div>MSDN Subscribers have the ability to get components and Azure services for FREE at a certain limit for FREE as well. The higher level of your MSDN Subscription, the more is alotted to you (for example a MSDN Ultimate Subscription has 1,500 hours/month of a compute instance available). </div>
<div> </div>
<div><strong>Other Business & Partner Agreements:</strong> </div>
<div> </div>
<div>If you are a large customer from Microsoft, you can obviously negotiate better enterprise pricing for Azure ("<strong><em>You can negotiate?...yes"</em></strong>). However, if you are a small business or a startup you can also participate in either the <a href="https://partner.microsoft.com/40118760" target="_blank">"Cloud Essentials" Microsoft partner program</a> or the <a href="http://www.microsoft.com/bizspark/Azure/Default.aspx" target="_blank">Microsoft BizSpark program</a>, which allows you to take advantage of the Windows Azure platform at lower costs as well.</div>
<div> </div>
<div> </div>
<div>You can compare all of the offers from Microsoft in a nice grid <a href="http://www.microsoft.com/windowsazure/offers/popup/popup.aspx?lang=en&locale=en-us&offer=COMPARE_PUBLIC" target="_blank">here</a>:</div>
<div> </div>
</div>
<div style="text-align: left;"> </div>
<div style="text-align: center;"><a href="http://www.microsoft.com/windowsazure/offers/popup/popup.aspx?lang=en&locale=en-us&offer=COMPARE_PUBLIC" target="_blank"><img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fAzurePricing.png" alt="" /></a></div>
<div style="text-align: center;"> </div>
<div style="text-align: center;"> </div>
<div style="text-align: left;"><span style="font-size: medium;">Technology Architecture Considerations:</span></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;"><strong>SQL Azure Alternatives</strong></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">SQL Azure is EXPENSIVE (especially for very large sites). Even for a small site like mine, which has a read-only SQL Server database...I did not want to pay $10/month ($120/year for a 1 gig database). Here are some alternatives: </div>
<div style="text-align: left;">
<ul>
<li><strong>Use SQL Server CE 4.</strong> It is a new embedded database that can be deployed to the web role in Azure. The nice thing is that you will not have to pay for storage or transactions, because it is part of the web role. The downside is that you will have to be responsible for your own disaster recovery. This would not work great for mission critical or very transactional databases. However, small databases with read-only historical data (i.e. baseball stats), aggregate caching databases (i.e. map reduce business intelligence) or low transaction databases (i.e. a blog) would be great candidates and save you a lot of money.</li>
<li><strong>Combine Data Content Data Sources. </strong>If you have multiple data sources...look for ways to combine them into a single data source. For example, if you have a small blog and a membership of ASP.NET..instead of paying $9.99/month x 2 for two databases...why not combine them into a single database and pay $9.99/month? In those cases, proper naming conventions in SQL will save you and allow you to do this.</li>
<li><strong>Use NOSQL Databases. </strong>Not every single web site needs a relational database behind the scenes. Sites like Google, Facebook or Reddit use NOSQL storage almost exclusively to power their entire platforms. For example, a <a href="http://code.msdn.microsoft.com/Azure-Library-for-83562538" target="_blank">.NET Lucene library port for Azure</a> exists, which uses local caching heavily as well as Azure Blob storage which is significantly cheaper than SQL Azure. Using the Azure infrastructure/SDK you can even run <a href="http://www.captaincodeman.com/2010/05/24/mongodb-azure-clouddrive/" target="_blank">NOSQL databases like MongoDB</a> on Azure as well. Azure Table storage is another "NOSQL like" alternative in the Azure platform that is much cheaper than SQL Azure.</li>
<li><strong>Use cheaper cloud storage databases. </strong>If you are a .NET developer or prefer working with the Microsoft cloud tools nothing is stopping you from using different cloud content alternatives. For example, you can host your database on Amazon EC2 and have the front-end or compute instances deployed to Windows Azure.</li>
<li><strong>Sometimes SQL Azure is not a good choice (costs-wise). </strong>For example, if I have a large data warehouse (50-75 gig), I would strongly reconsider surfacing that content in Azure directly in SQL Server...the costs per month would be astronomical. I would consider a NOSQL database or not move the data warehouse to the cloud.</li>
</ul>
<div> </div>
</div>
<div style="text-align: left;"><strong>Caching</strong></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">I know this might be an obvious one, but remember you are not only paying for storing your content in the cloud...you also pay a very small amount each time someone access it. On a very busy site with lots of images, icons, scripts etc. this can add up very quickly. Having the content pulled from the web compute role will drastically lower the costs of accessing other storage mechanisms such as BLOB or Queue storage.</div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">Two types of caching:</div>
<div style="text-align: left;">
<ul>
<li><strong>Server content caching:</strong> This content is cached on the server, therefore the content does not have to be retrieved from a SQL Azure, BLOB Storage or from another remote location that is not on the local server. For example, caching the same results in memory instead of performing the same SQL Server t-sql query will save costs because you are mitigating the number of transations from the SQL Server to the web server.</li>
<li><strong>Client HTTP Caching: </strong>The core architecture of the web is primarily powered by the HTTP protocol. An HTTP client (i.e. a web browser) can cache certain static content on the local client workstation with the cost of the same roundtrips to the server. For example, a user that frequents gmail.com does not need to download the same Google logo or JavaScripts each time they visit the page to check their email. This saves costs dramatically of the bandwidth from the server. More info can be found <a href="http://hc.apache.org/httpcomponents-client-ga/tutorial/html/caching.html" target="_blank">here</a>.</li>
</ul>
</div>
<div style="text-align: left;"></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;"><strong>Use the Enterprise CDNs for Scripts (i.e. jQuery, Ajax)</strong></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">(I am not talking about the Azure CDN, which is a different topic). Microsoft and Google both provide hosted access to things like jQuery. Instead of having that script downloaded from your Azure web role, the client browser or mobile device downloads it from Microsoft or Google directly. This saves you both transactional and bandwidth costs. Here is a <a href="http://stackoverflow.com/questions/1447184/microsoft-cdn-for-jquery-or-google-cdn" target="_blank">good article describing</a> the pros/cons of both. Putting those scripts on Microsoft's or Google's network will decrecy the network latency of the calls and also allow your pages to load faster (since client browsers can only make a limited amount of requests to the same domain). The main benefits are <a href="http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/" target="_blank">described in this article here</a>.</div>
<div style="text-align: left;"> </div>
<div style="text-align: left;"> </div>
<div style="text-align: left;"><strong>Use the RIGHT VM Sizes</strong></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">Azure includes several different VMs you can use to deploy your web or worker roles. Ensure that you pick the right one for the job. For example, Microsoft positions the "Extra Small" VM as a way to test code and not really meant for production. However, that role is perfectly OK for running a blog, small corporate site, a restaurant site etc with no problems. I am running my <a href="https://silverlighthack.com/admin/Pages/www.silverlightbusinessintelligence.com" target="_blank">www.silverlightbusinessintelligence.com</a> site on the Extra Small instance and it works really well and have no need to pay for a more expensive VM. </div>
<div style="text-align: left;">
<ul>
<li>Note: Remember that the defaults and best practices Microsoft perscribes are not necessarily what is needed for you and there are lower options available. You can always quickly scale higher as you need more horsepower. There are techniques to poll every minute your CPU/Memory utilization to determine if you need a better cloud VM infrastructure.</li>
</ul>
</div>
<div style="text-align: center;"><img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fAzureVMSizes.png" alt="" /></div>
<div> </div>
<div style="text-align: left;"><strong>Multiple Web Sites Per Web Role</strong> </div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">In the Azure 1.3 SDK update, now you can host multiple web sites per single web role. For example, if you have a Medium VM you might be able to put on 3 or 4 different web sites per single web role. This will obviously cut down costs as you are not paying for 4 different VMs just one. The Windows Azure Platform has detailed instructions on how to support this <a href="http://msdn.microsoft.com/en-us/library/gg433110.aspx" target="_blank">here</a>.</div>
<div style="text-align: left;">
<ul>
<li>Note: Architecturally you can also stagger different sites for traffic reasons (according to year/time of day/week etc). For example, if you had an tax website (high traffic beginning of the year) and place that with a web sites for NFL Football (popular towards the end of the year). </li>
</ul>
</div>
<div style="text-align: left;"> </div>
<div style="text-align: left;"><strong>Use IIS 7.x HTTP Compression (dynamic and static content)</strong></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">In Azure, you have a choice to deploy to either an Windows 2008 SP1 or Windows 2008 R2 Server. Both servers use IIS 7.x as the web server, which makes configuring things like static compression or even dynamic compression pretty easy. This will save you a lot of money on larger sites, since most of the web traffic is string based that can be compressed with dramatic ratios.</div>
<div style="text-align: left;">
<ul>
<li><strong>Note:</strong> It appears in either the new Azure SDK or the new VM image, IIS compression is turned on by default for dynamic content. For example, in order to have my web site (<a href="https://silverlighthack.com/admin/Pages/silverlightbusinessintelligence.com" target="_blank">silverlightbusinessintelligence.com</a>) to take advantage of IIS 7.x compression..I did not have to do anything. However, keep in mind that if you take full control of your serialization, media formats or APIs etc. you will have to configure IIS Compression.</li>
</ul>
</div>
<div> </div>
<div><strong><span style="font-size: medium;">Summary</span></strong></div>
<div> </div>
<div>In this article I showed you different tools, promotions and technology architecture choices you can use to lower the costs of using the Azure Cloud. Remember that every service you choose to use from Azure has a cost associated with it. </div>
<div>
<ul>
<li>Plan using the Azure Platform Pricing Calculator</li>
<li>Look at the available promotions and offers.
<ul>
<li>An offer may not include everything, but it can dramatically subsidize the costs of doing business in Azure</li>
</ul>
</li>
<li>Architectural decisions can end up costing you a lot of money </li>
</ul>
</div>
https://silverlighthack.com/post/2011/05/26/Lower-the-cost-of-Azure-pricing-through-Tools-Promotions-and-Technology-Decisions.aspx
[email protected]https://silverlighthack.com/post/2011/05/26/Lower-the-cost-of-Azure-pricing-through-Tools-Promotions-and-Technology-Decisions.aspx#commenthttps://silverlighthack.com/post.aspx?id=9bf4aa8b-e592-41ad-a219-b01fb6c13b0dThu, 26 May 2011 11:13:00 -0500AzureBart Czernickihttps://silverlighthack.com/pingback.axdhttps://silverlighthack.com/post.aspx?id=9bf4aa8b-e592-41ad-a219-b01fb6c13b0d5https://silverlighthack.com/trackback.axd?id=9bf4aa8b-e592-41ad-a219-b01fb6c13b0dhttps://silverlighthack.com/post/2011/05/26/Lower-the-cost-of-Azure-pricing-through-Tools-Promotions-and-Technology-Decisions.aspx#commenthttps://silverlighthack.com/syndication.axd?post=9bf4aa8b-e592-41ad-a219-b01fb6c13b0dAzure Service Deployment Package Inefficiency (Bug) - Content Size Added Twice<p> I spent this past week migrating my companion site for my book <a href="http://www.silverlightbusinessintelligence.com/" target="_blank">www.silverlightbusinessintelligence.com</a> to the Azure cloud (<a href="http://slbusinessintelligence.cloudapp.net/" target="_blank">http://slbusinessintelligence.cloudapp.net/</a>). The site has a lot of demos and source code associated with it, therefore the Azure Service deployment package (cspkg file) was pretty big. </p> <p> <strong><font size="4">Problem:</font></strong> I actually ended up running into the maximum allowed size for an Azure service package, <a href="http://social.msdn.microsoft.com/Forums/en/windowsazuremanagement/thread/65620bdb-3439-4ce0-8f17-561914d325ac" target="_blank">which is 600 megs</a> (which I find odd, since you can easily get around that limitation by adding static content to the web role by remoting in or doing a web deploy afterwards). I deployed to an "Extra Small" instance, which is all I really need to a simple site like this and you get a lot of storage (shown below). The reason Microsoft caps the deployment at 600 megs is that your deploying to the E:\ logical drive, which has only 1 gig of space. However, as you can see there is PLENTY of space on both the d:\ logical drive. I know space is required for the OS, future patches and changes etc. but this limitation struck me as odd. </p> <p> <strong>My three logical drives on the Azure Web Role: </strong> </p> <p> <img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fAzureWebRoleStorage.png" alt="" /> </p> <p> </p> <p> <strong><font size="4">Solution:</font></strong> One of the obvious solutions was the move the three source code zip files (which are over 100 megs) to the Azure blob storage (which costs extra) and server the links from there. I have my static source code zip files on the Azure blob storage for example: <a href="http://bartczernickiblogs.blob.core.windows.net/sourcecode/SilverlightBI_SourceCode_Version1.zip" target="_blank">http://bartczernickiblogs.blob.core.windows.net/sourcecode/SilverlightBI_SourceCode_Version1.zip</a>. </p> <p> The other nice benefit of moving your static content to blob storage (and enabling public read access) is that your content loads faster since it is coming from a different domain in a browser. For example, if you had a lot of images to load on a web site. </p> <p> </p> <p> <font size="4"><strong>Azure Deployment Package Inefficiency: </strong></font>After doing this I thought it was curious that the Azure service package size was so high as I didn't think I had over 600 megs of code, XAP filess or content. Granted my three different versions of the source code are 137 megs in total and the total Azure service package is: <strong>630 megs</strong>. However, after I removed the three source code zip files (figuring it would make the package 137 megs less) <strong>it made the newer package a total of 351 megs almost 279 megs smaller</strong>! So it looks like Azure deployment packaging is adding the content twice!? </p> <p> Digging in....an Azure Service Deployment package (cspkg file) is just a zip file. Inside it you can find the main content file, which is stored inside a file with the csnsx extension. The csnsx file is just another zip file that is encrypted. In order to decrypt it, add the _CSPACK_FORCE_NOENCRYPT_ environment variable and set it to true (follow <a href="http://blogs.msdn.com/b/jnak/archive/2009/04/16/digging-in-to-the-windows-azure-service-package.aspx" target="_blank">this blog</a>post in detail). I decrypted my package and low and behold the entire site is replicated basically twice in two folders <strong>both APPROOT and SITEROOT </strong>(shown below): </p> <p> <strong>AppRoot source code files of the Azure Deployment package: </strong> </p> <p> <img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fAzureAppRoot.png" alt="" /> </p> <p> <strong>SiteRoot source code files of the Azure Deployment package: </strong><img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fAzureSiteRoot.png" alt="" /> </p> <div> </div> <div> There obviously is a technical reason this was done this way, by having the same files duplicated in both APPROOT and SITEROOT folders. However, I look at this as a big optimization opportunity for the next version of the Azure SDK. For example, Microsoft could derive the APPROOT or SITEROOT from each other after it is deployed to the web role (?). In my opinion, if Microsoft is going to limit the Azure deployment package size to 600 megs, static content should not be added twice! </div> <p> My example is not very common, but there are reasons why to make this faster: </p> <ul> <li><strong>Bandwidth costs:</strong> If you count the amount of content uploaded to Azure, having content double package sizes costs the Azure user and Microsoft both money. Also for large packages like this, with the new world of bandwidth caps this costs me money too.</li> <li><strong>Deployment time:</strong> Uploading large packages like this takes time. It almost took 45 minutes from upload to instantiation of the package. Making the packages smaller and more efficient will speed up the deployment process. One of the biggest selling points of <a href="http://appharbor.com/" target="_blank">AppHarbor </a>(which is .NET cloud on Amazon EC2) is how much faster it is to deploy to the cloud....and it is by factors of 10x or more!).</li> </ul> <div> </div>
https://silverlighthack.com/post/2011/05/22/Azure-Deployment-Package-Inefficiency-(Bug)-Content-Size-Added-Twice.aspx
[email protected]https://silverlighthack.com/post/2011/05/22/Azure-Deployment-Package-Inefficiency-(Bug)-Content-Size-Added-Twice.aspx#commenthttps://silverlighthack.com/post.aspx?id=9533a841-4f25-40bb-a78e-a2ac13e5a79aSun, 22 May 2011 13:34:00 -0500AzureBart Czernickihttps://silverlighthack.com/pingback.axdhttps://silverlighthack.com/post.aspx?id=9533a841-4f25-40bb-a78e-a2ac13e5a79a3https://silverlighthack.com/trackback.axd?id=9533a841-4f25-40bb-a78e-a2ac13e5a79ahttps://silverlighthack.com/post/2011/05/22/Azure-Deployment-Package-Inefficiency-(Bug)-Content-Size-Added-Twice.aspx#commenthttps://silverlighthack.com/syndication.axd?post=9533a841-4f25-40bb-a78e-a2ac13e5a79aStep by step instructions to deploy ASP.NET MVC 3 to Windows Azure<p style="text-align: center;"><em style="font-weight: bold;">Abstract: This article will show you the steps to overcome the lack of Visual Studio 2010/Azure SDK tooling to deploy ASP.NET MVC 3 as a web role to the Azure cloud. As of the time this article was written, there are many articles out there that overcomplicate the steps and some are even outdated with the new Azure 1.4 SDK release. This article will allow you to work with the full ASP.NET MVC 3 tooling. This article will be relevant until Microsoft releases an update to the Visual Studio 2010 tooling for Azure (probably not until the Azure 1.5 SDK). The Visual Studio 2010 project/source code is included below.</em></p>
<p style="text-align: left;"><strong><span style="text-decoration: underline;"><em style="font-weight: bold;">10/01/2011 Update:</em></span><em style="font-weight: bold;"> The latest Windows Azure SDK (September 2011 Update) now includes ASP.NET MVC 3 by default. However, if you are interested in including ASP.NET MVC4 in Azure, these steps can be followed below (with some changes).</em></strong></p>
<p>For example, this week a Microsoft employee Avkash Chauhan posted an article called <a href="http://blogs.msdn.com/b/avkashchauhan/archive/2011/05/14/asp-net-mvc3-web-role-deployment-in-windows-azure-sdk-1-4-0-detailed-steps-and-full-sample-code.aspx" target="_blank">"ASP.NET MVC3 Web Role Deployment in Windows Azure (SDK 1.4) - Detailed steps and Full Sample"</a>. While the article is correct and the process outlined will work, it overcomplicates the steps necessary and there are some bugs in his solution (i.e. you do not get the MVC 3 tooling support, since it is a ASP.NET MVC 2 web role).</p>
<p style="text-align: center;"><em><strong>Deploying ASP.NET MVC 3 to Azure 1.4 should not include so many steps.</strong></em></p>
<div style="text-align: center;"><img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fASPMVC3Steps_LongWay.png" alt="" /></div>
<div> </div>
<h2><strong>Steps to Deploy an ASP.NET MVC 3 web role to the Azure Cloud</strong></h2>
<p>The list below are the high level steps that that this article will follow.</p>
<ol>
<li><strong>Create a new ASP.NET MVC 3 project </strong>
<ul>
<li>this can be an Internet or Empty application (or an existing ASP.NET MVC 3 project)</li>
</ul>
</li>
<li><strong>Add a Windows Azure Cloud project</strong></li>
<li><strong>Add the Azure Web Role components to the ASP.NET MVC 3 Project</strong></li>
<li><strong>Add the ASP.NET MVC 3 Assemblies to the bin Folder </strong>
<ul>
<li>Deploying via the new Azure 1.4 start up tasks is another method</li>
</ul>
</li>
<li><strong>Publish to Windows Azure</strong></li>
</ol>
<div><strong>Note:</strong> You will need to have some experience with Windows Azure, since I do not cover publishing to the Azure cloud (creating certificates, management console, remote desktop etc.). You will also need:</div>
<div>
<ul>
<li>Visual Studio 2010 SP1</li>
<li>ASP.NET MVC 3 with tools update (Released in May 2011:<a href="https://silverlighthack.com/admin/Pages/" target="_blank"> </a><a href="http://www.asp.net/mvc">http://www.asp.net/mvc</a>)
<ul>
<li>NuGet Package Manager</li>
</ul>
</li>
<li>Azure 1.4 SDK installed</li>
<li>Active Windows Azure hosted service account (there is a promotion going on to receive Windows Azure for FREE until September 30th 2011, much better than the FREE 30 day trial if you just want to test things out or run a small blog: <a href="http://www.microsoft.com/windowsazure/free-trial/" target="_blank">http://www.microsoft.com/windowsazure/free-trial/</a>) </li>
</ul>
</div>
<h2>1) Create a new ASP.NET MVC 3 Project</h2>
<div><ol>
<li>Open Visual Studio 2010 (as an Administrator)
<ul>
<li>The Azure Cloud emulator needs to run in elevated privaledges</li>
</ul>
</li>
<li>Inside Visual Studio 2010, go to File -> New Project
<ul>
<li>Select "ASP.NET MVC 3 Web Application"</li>
<li>I named the project "AspNetMVC3DeployToAzure" *you can call it whatever you like)</li>
<li>Select "Internet Application" from the next dialog windo
<ul>
<li>Note that we will not be deploying the ASP.NET membership provider to SQL Azure (that will be for another time)</li>
<li>Just as long as you do not click Log On the application will function correctly</li>
</ul>
</li>
</ul>
</li>
<li>If you build the application and debug it, you should see the generic ASP.NET MVC 3 startup screen</li>
</ol></div>
<div> </div>
<div> </div>
<h2>2) Add a Windows Azure Cloud Project</h2>
<ol>
<li>In the Visual Studio 2010 Solution Explorer, right-click on the AspNetMvc4DeployToAzure solution and select Add -> New Project... <img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fAddAzureCloudProject.png" alt="" /></li>
<li>In the New Project Dialog,
<ul>
<li>select "Cloud" from the Installed Templates</li>
<li>select the "Windows Azure Project"</li>
<li>I named the project "WindowsAzureAspNetMvc3Deploy" (you can name it whatever you prefer)<img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fWindowsAzureCloudProject.png" alt="" /><span style="white-space: pre;"> </span></li>
</ul>
</li>
<li>In the next dialog, do NOT select any Windows Azure roles. Leave it empy and click OK.</li>
</ol>
<h2> </h2>
<h2><strong>3) Add the Azure Web Role components to the ASP.NET MVC 3 Project</strong></h2>
<ol>
<li>In the Solution Explorer, highlight the ASP.NET MVC 3 project by clicking on it (this will tell Visual Studio the context you are in(</li>
<li>In Visual Studio 2010 (this step will only work if the ASP.NET MVC 3 project is highlighted) go to Tools -> "Library Package Manager" -> "Add Library Package Reference..."</li>
<li>Click "Online" to search the available packages Online</li>
<li>Type in "windowsazure" all one word NO spaces</li>
<li>Select the WindowsAzure.WebRole package and click Install. Close the dialog after you are done (VS 2010 will ask you to reload the project...click OK) The following changes will be made to the ASP.NET MVC 3 Project:
<ul>
<li>The package will add the necesary Windows Azure SDK 1.4 assemblies</li>
<li>The package will make changes necessary in the web.config for Windows Azure</li>
<li>The package will add a class that facilitates the new Azure SDK 1.4 change for performign a task when the role is deployed<img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fWindowsAzure_WebRole.png" alt="" /><span style="white-space: pre;"> </span></li>
</ul>
</li>
<li>In the Solution Explorer, right-click on the Roles folder of the Windows Azure project. (this will tell our Windows Azure cloud project that we want to associate to the ASP.NET MVC 3 web role)
<ul>
<li>Select Add -> "Web Role Project in Solution..."
<ul>
<li>In the previous step, we ran the NuGet package that "converted" our traditional ASP.NET MVC 3 application to a web role by adding all the necessary assemblies. Therefore, this step is telling Azure that we want to add an existing Web Role from our current solution.<img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fAzureAddWebRole.png" alt="" /></li>
</ul>
</li>
</ul>
</li>
<li>In the "Associate with Web Role" dialog, click OK (as we only have one available project)<img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fAssociateWithWebRole.png" alt="" /></li>
<li>Your solution should now look like the screen shot below.
<ul>
<li>Note that we have additional Azure assemblies referenced in the ASP.NET MVC 3 project, we have a new class WebRole.cs, the web.config has Azure elements in it and inside the Azure cloud project we have a new web role added</li>
</ul>
</li>
</ol>
<div style="text-align: center;">.<img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fAzureWithMVC3.png" alt="" /></div>
<div style="text-align: center;">
<ul>
<li style="text-align: left;">You can now buiild and debug the solution. If you did everything properly, this will launch the Windows Azure emulator and run the application.</li>
</ul>
<div style="text-align: left;">
<h2>4) Add the ASP.NET MVC 3 assemblies to the bin folder</h2>
<p><strong>Note:</strong> the emulator is just an emulator, so it is still utilizing resources on your workstation (i.e. ASP.NET MVC 3, Web Matrix assemblies). In a real Azure Virtual Machine, you will ONLY have the basic .NET 4.0 assemblies (Microsoft only keeps the VMs to a bare minimum). Therefore, we need to add those assemblies as part of the deployment into Azure VM. </p>
<p><strong>Note: </strong>An alternative approach is to utilize the ASP.NET MVC 3 installer as a Azure start up task (each time the VM is restarted or re-provisioned in case of an error or recovery process) or manually set each assembly to "Copy Local" to True.</p>
<p> </p>
<ol>
<li>In the ASP.NET MVC 3 Tools Update Microsoft provides a very easy way to add all the required ASP.NET MVC 3 assemblies automatically for bin deployment. <strong>(thanks to Mike Brown from <a href="http://azurecoding.net/" target="_blank">http://azurecoding.net/</a> for pointing this out).</strong></li>
<li>Right-click on the ASPNetMvc3DeployToAzure MVC 3 project and select "Add Deployable Dependencies..."</li>
<div style="text-align: center;"><img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fAspNetMvc3AddDeployableDependencies.png" alt="" /></div>
<li>Select ASP.NET MVC checkbox and click OK
<ul>
<img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fAspNetAddDeployableDependenciesCheckBox.png" alt="" />
</ul>
<ul>
<li>This will add the necessary ASP.NET MVC 3 dependency assemblies.</li>
</ul>
</li>
<li>You Solution Explorer in Visual Studio should look like this after adding the ASP.NET MVC 3 Dependency assemblies.
<ul>
</ul>
</li>
<li style="text-align: left;">:<img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fAspNetMvc3DependenciesAdded.png" alt="" /></li>
</ol>
<div> </div>
<h2>5) Publish to Windows Azure</h2>
<p> </p>
<ol>
<li>Now you are ready to publish to Windows Azure. Right-click on the Windows Azure project and select Publish. Select your Azure credentials and storage information.</li>
</ol></div>
<div style="text-align: center;"><img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fPublishToAzure.png" alt="" /></div>
<div style="text-align: left;">
<ul>
<li>Note: If you do not have the Azure hosted service, storage or credentials set up you will have to create it. Step by step instructions can be found <a href="http://msdn.microsoft.com/en-us/library/ff683672.aspx" target="_blank">here</a> (Microsoft has better instructions than I will write on this)
<ul>
<li>I highly recommed you also select the "Enable Intellitrace for .NET 4 Roles". This will show you any errors that you get if you don't have the proper ASP.NET MVC 3 assemblies installed. Here is a good article on how you can view the IntelliTrace logs: <a href="http://www.nickharris.net/2010/09/how-to-enable-intellitrace-on-windows-azure/" target="_blank">http://www.nickharris.net/2010/09/how-to-enable-intellitrace-on-windows-azure/</a>. For exampe, if you forget to enable "Copy Local" to true for the System.Web.Mvc.dll the Azure publish process will cycle and you will not know why.</li>
</ul>
</li>
<li>If you forget a certain assembly, you will also get an error like this (if you turn off custom errors in the web.config)<img src="https://silverlighthack.com/image.axd?picture=2011%2f5%2fDeployErrorAzure.png" alt="" /></li>
</ul>
<div>
<div style="text-align: left;"> </div>
<h2><strong>Visual Studio 2010 Source Code For Project</strong></h2>
<div style="text-align: left;"> </div>
<div style="text-align: left;">This source code for this project includes some minor changes unrelated to the steps above:</div>
<p><a href="https://silverlighthack.com/file.axd?file=2011%2f5%2fAspNetMVC3DeployToAzure.zip">AspNetMVC3DeployToAzure.zip (13.85 mb)</a></p>
<div style="text-align: left;">
<ul>
<li>in the web.config I turned custom errors off, so you can see the errors if you receive any in deploying</li>
<li>I changed the Windows Azure instance to be "Extra Small", this way you get charged less playing with this and it is covered under the FREE Windows Azure trial</li>
<li>I changed the OS family to 2 in the Windows Azure configuration, so that we receive a Windows Server 2008 R2 VM...not sure why that is not the default (?)<strong> </strong></li>
</ul>
</div>
<div> </div>
<div> </div>
<div style="text-align: left;"><strong>Summary </strong></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">In this article, I hope you learned how to deploy an ASP.NET MVC 3 application to the Azure cloud easily. The key things to remember are:</div>
<div style="text-align: left;">
<ul>
<li>using the WindowsAzure.WebRole NuGet package to convert your ASP.NET MVC 3 application to a web role</li>
<li>Associating the ASP.NET MVC 3 project with the Windows Azure Cloud project</li>
<li>Using the new "Add Deployment Dependencies.." feature in the ASP.NET MVC 3 Tools Update to deploy all the required ASP.NET MVC 3 assemblies</li>
</ul>
<div>In the future, Microsoft will no doubt make this process easier and include ASP.NET MVC 3 tooling for Azure deployment.</div>
<div> </div>
<div> </div>
</div>
</div>
</div>
</div>
https://silverlighthack.com/post/2011/05/15/Step-by-step-instructions-to-deploy-ASPNET-MVC-3-to-Windows-Azure.aspx
[email protected]https://silverlighthack.com/post/2011/05/15/Step-by-step-instructions-to-deploy-ASPNET-MVC-3-to-Windows-Azure.aspx#commenthttps://silverlighthack.com/post.aspx?id=f86097bb-09ed-4345-a693-4b985f848a86Sun, 15 May 2011 09:06:00 -0500ASP.NET MVCASP.NET MVCAzureAzureBart Czernickihttps://silverlighthack.com/pingback.axdhttps://silverlighthack.com/post.aspx?id=f86097bb-09ed-4345-a693-4b985f848a8612https://silverlighthack.com/trackback.axd?id=f86097bb-09ed-4345-a693-4b985f848a86https://silverlighthack.com/post/2011/05/15/Step-by-step-instructions-to-deploy-ASPNET-MVC-3-to-Windows-Azure.aspx#commenthttps://silverlighthack.com/syndication.axd?post=f86097bb-09ed-4345-a693-4b985f848a86Five Things that HTML5 Video Currently will not do, but Silverlight or Flash will<p><strong><em>Abstract: This article will cover 5 pieces of functionality that are not built-in currently into the HTML5 video specification that Silverlight and Flash can solve. This article covers potential workarounds and how HTML5 will handle these limitations in the future. Note a great deal of conent of this article comes from <a href="http://about.me/nigelparker" target="_blank">Nigel Parker's</a> talk at MIX 2011 <a href="http://channel9.msdn.com/events/MIX/MIX11/HTM12" target="_blank">"Things You Need To Know To Start Using <video> and <audio> Today"</a>.</em></strong></p>
<p><strong>Note:</strong> this post is meant to be informational about HTML5 video compared to Silverlight/Flash. Even if you don't like Silverlight or Flash, I hope you learn something by reading sme of the current limiations of HTML5 video. For more info check out <a href="http://blogs.flashsupport.com/robert/?p=182" target="_blank">Robert Reinhardt's article (<Hype>Flash video is coming to iPad.</Hype><Reality>Yet another streaming solution will be available for H.264 to iOS.</Reality>)</a> that covers the topic from another perspective.</p>
<p><span style="text-decoration: underline;"><strong>Update 10/01/2011:</strong></span> Updated some information below, however the content in this article is still current.</p>
<p><strong>1) Digital Rights Management (DRM) - Cannot protect video content over HTML5</strong></p>
<p>The HTML5 does not and will not ever include Digital Rights Management. One of the owners of the the HTML5 draft is quoted as saying: "If we provided DRM in the HTML5 draft, it would be hacked in 2 days". Therefore, content that includes sports, Hollywood movies, tv shows etc. will never be provided over HTML5 video legally. This can be confusing for some people, because you hear many people post blogs or tweets "Youtube is going full HTML5". This is partly true. User content on Youtube will be HTML5, but you will never see copyright music videos or movies on Youtube surfaced over HTML5 containers or codecs. </p>
<p>Workaround: None (use Silverlight or Flash)</p>
<p>Probability of being included in future HTML5 draft: None</p>
<p><strong>2) No Smooth Streaming or Adaptive Streaming</strong></p>
<p>The HTML5 draft/spec does not include conventions for smooth streaming/adaptive streaming. Silverlight with IIS 7.x Smooth Streaming extensions can provide this for you. There do exist third-party solutions for HTML5 adaptive streaming. For example, Apple's HTTP Live Streaming (HLS). However, this is not part of the current HTML5 draft/spec.</p>
<p>There is work currently being done to take an adaptive streaming recommendation to the HTML5 council for approval. The data visualization below (<a href="http://www.w3.org/2010/11/web-and-tv/slides/microsoft-john-simmons.pdf" target="_blank">taken from w3.org </a>) shows this in better detail:</p>
<div style="text-align: center;"><img src="https://silverlighthack.com/image.axd?picture=2011%2f4%2fW3CVideo.png" alt="" /></div>
<div> </div>
<p>Workaround: Use Silverlight, Adobe Flash or Apple's native solutions</p>
<div>Probability of being included in future HTML5 draft: Very High</div>
<div> </div>
<div><strong>3) No Standard Video Codecs for HTML5</strong></div>
<div> </div>
<div>The HTML5 draft/spec does not include an explicit definition of what codec should be used for surfacing HTML5 videos. This has been a contraversial decision that has led to developers of browsers to determine which codecs they allow to play on their browser. The main contraversy surrounds the use of a proerietary codec (H.264), which both Apple and Microsoft support. Conversely, the Mozilla, Opera and Google browsers have rallied around an open-source encoder called WebM and Ogg. Neil Parker's slide from his MIX 2011 talk shows a great breakdown of the codec support in current browsers: </div>
<div> </div>
<div style="text-align: center;"><img src="https://silverlighthack.com/image.axd?picture=2011%2f4%2fBrowserEncoder.png" alt="" /></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">Workaround: In the HTML5 markup, you can provide multiple different encoding sources and resolutions targeting mobile or desktop/laptop clients. Furthermore, you can also fallback to Silverlight or Flash if the browser is not HTML5 compliant. It is up to the developer to provide all these fallback scenarios. This is equivelant to providing different CSS or JavaScript depending on browser support.</div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">Probability of being included in future HTML5 draft: Very Low (the HTML5 spec would have to change their decision and prescribe a default codec for all HTML5 video tags)</div>
<div style="text-align: left;"> </div>
<div style="text-align: left;"><strong>4) Full Screen Support</strong> </div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">HTML5 currently does not support full screen video. (Update 10/01/2011) For an example, check out a <a href="http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-816T" target="_blank">video</a> from the Microsoft BUILD Conference. While viewing the video in HTML5 format, you cannot view it in fullscreen (in Silverlight you can). To me it is kind of a big deal especially when you are looking at source code on a partial screen.</div>
<div style="text-align: left;"></div>
<div style="text-align: left;">This is not a technology problem or not possible to implement in browsers, however the current debate of full screen HTML5 video centers around what keyboard functions are available and what happens when you exit full screen mode. The main reason for this is security:</div>
<div style="text-align: left;"> </div>
<div style="text-align: center;"><em>"User agents should not provide a public API to cause videos to be shown full-screen. A script, combined with a carefully crafted video file, could trick the user into thinking a system-modal dialog had been shown, and prompt the user for a password. There is also the danger of "mere" annoyance, with pages launching full-screen videos when links are clicked or pages navigated. Instead, user-agent specific interface features may be provided to easily allow the user to obtain a full-screen playback mode." </em></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">Note: Silverlight 4 and Adobe Flash 10.2 allow a user with dual monitors to play a video in full screen HD while the other monitor remains responsive to full user input. It will be interesting how HTML5 browsers solve this, as this could be a potential security problem (since everything to manipulate in HTML5 is done via JavaScript libraries). Example <a href="http://www.silverlight.net/learn/videos/all/fullscreen-window-pinning/" target="_blank">here </a>of Silverlight 4 dual monitor pinning. </div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">Workaround: Use the VideoFullScreen.js provided by Martin Rauscher: <a href="http://my.opera.com/Hades32/blog/2010/05/20/you-want-fullscreen-with-html5-opera-you-get-it" target="_blank">here</a></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">Probability of being included in future HTML5 draft: High (HTML5 draft spec needs to explicitly define how browers interact with full screen. For example, initially Silverlight 3 allowed full screen video but limited the keyboard functionality for the same security reasons as mentioned above).</div>
<div style="text-align: left;"> </div>
<div style="text-align: left;"><strong>5) No Standard Conventions/Look and Feel</strong></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">One of the nice thing about plug-ins like Silverlight or Flash is that you essentially publish your video and let Microsoft or Adobe handle all the compatibility implementations across browsers or operating systems. For HTML5 video tags it is up to the browsers to implement this themselves. For example, Neil Parker had a great slide that showed an HTML5 video with a rounded corner border applied. These are the results: </div>
<div style="text-align: left;"> </div>
<div style="text-align: left;"> </div>
<div style="text-align: center;"><img src="https://silverlighthack.com/image.axd?picture=2011%2f4%2fHTML5VideoCSS.png" alt="" /></div>
<div style="text-align: center;"> </div>
<div style="text-align: left;">This also includes the standard controls that are rendered with each video by different browsers.</div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">Workaround: You can create a custom HTML5 video player control or use one of the third party ones. Some are open source and some you can purchase.</div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">Probability of being included in future HTML5 draft: Some of this already is. It is up to the browser developers to fix their CSS and HTML5 video implementations (or use HTML polyfill patterns). However, the HTML5 spec is not going to perscribe the very detailed looked of the progress bar of the video control (Note: in Silverlight and Flash you get a consistant look and feel across the browsers since Microsoft and Adobe control this; although you can create your own custom video players as well).</div>
<div style="text-align: left;"> </div>
<div style="text-align: left;"><strong>Summary </strong></div>
<div style="text-align: left;"> </div>
<div style="text-align: left;">In summary, the current HTML5 specification and implementations for video have some gaps. It is important to note the current limitations of HTML5 video, especially with DRM. A naive web developer wil be surprised to know that they can't just put a video tag with an encoded video and have it work as expected across all browsers just like Flash/Silverlight do. There are some workarounds & solution available to provide Flash-like video. However, the naive approach that HTML5 solves everything about video for you because its "new" or "better" will quickly get you in trouble.</div>
<div style="text-align: left;"> </div>
https://silverlighthack.com/post/2011/04/16/Five-Things-that-HTML5-Video-Currently-will-not-do-but-Silverlight-and-Flash-will.aspx
[email protected]https://silverlighthack.com/post/2011/04/16/Five-Things-that-HTML5-Video-Currently-will-not-do-but-Silverlight-and-Flash-will.aspx#commenthttps://silverlighthack.com/post.aspx?id=3b9f5a06-12a6-4bcc-9f44-ffb139288f09Sat, 16 Apr 2011 13:05:00 -0500HTML 5HTML5SilverlightBart Czernickihttps://silverlighthack.com/pingback.axdhttps://silverlighthack.com/post.aspx?id=3b9f5a06-12a6-4bcc-9f44-ffb139288f0913https://silverlighthack.com/trackback.axd?id=3b9f5a06-12a6-4bcc-9f44-ffb139288f09https://silverlighthack.com/post/2011/04/16/Five-Things-that-HTML5-Video-Currently-will-not-do-but-Silverlight-and-Flash-will.aspx#commenthttps://silverlighthack.com/syndication.axd?post=3b9f5a06-12a6-4bcc-9f44-ffb139288f09ASP.NET MVC 3 Intranet Template with "This resource cannot be found" and User.Identity.Name is blank Error<p> ASP.NET MVC 3 Tools refresh recently was released and it includes a new Intranet Visual Studio project template. This template is basically an ASP.NET MVC 3 template with Windows Authentication enabled (the Internet Application template uses forms based authentication). </p> <img src="https://silverlighthack.com/image.axd?picture=2011%2f4%2fASPNETMVC_Intranet.png" alt="" /> <div> </div> <div> I was recently playing with this template and it worked fine in development and even using the IIS 7.x Express Web Server. However, when I deployed to a real Windows Server 2008 R2 application I saw this "The resource cannot be found" error: </div> <div> </div> <img src="https://silverlighthack.com/image.axd?picture=2011%2f4%2fResourceCannotBeFound.png" alt="" /> <div> </div> <div> So what is going on? Notice (from the screenshot above) that we are being redirected to .../Account/Login. This is a clue that the login/authentication is failing. The controller for login is throwing the error. </div> <div> </div> <div> If you explicitly actually type in /Home/About you will actually get a rendered page below. Notice in the top right corner all you see is an exclamation point. The @User.Identity.Name code in the _Layout.cshtml is blank/NULL and causing the error (shown below that is why you only see "Welcome !"). </div> <div> </div> <img src="https://silverlighthack.com/image.axd?picture=2011%2f4%2fWelcomeSave.png" alt="" /> <div> </div> <div> Why is Windows Authentication not working? It looks to me that this is a bug in the ASP.NET MVC 3 Intranet template....I stumbled upon this by chance, by going through the "known issues" section in the <a href="http://www.asp.net/learn/whitepapers/mvc3-release-notes" target="_blank">ASP.NET MVC 3 release note</a>s. It mentions that we should add this line (<add key="enableSimpleMembership" value="false" />) to the web.config if we are upgrading from an ASP.NET MVC 2 application. <strong>This has <u>NOTHING </u>to do BTW with Windows Authentication and I tried adding that key in web.config by chance and it properly authenticated me.</strong> </div> <div> </div> <div> After adding the key (and restarting the application pool), ASP.NET MVC 3 properly is able to grab the identity of the user via Windows Authentication. Basically the appsettings section of the web.config should look like this now: </div> <div> <appSettings> </div> <div> <add key="webpages:Version" value="1.0.0.0" /> </div> <div> <add key="ClientValidationEnabled" value="true" /> </div> <div> <add key="UnobtrusiveJavaScriptEnabled" value="true" /> </div> <div> <strong><add key="enableSimpleMembership" value="false" /></strong> </div> <div> </appSettings> </div> <div> </div> <div> If you receive a "This Resource Cannot be Found" error or the User.Identity.Name is blank or IsAuthenticated is false for an ASP.NET MVC application ensure: </div> <div> <ul> <li>Windows Authentication is turned on in web.config (IIS 6 and 7)</li> <li>You are using the Integrated pipeline mode in the application pool (IIS 6 and 7)</li> <li>All the wildcard mappings and ISAPI settings are properly set up (IIS 6)</li> <li>Add the key: <add key="enableSimpleMembership" value="false" /> to the appSettings section</li> <li>If you have Kerebos/NTLM etc authentication, make sure it is configured correctly in IIS</li> </ul> <div> I hope this article helped anyone who is going through this annoying issue, as I spent several hours trying to figure it out myself. It seems like Microsoft needs to update their ASP.NET MVC 3 Intranet template to include this line for production scenarios. </div> </div>
https://silverlighthack.com/post/2011/04/13/ASPNET-MVC-3-Intranet-Template-with-This-resource-cannot-be-found-and-UserIdentityName-is-blank-Error.aspx
[email protected]https://silverlighthack.com/post/2011/04/13/ASPNET-MVC-3-Intranet-Template-with-This-resource-cannot-be-found-and-UserIdentityName-is-blank-Error.aspx#commenthttps://silverlighthack.com/post.aspx?id=56f877bc-511c-45b5-b158-43151bf967ebWed, 13 Apr 2011 16:38:00 -0500.netASP.NET MVCBart Czernickihttps://silverlighthack.com/pingback.axdhttps://silverlighthack.com/post.aspx?id=56f877bc-511c-45b5-b158-43151bf967eb0https://silverlighthack.com/trackback.axd?id=56f877bc-511c-45b5-b158-43151bf967ebhttps://silverlighthack.com/post/2011/04/13/ASPNET-MVC-3-Intranet-Template-with-This-resource-cannot-be-found-and-UserIdentityName-is-blank-Error.aspx#commenthttps://silverlighthack.com/syndication.axd?post=56f877bc-511c-45b5-b158-43151bf967ebIaaS, PaaS and SaaS Terms Clearly Explained and Defined<p style="text-align: left">I love it when semi-abstract terms and sometimes confusing technologies have an easy way to describe them in a terse/quick manner. I found a great explanation from the <strong><em>"Windows Azure Platform: Cloud Development Jump Start</em></strong>" series in the first video (the video series is available both on iTunes and Zune and it covers the latest 1.3.x version of the SDK). The series is provided free of charge. Below are a couple of slides from the presentation:</p><p style="text-align: center"><strong>Easy to Understand one-word descriptions of each term (i.e. IaaS means host)</strong> </p><div style="text-align: center"><img src="https://silverlighthack.com/image.axd?picture=2011%2f2%2fCloudServiceTerms.png" alt="" /></div><div> </div><div> </div><div style="text-align: center"><strong>Data Visualization of Vendor Management Responsibility of Services</strong><img src="https://silverlighthack.com/image.axd?picture=2011%2f2%2fCloudServiceHierarchy.png" alt="" /></div><div style="text-align: center"> </div><div style="text-align: left">I really like the last slide, because it clearly breaks down hierarchy of software layers into what is each vendor service (IaaS, PaaS and SaaS) is responsible for and what you are responsible for. Also in the video one of the speakers (Manu Cohen-Yashar) breaks each service down by the "unit you are gaining" from the service:</div><div style="text-align: left"><ul> <li><strong>IaaS </strong>- the unit you are gaining is a computer/server. Therefore IaaS is essentially a "physical server box". An example of this would be going to RackSpace or SoftLayer and leasing a physical box from them. The vendor manages the networking, hard drives (if they fail), hardware of the box, virtualization O/S (if the box is virtualized). You can remote desktop to the box and you manage everything else (shown in the screenshot above). Windows Azure provides IaaS in the form the VM Role (you upload a Windows Server 2008 R2 image and manage the server yourself).</li> <li><strong>PaaS </strong>- the unit you are gaining is an application/framework. Therefore PaaS is a "hosted application/framework/tools that you can leverage to build something on. That application is configured on IIS/SQL Server etc and runs on a hardware/virtual system that the vendor manages. An example of PaaS would be Windows Azure (excluding the VM Role) services like web role, worker role, Reporting Services etc.</li> <li><strong>SaaS </strong>- the unit you are gaining is business functionality. For example, Gmail is a type of a SaaS mail provider because you don't have to manage any service yourself and its all done by the vendor (Google in this example).</li></ul><div>I really like the clear examples and distinct definitions that are made in the videos. Hopefully, you can use these examples in explaining this to your boss or a non-technical person. I highly recommend you check out the <strong><em>"Windows Azure Platform: Cloud Development Jump Start</em></strong>" series if you are interested on learning about Azure or gain general information on the cloud. </div></div>
https://silverlighthack.com/post/2011/02/27/IaaS-PaaS-and-SaaS-Terms-Explained-and-Defined.aspx
[email protected]https://silverlighthack.com/post/2011/02/27/IaaS-PaaS-and-SaaS-Terms-Explained-and-Defined.aspx#commenthttps://silverlighthack.com/post.aspx?id=f664d1c9-8fdc-408d-a54e-1a8befe02fbeSun, 27 Feb 2011 13:23:00 -0500AzureBart Czernickihttps://silverlighthack.com/pingback.axdhttps://silverlighthack.com/post.aspx?id=f664d1c9-8fdc-408d-a54e-1a8befe02fbe8https://silverlighthack.com/trackback.axd?id=f664d1c9-8fdc-408d-a54e-1a8befe02fbehttps://silverlighthack.com/post/2011/02/27/IaaS-PaaS-and-SaaS-Terms-Explained-and-Defined.aspx#commenthttps://silverlighthack.com/syndication.axd?post=f664d1c9-8fdc-408d-a54e-1a8befe02fbeMaximizing your Silverlight LOB investment with Web Parts<p style="text-align: left"><strong><em>Astract: This article will show you how you can take advantage of the Silverlight architecture for easy deployment to web parts and easy client communication (intra web parts). This article will amplify why Silverlight is still the technology of choice if you want to create modular functionality deployed as web parts into custom or SharePoint portals.</em></strong></p><p>A few months ago Microsoft made the announcement that they are "repurposing" Silverlight from a general web technology in favor of HTML5. They have backtracked a bit from this statement and have made statements like Silverlight has some "sweet spots" in line of business (LOB) applications. Microsoft does a very poor job of defining these sweet spots and what they are.</p><p>Silverlight being a web browser plug-in offers some really nice deployment and integration capabilities; one of them being SharePoint and web parts. This allows you to deploy Silverlight applications to existing custom portals, SharePoint 2003-2010 servers or other web part architectured sites <u>with little/no additional code</u>. In my opinion this makes the Silverlight architecture very attrictive for intranet line of business applications.</p><p><em>Note: Additional details on this topic is provided in my new book <a href="http://www.amazon.com/gp/product/1430230606/ref=s9_simh_gw_p14_d0_i1?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=1BQNPVJC1CKVGK9VGN2H&pf_rd_t=101&pf_rd_p=470938631&pf_rd_i=507846" target="_blank">"Silverlight 4 Business Intelligence"</a>, where I dedicate an entire chapter to Silverlight web parts. In the book you will see step by step instructions and code samples for the scenarios outlined below.</em></p><p> </p><p><strong><font size="5">Silverlight as a Portable Web Part Module</font></strong></p><p>Silverlight applications (XAP files) can be easily made into web part by simply surrounding the Silverlight application with a "web part wrapper". This technique can be implemented via a ASP.NET Web Part interface, SharePoint 2003/2007 web part interface (deprecated) or the new SharePoint 2010 Silverlight Web Part.</p><p style="text-align: center"><em>Hosting Silverlight in web parts is as simple as "rendering" the XAP package inside the web part. </em><img src="https://silverlighthack.com/image.axd?picture=2011%2f1%2f30606f1302_forblog.png" alt="" /></p><p style="text-align: left">Lets take a look an example of how to host an existing Silverlight application in a SharePoint 2010 portal using the new Silverlight web part. SharePoint 2010 includes a new "Silverlight Web Part" which does exactly this.</p><p style="text-align: center"><em>SharePoint 2010 includes the "Silverlight Web Part" in the "Media and Content" section.</em><img src="https://silverlighthack.com/image.axd?picture=2011%2f1%2f30606f1303_forblog.png" alt="" /></p><p style="text-align: left">As long as the SharePoint 2010 server can access the URL location of the XAP file, you host the Silverlight application as a web part. This means that SharePoint can host Silverlight content as a web part from a:</p><ul> <li>Remote Silverlight XAP file located on the internet</li> <li>Document/SharePoint list URL location of the XAP file inside SharePoint</li> <li>Another internet/intranet portal that is hosting the Silverlight application</li></ul><div style="text-align: center"><em>SharePoint 2010 Silverlight Web Part requires just the Silverlight XAP file URL to render Silverlight content.</em><img src="https://silverlighthack.com/image.axd?picture=2011%2f1%2f30606f1304_forblog.png" alt="" /></div><div style="text-align: center"> </div><div style="text-align: left">The SharePoint 2010 Silverlight Web Part also includes an additional parameter for initialization parameters passed into the Silverlight application before the content is rendered. This is a nice feature; for example, if you want to let the Silverlight application know that it is being rendered in SharePoint to pull data from ShrePoint lists instead of portal services.</div><div style="text-align: left"> </div><div style="text-align: left">What if you want to create a Silverlight web part for SharePoint 2003/2007 or for an ASP.NET portal? What if you want advanced features like web part communication configuration connections? In those situations you will need to create a <a href="http://blogs.msdn.com/b/andreww/archive/2009/03/12/silverlight-web-part-in-sharepoint.aspx" target="_blank">custom Silverlight web part wrappe</a>r or use an <a href="http://silverlightwebpart.codeplex.com/" target="_blank">existing open source one</a>.</div><div style="text-align: left"> </div><div style="text-align: left">Silverlight web parts are a VERY powerful feature that is often overlooked. Imagine you have an existing ASP.NET MVC or ASP.NET web forms site that you want to host inside SharePoint. This is not very easy without having already invested in a web part architecture. However, with Silverlight hosting this content in SharePoint is trivial</div><div style="text-align: left"> </div><div style="text-align: center"><em>Example of a full Silverlight dashboard hosted in SharePoint 2010 with <u>NO CODE CHANGES</u> (imagine doing this with another web technology if you didn't invest in web parts from the start; Silverlight's plug-in architecture pays dividends here)</em></div><div style="text-align: center"> </div><div style="text-align: center"><img src="https://silverlighthack.com/image.axd?picture=2011%2f1%2fDashboardInSharePoint.png" alt="" /></div><div style="text-align: center"> </div><div style="text-align: left"> </div><div style="text-align: left"><strong><font size="5">Silverlight Web Part Communication</font></strong> </div><div style="text-align: left"> </div><div style="text-align: left">Creating a single web part whether its an ASP.NET web part or Silverlight web part is fairly easy. There is a lot of material out there to guide a developer through this. However, web part communication gets very tricky in ASP.NET/SharePoint. In these situations you will want an action on one web part to trigger a data refresh in the other web parts on that page. This is where Silverlight really shines.</div><div style="text-align: left"> </div><div style="text-align: center"><em>An example of three web parts, where an event on a single web part will update the content of the other two web parts on a page.</em> </div><div style="text-align: center"><img src="https://silverlighthack.com/image.axd?picture=2011%2f1%2fWebPartComm.png" alt="" /></div><div style="text-align: center"> </div><div style="text-align: left">In order to do this type of web part communication involves creating custom web parts with the provider and consumer interfaces explicitly defined. Not only that, but traditional ASP.NET web parts post back and do not provide that "Ajax/web 2.0" feel. Furthermore, when you have multiple layers of web parts (i.e. providers and consumers switching roles) then this gets very complicated with state management and the web part lifecycle. Furthermore, interactivity (i.e. a slider moving and changing another web part contents in real-time) is not trivial as well.</div><div style="text-align: left"> </div><div style="text-align: left"><em>Note: If you are not familiar with web part connections, look over <a href="http://msdn.microsoft.com/en-us/library/ms178187.aspx" target="_blank">the MSDN article that describes this</a>. As you can see the components involved: Web Part Manager, provider/consumer connections, web part interfaces, web part lifecycle all have to "play nice" with each other for this to work.</em></div><div style="text-align: left"> </div><div style="text-align: left"><strong><em>What advantages do Silverlight web parts provide:</em></strong></div><div style="text-align: left"><ul> <li>Allows client-side, real-time communication between web parts without post backs</li> <li>Allows communication between Silverlight and non-Silverlight web parts (using the Silverlight HTML bridge)</li> <li>Simplifies the design/coding of the web parts by NOT having to implement web part interfaces, worrying about lifecycle management, which part is a provider consumer (you can of course do this if you want)</li></ul></div><div style="text-align: left">Silverlight web parts allow you to create very modular pieces of functionality inside Silverlight. However, it also allows the SharePoint admin to expose the pieces of functionality that is interesting from the complete Silverlight application very easily in SharePoint with <u>NO/LITTLE code changes</u>. Imagine if you have a great Silverlight application with MEF that composes the application in real-time. You can leverage that composable and dynamic architecture into creating a modular SharePoint gallery that allows Silverlight web parts to communicate with each other based on what the portal admin or power user decide to place on the portal canvas.</div><div style="text-align: left"> </div><div style="text-align: left"><strong>How does Silverlight Web Part Communication Work?</strong> </div><div style="text-align: left"> </div><div style="text-align: left">Silverlight web part communication has nothing to do with the web part framework provided in ASP.NET nor SharePoint! It is actually natively provided with the Silverlight framework using the local communication APIs. This means that if you have two Silverlight applications that utilize Silverlight messaging can be deployed a seperate web parts. Furthermore, they can communicate between each other <u>WITHOUT </u>having to write additional web part framework code around providers/consumers/web part managers etc.</div><div style="text-align: left"> </div><div style="text-align: left">The primary mechanism for this is the <a href="http://msdn.microsoft.com/en-us/library/system.windows.messaging.localmessagesender(VS.95).aspx" target="_blank">LocalMessageSender </a>and the <a href="http://msdn.microsoft.com/en-us/library/system.windows.messaging.localmessagereceiver(VS.95).aspx" target="_blank">LocalMessageReceiver </a>classes. For example, from the API documentation this all the code that is required to set up communication between two Silverlight applications:</div><div style="text-align: left"> </div><span class="Apple-style-span" style="font-family: 'Segoe UI', Verdana, Arial; font-size: 13px"><pre style="font-family: Consolas, Courier, monospace; word-break: break-all; word-wrap: break-word; font-style: normal; font-weight: normal; overflow-x: auto; overflow-y: auto; padding: 5px; margin: 0px"><span style="color: green">// In the receiving application:</span></pre><pre style="font-family: Consolas, Courier, monospace; word-break: break-all; word-wrap: break-word; font-style: normal; font-weight: normal; overflow-x: auto; overflow-y: auto; padding: 5px; margin: 0px"><span style="color: green"></span>LocalMessageReceiver messageReceiver = <span style="color: blue">new</span> LocalMessageReceiver(<span style="color: #a31515">"receiver"</span>);</pre><pre style="font-family: Consolas, Courier, monospace; word-break: break-all; word-wrap: break-word; font-style: normal; font-weight: normal; overflow-x: auto; overflow-y: auto; padding: 5px; margin: 0px">messageReceiver.MessageReceived += <span style="color: blue">new</span> EventHandler<MessageReceivedEventArgs>(receiver_MessageReceived);</pre><pre style="font-family: Consolas, Courier, monospace; word-break: break-all; word-wrap: break-word; font-style: normal; font-weight: normal; overflow-x: auto; overflow-y: auto; padding: 5px; margin: 0px"><span style="color: blue">try</span>{messageReceiver.Listen();}</pre><pre style="font-family: Consolas, Courier, monospace; word-break: break-all; word-wrap: break-word; font-style: normal; font-weight: normal; overflow-x: auto; overflow-y: auto; padding: 5px; margin: 0px"><span style="color: blue">catch</span> (ListenFailedException)</pre><pre style="font-family: Consolas, Courier, monospace; word-break: break-all; word-wrap: break-word; font-style: normal; font-weight: normal; overflow-x: auto; overflow-y: auto; padding: 5px; margin: 0px">{MessageBox.Show(<span style="color: #a31515">"Cannot receive messages."</span> + Environment.NewLine +<span style="color: #a31515">"There is already a receiver with the name 'receiver'."</span>,<span style="color: #a31515">"LocalMessageReceiver"</span>, MessageBoxButton.OK);}</pre><pre style="font-family: Consolas, Courier, monospace; word-break: break-all; word-wrap: break-word; font-style: normal; font-weight: normal; overflow-x: auto; overflow-y: auto; padding: 5px; margin: 0px"><span style="color: green">// In the sending application:</span></pre><pre style="font-family: Consolas, Courier, monospace; word-break: break-all; word-wrap: break-word; font-style: normal; font-weight: normal; overflow-x: auto; overflow-y: auto; padding: 5px; margin: 0px"><span style="color: green"></span>LocalMessageSender messageSender = <span style="color: blue">new</span> LocalMessageSender(<span style="color: #a31515">"receiver"</span>);messageSender.SendCompleted += <span style="color: blue">new</span> </pre></span><div style="text-align: left"><span class="Apple-style-span" style="font-family: Consolas, Courier, monospace; white-space: pre"> EventHandler<SendCompletedEventArgs>(sender_SendCompleted);</span></div><div style="text-align: left"> </div><div style="text-align: left"> </div><div style="text-align: center"><em>In my book, I provide an example of two Silverlight web parts that can communicate between each other in SharePoint.</em></div><img src="https://silverlighthack.com/image.axd?picture=2011%2f1%2f30606f1309_forblog.png" alt="" /><div style="text-align: center"> </div><div style="text-align: center"> </div><div style="text-align: left"> </div><div style="text-align: left"><em>Note: If you want Silverlight web parts to communicate with non-Silverlight web parts, this can be done easily using the HTML bridge. For example, if a user clicked a Silverlight button this could trigger a post back and via the web part framework send the proper message via the agreed provider/consumer interface. The part that is tricky is maintaining state between web parts and losing some of the client-side/non-flicker web part messaging.</em></div><div style="text-align: left"> </div><div style="text-align: left"> </div><div style="text-align: left"><strong><font size="5">Summary and Takeaways</font></strong></div><div style="text-align: left"> </div><div style="text-align: left">This article hopefully showed you some of the advantages that Silverlight posseses when using web parts. Some of the key takeaways should be:</div><div style="text-align: left"><ul> <li>It is really easy to deploy a Silverlight application as a web part by simply "hosting it" in an ASP.NET web part. This allows Silverlight applications to be deployed into custom ASP.NET portals or SharePoint 2003-2010 portals with no or minimal code changes.</li> <li>SharePoint 2010 includes a new Silverlight Web Part that allows you to host local, remote or any Silverlight applications that are URL addressable. Therefore, deploying a Silverlight application to SharePoint 2010 usually requires no additional code.</li> <li>Web Part communication (which is not trivial to implement in advances scenarios) simply works without code changes inside Silverlight web parts using the local communication APIS.</li> <li>Web Part communication within two Silverlight web parts happens on the client-side. This provides real-time communication between two web parts without server postbacks nor page refreshes. Silverlight web parts allow for many interactive scenarios that make UIs feel non-obsolete.</li> <li>Advanced MEF scenarios can enable distributing Silverlight as seperate functional modules that can be deployed into portals dynamically. This allows you to "break up" a larger Silverlight application into seperate Silverlight web parts that expose particular pieces of functionality.</li></ul><div>If you want more details, excercises or code samples on this subject I dedicate an entire chapter to this topic in my book "<a href="http://www.amazon.com/Silverlight-4-Business-Intelligence-Software/dp/1430230606/ref=sr_1_1?ie=UTF8&s=books&qid=1295826771&sr=8-1" target="_blank">Silverlight 4 Business Intelligence</a>".</div></div><div style="text-align: left"> </div>
https://silverlighthack.com/post/2011/01/22/Maximizing-your-Silverlight-LOB-investment-with-web-parts.aspx
[email protected]https://silverlighthack.com/post/2011/01/22/Maximizing-your-Silverlight-LOB-investment-with-web-parts.aspx#commenthttps://silverlighthack.com/post.aspx?id=c4250053-deaf-4fd7-9bcb-494ac55cb943Sat, 22 Jan 2011 10:05:00 -0500.netSilverlightBart Czernickihttps://silverlighthack.com/pingback.axdhttps://silverlighthack.com/post.aspx?id=c4250053-deaf-4fd7-9bcb-494ac55cb9438https://silverlighthack.com/trackback.axd?id=c4250053-deaf-4fd7-9bcb-494ac55cb943https://silverlighthack.com/post/2011/01/22/Maximizing-your-Silverlight-LOB-investment-with-web-parts.aspx#commenthttps://silverlighthack.com/syndication.axd?post=c4250053-deaf-4fd7-9bcb-494ac55cb943Why a 64-bit runtime for Silverlight 5 Matters<p style="text-align: left"><strong><em>Abstract: This article discusses the upcoming 64-bit runtime of Silverlight 5. You will see by example (SQL Server) how a 64-bit runtime can make a dramatic difference in the amount of functionality offered in an application. These type of enhancements should flow into a 64-bit version of Silverlight 5.</em></strong></p><p style="text-align: left"><strong>Update 12/6/2010: I know that the Silverlight 5 64-bit story is not fully understood yet. This is not a "flashy or cool" feature, but has the potential to be very powerful much like the fact how Silverlight can distribute process work up to 8 logical CPUs.</strong></p><p>Today (12/2/2010), Microsoft announced some future functionality and features of Silverlight 5. A lof of features like media, data binding improvements (i.e. debugging) and 3D got a majority of the attention. However, one of the most compelling features is that Silverlight 5 will include a 64-bit runtime. I think a 64-bit Silverlight runtime has the potential to change amount of functionality that can be pushed down to the client.</p><p><strong><font size="4">A 64-bit architecture is More than just Access to More Memory</font></strong></p><p>When most developers or architects are asked what is the difference between a 32-bit or a 64-bit version of an application; the answer is usually "the application can take advantage of more memory". For the most part that is usually correct. However, what is sometimes missed is that 64bit versions of applications increase the throughput or ceiling levels of pieces of functionality. For example, if you have a 64bit version of <a href="http://www.powerpivot.com/" target="_blank">PowerPivot</a> (running on Office 2010 x64) you can put tens of millions of rows into memory on a client workstation. This is a trivial example of an application that just leverages x64 architecture to address more memory.</p><p><strong><font size="4">64-bit SQL Server Features</font></strong></p><p>Lets take a look at a more complex example with Microsoft SQL Server. Microsoft SQL Server comes in two editions: 32-bit and 64-bit. The current version(s) of Microsoft SQL Server put "frequently requested" data pages (indexes, tables etc.) into memory. Therefore, a 64-bit version of SQL Server can allocate more of these data pages into memory and alleviate the I/O requests to a SAN or other persisted storage. However, being able to "place more data into memory beyond 4 GB" is just part of the 64-bit story.</p><p>Any SQL Server code that is processed against data structures or algorithms essentially "runs in-memory" (even if the data pages need to be read from persisted storage). A 64-bit architecture in SQL Server allows you the following features:</p><p> </p><ul> <li>Index creation is faster, because there is more memory available to organize a clustered, non-clustered or the index data pages</li> <li>64-bit editions of SQL Server allow for more concurrent connections. Connection pooling algorithms are optimized for the increased memory in 64-bit systems</li> <li>T-SQL joins happen more quickly because heap, merge and other type of joins can happen in memory</li> <li>Prevents "lock escalation". Queries can hold locks on individual rows, pages instead of an entire table. This improves concurrency in OLTP databases.</li> <li>Heap joins (in-memory) are optimized for 64-bit architectures</li> <li>Integration Services can take advantage of increased memory buffers</li> <li>Analysis Services (with its OLAP based data structures) is more efficient with more memory</li> <li>there is more....</li></ul><div style="text-align: center"><strong><em>The table below shows how additional memory in SQL Server can be leveraged to hold more lock resources in a heap table.</em></strong></div><div style="text-align: center"><img src="https://silverlighthack.com/image.axd?picture=2010%2f12%2fMemory.png" alt="" /></div><div> </div><div> </div><div>As you can see the ability to address more memory in 64-bit SQL Server provides an increased amount of functionality internally. It is not just about "putting more stuff in memory". A lot of the components of a 64-bit version of SQL Server work together with the increased addressable memory together to improve the overall performance of the server. In a 32-bit version of SQL Server the individual components have caps, so the server does not run out of memory or steal memory from other areas. In a 64-bit version these ceilings can be increased.</div><div> </div><div>So what's the point? This was not meant to be a SQL Server lesson on 64-bit memory. However, I wanted to point out how a complex system like SQL Server that has many in-memory components has to juggle the available memory in a 32-bit environment; but not so much in a 64-bit environment. The same concepts apply to Silverlight 5. I think this opens up Silverlight 5 to some great potential applications.</div><div> </div><div><strong><font size="4">64-bit Silverlight 5</font></strong></div><div><br /></div><div>As of now, we don't know how the 64-bit version of Silverlight 5 will perform or if there will be limitations on it (i.e. how much memory can a single process allocate). However, the previous example of SQL Server should excite the developer community to be able to create more complex Silverlight functionality. A 64-bit Silverlight runtime should allow us to:</div><div><ul> <li>Use a 64-bit browser processes natively on a 64-bit OS :)</li> <li>Cache a very large amount of data</li> <li>Potentially improver the performance of the Silverlight control (load more elements into memory)</li> <li>Create local "analysis cubes" similar to what Microsoft Office Excel PowerPivot does with x64 bit hardware</li> <li>Increase the size of data structures for application functionality (i.e., connection pooling)</li> <li>Ability for Silverlight to work together with other 64-bit applications together</li></ul><div> </div><div><strong><font size="2">64-bit Silverlight and Mobile Devices </font></strong></div><div> </div><div>Also a lot of mobile devices like phones and tablets use RAM/ROM differently than a computer. These devices use SD cards, SSDs or "true" RAM as RAM. In the very near future we will have tablets or phones that come with 128 gig, 512 gig etc. that "share" RAM/ROM/HD space from a single form factor. You can already see examples of this in Windows Vista/7 with ReadyBoost (where you can use an SD card as RAM). I think this is where 64-bit Silverlight can make a HUGE difference especially on Windows Phone 7, Microsoft Media Set Top Boxes and Windows 7 CE Tablets (iPad competitors). In the upcoming years the difference between persisted storage and RAM will be blurred on these devices as the speed of SD cards or SSD drives improves dramatically.</div><div><br /></div><div> </div><div style="text-align: center"><strong><em>Silverlight 64-bit applications will be able to place "all reasonable data" in memory for real-time and offline access. A great example is to have a statistical application for football that provides real-time business intelligence offline. (pro-football-reference.com web data running in offline Silverlight and used for in-game broadcasting for example)</em></strong></div><div style="text-align: center"> </div><div> </div></div><div style="text-align: center"><img src="https://silverlighthack.com/image.axd?picture=2010%2f12%2fproFootBall.png" alt="" /></div><div style="text-align: center"> </div><div><div>If developers look at what can be done with a 64-bit architecture by looking at enterprise examples (i.e. SQL Server 64-bit), I think they will as excited as I am about the potential this can unlock. Remember its more than just "putting more stuff in memory".</div></div><div style="text-align: center"> </div>
https://silverlighthack.com/post/2010/12/02/Why-a-64-bit-runtime-for-Silverlight-5-Matters.aspx
[email protected]https://silverlighthack.com/post/2010/12/02/Why-a-64-bit-runtime-for-Silverlight-5-Matters.aspx#commenthttps://silverlighthack.com/post.aspx?id=a77a46fb-9871-4ec8-8575-0710fd58163fThu, 02 Dec 2010 16:54:00 -0500SilverlightSilverlight 5Bart Czernickihttps://silverlighthack.com/pingback.axdhttps://silverlighthack.com/post.aspx?id=a77a46fb-9871-4ec8-8575-0710fd58163f13https://silverlighthack.com/trackback.axd?id=a77a46fb-9871-4ec8-8575-0710fd58163fhttps://silverlighthack.com/post/2010/12/02/Why-a-64-bit-runtime-for-Silverlight-5-Matters.aspx#commenthttps://silverlighthack.com/syndication.axd?post=a77a46fb-9871-4ec8-8575-0710fd58163f