After build command line …

When we build our DLL’s in Visual Studio we often want them to be transported to the GAC
and that an IISRESET is being executed
Use after build command lines in Visual Studio.

"C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin\gacutil.exe" -u $(TargetName)

"C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin\gacutil.exe" -i $(TargetFileName)

iisreset

 

 

C:\Program Files\Microsoft Visual Studio 9.0\SDK\v3.5\Bin\gacutil.exe ==> this is the path of you gacutil.

 

Hope it helps !


Published: 2/20/2012 | 0  Comments | 0  Links to this post

Generic CAML ….

Many times I find myself in the situation where I need to retrieve items
which need a more complex Caml query.
These procedures will give you a start Glimlach

 

public static string CreateCAMLQuery(string[] parameters, string fieldName, string type)
       {
           StringBuilder sb = new StringBuilder();

           //if (parameters.Length == 0)
           // AppendEQ(sb, "all");

           for (int i = 0; i < parameters.Length; i++)
           {
               AppendEQ(sb, parameters[i], fieldName, type);
               if (i > 0)
               {
                   sb.Insert(0, "<And>");
                   sb.Append("</And>");
               }
           }
           sb.Insert(0, "<Where>");
           sb.Append("</Where>");
           return sb.ToString();
       }
       private static void AppendEQ(StringBuilder sb, string value, string fieldName, string type)
       {
           // put your field's internal name in place of Category   
           sb.Append("<Eq>");
           sb.Append(string.Format("<FieldRef Name='{0}'/>", fieldName));
           sb.AppendFormat(string.Format("<Value Type='{0}'>{1}</Value>", type, value));
           sb.Append("</Eq>");
       }

I hope it helps !!!


Published: 2/16/2012 | 0  Comments | 0  Links to this post