Exclusively for you!! Trial version of Google Apps, Apply Coupon-CNHPGX6T6QRWGV!!
App_Offline Updates in Webdeploy V3 and Visual Studio 2013
Jan10

App_Offline Updates in Webdeploy V3 and Visual Studio 2013

Welcome to CodeSpread! Please refer Don’t Mess with App_Offline article to see the usefulness of App_Offline. Treat the below article as an update to the concepts and basics shared earlier. After going through visual studio 2013 updates available across the web, I found some interesting notes related to app_offline at http://www.iis.net/learn/publish/deploying-application-packages/taking-an-application-offline-before-publishing http://blogs.msdn.com/b/webdev/archive/2013/10/30/web-publishing-updates-for-app-offline-and-usechecksum.aspx To summarize both the articles, An “AppOffline” rule was added to Web Deploy V3, This rule is disabled by default and needs to be enabled for taking an application offline. Example to be run on command line: msdeploy.exe -verb:sync -source:iisApp=mySite -dest:auto,computername= -enableRule:AppOffline Now, the above logic is integrated with visual studio 2013 where the rule can be enabled  in .pubxml file associated to corresponding publish profile.These web publish profiles are stored as MSBuild files under Properties\PublishProfiles Add the following element in the PropertyGroup element. <EnableMSDeployAppOffline>true</EnableMSDeployAppOffline> So the resulting publish profile will look something like the following. <!--?<span class="hiddenSpellError" pre=""-->xml version="1.0" encoding="utf-8"?&gt; &lt;Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; &lt;PropertyGroup&gt; &lt;EnableMSDeployAppOffline&gt;true&lt;/EnableMSDeployAppOffline&gt; &lt;WebPublishMethod&gt;MSDeploy&lt;/WebPublishMethod&gt; &lt;MSDeployServiceURL&gt;(removed)&lt;/MSDeployServiceURL&gt; &lt;DeployIisAppPath&gt;Default Web Site&lt;/DeployIisAppPath&gt; &lt;AllowUntrustedCertificate&gt;True&lt;/AllowUntrustedCertificate&gt; &lt;SkipExtraFilesOnServer&gt;True&lt;/SkipExtraFilesOnServer&gt; &lt;DeployAsIisApp&gt;False&lt;/DeployAsIisApp&gt; &lt;MSDeployPublishMethod&gt;WMSVC&lt;/MSDeployPublishMethod&gt; &lt;UserName&gt;sayedha&lt;/UserName&gt; &lt;ExcludeApp_Data&gt;False&lt;/ExcludeApp_Data&gt; &lt;_SavePWD&gt;True&lt;/_SavePWD&gt; &lt;/PropertyGroup&gt; &lt;/Project&gt;...

Read More
Comic: Real Christmas & New Year Celebrations
Dec25
Read More
24/12/2013: 10 Best Practices of programming from CodeSpread(31-40)
Dec24

24/12/2013: 10 Best Practices of programming from CodeSpread(31-40)

We love programming and having a knowledge of best practices always helps in writing beautiful code. We have shared first 20 random best practice in our previous articles 1-10, 11-20, 21-30. More best practices from CodeSpread. Best Practice #31, Naming Conventions are important, Use Pascal Casing for class, interface, constants and methods names. For example: interface INewClass { void NewMethod(); } public class NewClass : INewClass { public const int NewConstant=10; public void NewMethod() { } } Best Practice #32,Use camel casing for local variable and parameters. public class NewClass { public int countEmployee; public void NewMethod(int customerId) { } } Best Practice #33, Do not use abbreviated language. For ex: do not use single alphabets as it does not convey any useful meaning. int i=1; int j=2; Best Practice #34, Always use descriptive language for naming. int count=10; void GetEmployeeCount(); Best Practice #35, Use #region to summate the block of codes together and have a clean separation. #region Get Customer Details public class Customer { public int customerCount; public void GetCustomerDetails(int customerId) { } } #endregion Best Practice #36, Always maintain updated comments. Use // or ///. //Get Employee Details Public Employee GetDetails(int employeeId) { } Best Practice #37, Follow Solid principles. Best Practice #38, Instead of using hardcoded values, use constants or read only properties. Best Practice #39, Always trim the reference values used for comparison. Best Practice #40,Use string.Empty instead of “”. We would love to hear from our users about the best practices used by them. Please write to...

Read More
23 Dec: Must Read Codes [11-15]
Dec23

23 Dec: Must Read Codes [11-15]

