Tuesday, February 2, 2016

To create a deployment package using Octopus

Install OctoPack nugget to the project

Add the following section in the project
 
< propertygroup >
< runoctopack >true< / runoctopack > < octopackpublishpackagetofileshare >C:\MyPackages < / octopackpublishpackagetofileshare >
< / propertygroup >
 

   

on build of solution the package will created to the destined folder.
C:\MyPackages

We can upload the package to Octopus Server and create a release to deploy it in targetted environments

Wednesday, January 13, 2016

Fix Issue : Microsoft.Practices.EnterpriseLibrary.Data.Database, is an abstract class and cannot be constructed.



Server Error in '/' Application.


The current type, Microsoft.Practices.EnterpriseLibrary.Data.Database, is an abstract class and cannot be constructed. Are you missing a type mapping?


While deploying a web application which use Microsoft enterprise library for data access. If you get the above error. 
Please make sure all the dll is in bin folder and make sure to add the following section in web.config file 

   
       
       
     

 
   
     
     
   
 

Thursday, January 7, 2016

SQL_NO_CACHE MySQl no cache


The mysql workbench return the cached value of data.

To get the latest data from db use the keyword SQL_NO_CACHE
 Select SQL_NO_CACHE * from UserDetail

Thursday, November 12, 2015

Reference for extension method in C#

https://msdn.microsoft.com/en-IN/library/bb383977.aspx

Extension methods are defined as static methods but are called by using instance method syntax. Their first parameter specifies which type the method operates on, and the parameter is preceded by the this modifier. Extension methods are only in scope when you explicitly import the namespace into your source code with a using directive.

The following example shows an extension method defined for the System.String class. Note that it is defined inside a non-nested, non-generic static class:
namespace ExtensionMethods
{
    public static class MyExtensions
    {
        public static int WordCount(this String str)
        {
            return str.Split(new char[] { ' ', '.', '?' }, 
                             StringSplitOptions.RemoveEmptyEntries).Length;
        }
    }   
}
The WordCount extension method can be brought into scope with this using directive:
using ExtensionMethods;
And it can be called from an application by using this syntax:
string s = "Hello Extension Methods";
int i = s.WordCount();

Friday, October 9, 2015

Copy an existing MySQL table to a new table


http://www.tech-recipes.com/rx/1487/copy-an-existing-mysql-table-to-a-new-table/

CREATE TABLE recipes_new LIKE production.recipes; 

INSERT recipes_new SELECT * FROM production.recipes;

Wednesday, October 7, 2015

My sql reference : SHOW VARIABLES



My sql reference



https://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html

https://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_lower_case_table_names

Syntax to view the system variable value in mysql
SHOW [GLOBAL | SESSION] VARIABLES
    [LIKE 'pattern' | WHERE expr]


Ex:  SHOW VARIABLES LIKE 'lower_case_table_names';

Monday, October 5, 2015

Getting (413) Error “Request Entity Too Large”

reference
http://stackoverflow.com/questions/19959273/still-getting-413-request-entity-too-large-even-after-setting-the-web-config

I found the solution looking in another web.config example
This was my web.config:

  
    <binding name="basicHttpsBinding" maxReceivedMessageSize="524288000" />
    <binding name="mexHttpBinding" maxReceivedMessageSize="524288000" />
  </basicHttpBinding>
</bindings>

  <service behaviorConfiguration="ServicioCCMasAvalBehavior" name="ServicioCCMasAval.ServicioCCMasAval">
    <endpoint address="/" binding="basicHttpBinding" contract="ServicioCCMasAval.IServicioCCMasAval" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>


I was missing the bindingConfiguration on the enpoint. Now this is my working webconfig:

  
    <binding name="basicHttpBinding" maxReceivedMessageSize="524288000" />
    <binding name="mexHttpBinding" maxReceivedMessageSize="524288000" />
  </basicHttpBinding>
</bindings>

  <service behaviorConfiguration="ServicioCCMasAvalBehavior" name="ServicioCCMasAval.ServicioCCMasAval">
    <endpoint address="/" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding" contract="ServicioCCMasAval.IServicioCCMasAval" />      
  </service>
</services>