Tuesday, August 12, 2008

HelloSecureWorld.com : A nice resource to learn Security

Microsoft has developed a new site http://www.hellosecureworld.com/ which provides a powerful experience for promoting security awareness and education in the developer community by surfacing existing content as well as new.

If you like learning while having FUN then hellosecureworld.com is the resource for you. It brings non traditional ways to provide security awareness and education among the developer community - Virtual lab environment, hands on labs, tutorials, videos, play attack defender games and much more.

Happy Learning !!
Namastee !

Monday, August 11, 2008

Visual Studio 2008 Service Pack 1 and .NET Framework 3.5 Service Pack 1

Microsoft has released the long waited Visual Studio 2008 Service Pack 1 and .NET Framework 3.5 Service Pack 1. This service pack includes lot of new features like Entity Framework,SQL Server 2008 support etc. and some major performance enhancements.

Visit the following URL to know more details and downlaod the VS.NET 2008 SP1.
http://msdn.microsoft.com/en-us/vstudio/products/cc533447.aspx

Namastee !

Thursday, August 07, 2008

StyleCop : A New Source Code Analysis Tool From Microsoft



Recently Microsoft has released a Source code analysis tool.This tool is known internally within Microsoft as StyleCop, and has been used for many years now


StyleCop is similar in many ways to Microsoft Code Analysis (specifically FxCop), but there are some important distinctions. FxCop performs its analysis on compiled binaries, while StyleCop analyzes the source code directly. For this reason, FxCop focuses more on the design of the code, while StyleCop focuses on layout, readability and documentation. Most of that information is stripped away during the compilation process, and thus cannot be analyzed by FxCop.The ultimate goal of StyleCop is to allow you to produce elegant, consistent code that your team members and others who view your code will find highly readable. In order to accomplish this, StyleCop does not allow its rules to be very configurable. StyleCop takes a one-size-fits-all approach to code style, layout, and readability rules. It is highly likely that you will not agree with all of the rules and may even find some of the rules annoying at first! However, the majority of teams using this tool within Microsoft have found that after a short adjustment period, they came to appreciate the rules enforced by StyleCop, and even began to find it difficult to read code not written in this style.


StyleCop comes with a set of default rules analyzers covering approximately 200 best practice rules. These rules are full compatible with the default layout settings in Visual Studio 2005 and Visual Studio 2008.


Specifically, these rules cover the following, in no particular order:



  • Layout of elements, statements, expressions, and query clauses

  • Placement of curly brackets, parenthesis, square brackets, etc

  • Spacing around keywords and operator symbols Line spacing

  • Placement of method parameters within method declarations or method calls

  • Standard ordering of elements within a class

  • Formatting of documentation within element headers and file headers

  • Naming of elements, fields and variables

  • Use of the built-in types

  • Use of access modifiers

  • Allowed contents of files

  • Debugging text


After installation, StyleCop can be run from within the Visual Studio IDE, and can also be integrated into MSBuild-based command line builds.
StyleCop can be downloaded here:
https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sourceanalysis
Namastee!

Installing shared assembly in GAC using deployment project

If You are using any shared assembly in you project and using deployment project to deploy it, by defult the assembly will be deployed in BIN folder although it is a shared assembly.To deploy it in GAC you need to follow following steps.

  • Open the Setup Project.
  • Open File System Editor From View->Editor->File System
  • File System will have various folders like Application folder, User desktop etc. Right click on the file system you will find Add Special folder context menu and different special folder will be displayed.
  • Select Global Assmbly Cache folder, which will add this folder to the File System .
  • Now add the shared assemblies to this and build it.

Namastee !

Creating a C# library and use it as custom function in Crystal Report

You can write your own functions in any .NET language like C# , vb.net and use it in crystal report as user defined fuction.
Here are the steps you need to follow:-

  1. Create a User Function Library .TheUser Function Libraries must be prefixed with CRUFL to be recognized by the embedded Crystal Reports Designer
  2. In the project property Build/Compile window select Register for COM Interop.Register for COM Interop" causes the assembly to be automatically registered by the regasm.exe utility, when the project is compiled. So, you do not need to run regasm.exe manually from the command prompt.
  3. Create an interface class with COM attributes.Above the interface declaration, create an attribute with three values: ComVisible, InterfaceType, and Guid (in C#).Create all the method signature.This method signature will become the name of the function that is exposed in the embedded Crystal Reports Designer.
  4. Create a Class and implement this interface.Above the class declaration, create an attribute with three values: ComVisible, ClassInterface and Guid (in C#).
  5. Create a strong name and attach it to the class library projcet to make this assembly as shared assembly.
  6. Install this assembly in GAC
  7. Now you can go to the Formula Workshop window and in side function -> Additional Functions ->Visual Basic UFLs (u2lcomm.dll) , you will find the functions defined in the assmbly.

Namastee !