We are sharing few must read codes/concepts which are required now and then. Each of these codereads doesn’t require a full length descriptive article so combining them into groups of five. CodeReads #11, We have two properties in CSS to hide the elements but there is a difference in their behavior such as if we use ‘Visibility:Hidden;’ : element will NOT be visible but will take its space on the page. if we use ‘Display:None;’ : element will NOT be visible and also in addition to that, will NOT take up space on the page. This makes page lighter. fbsource:https://www.facebook.com/codespread/posts/554571687899390 CodeReads #12, A jagged array is an array of arrays and is declared as string[][] jagarray; For example: string[2][4] jagarray; It is jagged array where first square bracket is a one-dimensional array and contains two arrays where each one of them internally contains 4 arrays. A multidimensional array is declared as string[ , ] mularray; For example: string[2,4] mularray; It is multidimensional array where ‘,’ separates it to two dminesions containing 2 and 4 elemnts respectively. fbsource: https://www.facebook.com/codespread/posts/554833934539832 CodeReads #13, To Count number of tables in a SQL Server database USE DB_NAME SELECT COUNT(*) from information_schema.tables WHERE table_type = ‘base table’ fbsource:https://www.facebook.com/codespread/posts/561133753909850 CodeReads #14, Garbage collection occurs when one of the following conditions is true: 1.The system has low physical memory. 2. The memory that is used by allocated objects on the managed heap surpasses an acceptable threshold. This means that a threshold of acceptable memory usage has been exceeded on the managed heap. This threshold is continuously adjusted as the process runs. 3. The GC.Collect method is called. In almost all cases, you do not have to call this method, because the garbage collector runs continuously. This method is primarily used for unique situations and testing. Source:MSDN fbsource: https://www.facebook.com/codespread/posts/577240208965871 CodeReads #15, A property is classified according to the accessors used as follows: 1.A property with a get accessor only is called a read-only property. You cannot assign a value to a read-only property. 2.A property with a set accessor only is called a write-only property. You cannot reference a write-only property except as a target of an assignment. 3.A property with both get and set accessors is a read-write property. Source:MSDN...

Read More
20 Dec: Must Read Codes [6-10]
Dec20

20 Dec: Must Read Codes [6-10]

We are sharing few must read codes/concepts which are required now and then. Each of these codereads doesn’t require a full length descriptive article so combining them into groups of five. CodeReads #6, What is the difference between Dispose and Finalize? #Point 1, Dispose is used to release unmanaged resources in a deterministic fashion, like we know when to release the resource. Finalize method is also used for the purpose of releasing resources but in non-deterministic fashion like we cannot be sure as when Garbage Collector will collect the resource. #Point 2 , Finalize method has a performance drawback due to the Garbage Collector as there will be two iterations of Garbage Collector and override operation. fbsource :https://www.facebook.com/codespread/posts/550605628295996 CodeReads #7, Garbage Collector maintains managed objects in “generations.” The generation indicates the lifetime of an object like objects having short life are stored in lower generations as GC runs much more frequently to clean up objects in the lower generations. The more the objects survive a GC cleanup, the more the chances that these objects will get moved to higher generations. There will be few GC swipes on higher generations and also that will happen only if lower generations have no space left. When we talk about generations, we talk about physical memory locations divided,managed and allocated to each generation number. fbsource: https://www.facebook.com/codespread/posts/550949951594897 CodeReads #8, .data() : Store arbitrary data associated with the matched elements or return the value at the named data store for the first element in the set of matched elements. For more information: http://api.jquery.com/data/ fbsource: https://www.facebook.com/codespread/posts/370621346386549 CodeReads #9, Elements of a UML Class Diagram are: Class Operations Relationships -Associations -Generalization -Dependency -Realization Constraint Rules and Notes fbsource: https://www.facebook.com/codespread/posts/552364564786769 CodeReads #10, Scaffolding is a technique in which the programmer may write a specification that describes how the application database may be used. With the help of this concept,programmer can create a functional Web site for viewing and editing data based on the schema of the data. ASP.NET Dynamic Data supports scaffolding. Refer the below link. For more information: http://msdn.microsoft.com/en-IN/library/ee845452%28v=vs.100%29.aspx fbsource:...

Read More
19 Dec: Must Read Codes [1-5]
Dec19

19 Dec: Must Read Codes [1-5]

We are sharing few must read codes/concepts which are required now and then. Each of these codereads doesn’t require a full length descriptive article so combining them into groups of five. CodeReads #1, Usage of ‘this’ keyword in C#. To qualify members hidden by similar name. To have an object pass itself as a parameter to other methods. To have an object return itself from a method. To declare indexers. To declare extension methods. To pass parameters between constructors. To internally reassign value type (struct) value. fbsource: https://www.facebook.com/codespread/posts/544740368882522 CodeReads #2, ISNULL and COALESCE though equivalent, can behave differently. An expression involving ISNULL with non-null parameters is considered to be NOT NULL, while expressions involving COALESCE with non-null parameters is considered to be NULL. fbsource: https://www.facebook.com/codespread/posts/545045568852002 CodeReads #3, Regular Cast: string str= (string) strToCast; Method Call: string str= strToCast.ToString(); Safe Cast: string str= strToCast as string; fbsource: https://www.facebook.com/codespread/posts/545045568852002 CodeReads #4, Control State maintains the behavior of the controls whereas View State maintains the content of the controls. Also, Control State is available even though View State for the control is disabled. fbsource: https://www.facebook.com/codespread/posts/547846855238540 CodeReads #5, In javascript, Body.Onload() event occurs only after the DOM has been loaded, plus all associated resources like images, flash etc are also completely loaded. $(document).ready() occurs when the DOM has been loaded but associated resources like images, flash etc may be pending. There can be multiple document.ready() in a page but Body.Onload() event will be only one. fbsource:...

Read More
Page 1 of 3123