Labels

Friday, July 5, 2013

.Net Developer Tools and References

-          .NET Memory Profiler. Leading tool to optimize memory usage and find memory leaks in any .NET application. This tool is used internally by Microsoft to analyze memory in .NET applications and .NET itself.
-          JetBrains dotTrace Performance. Leading profiling tool to optimize .NET applications and detect performance bottlenecks. This tool is very lightweight and very fast to run and produces very accurate results.
-          .NET Reflector. A must have tool for .NET development to understand .NET Framework and debug any .NET code. Although there’s very good free alternative ILSpy which has almost the same features.
-          Redgate ANTS Performance Profiler. Another good and feature rich performance profiling tool however a bit heavy and requires very good hardware to perform performance tests.
-          SQLSolutions & SQL Power Tools. Good tools to analyze and detect performance problems in your SQL Server.


Wednesday, April 10, 2013

Use web.config transformations with other projects

Transformation over your ServiceReferences.ClientConfig files


1. Edit your .csproj file of the Silverlight application. Add the following block:
<UsingTask TaskName="TransformXml"
    AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
   <Target Name="BeforeBuild"           Condition="exists('ServiceReferences.$(Configuration).ClientConfig')">
     <!-- Generate transformed app config in the intermediate directory –>     
     <TransformXml Source="ServiceReferences.ClientConfig"
      Destination="$(TargetDir)\ServiceReferences.ClientConfig"
      Transform="ServiceReferences.$(Configuration).ClientConfig" />
     <!-- Force build process to use the transformed configuration file from now on. –>
     <ItemGroup>
       <Content Remove="ServiceReferences.ClientConfig"/>      
       <ContentWithTargetPath              Include="$(TargetDir)\ServiceReferences.ClientConfig">       
          <TargetPath>ServiceReferences.ClientConfig</TargetPath>
       </ContentWithTargetPath>
     </ItemGroup>
   </Target>


right after:
 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />


2. Add new XML file to your project. Name it ServiceReferences.[BuildConfiguration].ClientConfig. Where [BuildConfiguration] can be the name of *any* build configurations you have defined for your project. The default build configurations are “Debug” and “Release”, but you may add as many as you like, to suit your development/testing/staging/live environments. Remember to set “Build Action” to “None”, and “Copy to output directory” to “Never"

3. Add the required content in that custom file. For example, if you want to just change an endpoint for a service, you will have something like this (ServiceReferences.Debug.ClientConfig):
<?xml version="1.0" encoding="utf-8"?>
<configuration
  xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
     <system.serviceModel>
         <client>
             <endpoint                address="http://127.0.0.1:81/DummyService.svc"               xdt:Transform="SetAttributes" />
         </client>
     </system.serviceModel>
</configuration>


For more information on XML transformations supported, please take a look at the MSDN documentation for Web.Config transformations.

Thursday, April 4, 2013

ASP.Net

Error: "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler"

Cause: you didn’t install IIS support for asp.net. (WHICH SURPRISE, IS NOT DEFAULT SELECTED)