Showing posts with label tools. Show all posts
Showing posts with label tools. Show all posts

Thursday, February 14, 2013

Portable mail server on desktop for SharePoint

I used to run an SMTP server which comes along with IIS 6.0 whenever I need to test an outgoing emails from a custom SharePoint solution. After a long time I hate running a server process just to receive a bunch of emails relayed within my development machine and also due to compliance, network administrators may block the SMTP server in a desktop.

Here comes a nifty tool from Codeplex called Papercut for all our problems. Ok, how to resolve the SMTP puzzle ?


  1. Download Papercut from CodePlex, unzip the zip package (Note: there is no msi package or a setup.exe, so you are not violating software compliance too) and keep it in a handy location
  2. Find your machine IP first by using ipconfig and make a note.
  3. Map your IP to SharePoint’s outgoing mail settings in SharePoint Central Administration console.



Open PaperCut.exe -> click on “Options” -> Map your machine IP here. Keep it open and running, do not close.


Now test all your email functionalities and you should be seeing all emails in the left pane with time stamp.

Watch all your mails are being forwarded to Papercut.exe.


Wednesday, April 20, 2011

Continuous Integration and remote deployment for SharePoint

This is a short guide of setting up a Continuous integration server and integrating with different plugins to analyse the code quality. At the end of the pipeline, we'll deploy to a remote staging server. The core idea is to build the solution on top of open source stack rather than  proprietary solutions like TFS.

Setting up Continuous Integration server:

  • Although there are tons of CI tools available in the market,as CruiseControl.Net looked for great for integrating various tools we picked up CruiseControl for our implementation.
  • Install CruiseControl.Net on a designated build server
  • CC.NET supports various source control blocks CVS,Subversion,VSS,SourceGear, StarTeam etc.
  • Download a command line client for the source control repository, for Subversion download this CollabNet Subversion command line client
  • Upon successful installation, browse to the folder C:\Program Files\CruiseControl.NET and open ccnet.config file in a text editor.
  • Add the project level detail

<project name=" testProject">
<workingDirectory>C:\develop\project1WorkingDir </workingDirectory>
</project>
  • Add source control block, which contains the SVN repository end point and credentials required to access these resources.
<sourcecontrol type="svn">
<trunkUrl>svn://Foo/trunk</trunkUrl>
<Working Directory>C:\develop\project1WorkingDir </workingDirectory>
<username>ccnet </username>
<password> ccnet </password>
</sourcecontrol>
  • Now we've added a Subversion URL with required credentials to access 
  • Let's add a Trigger block to tell the integration server at what frequency it should get latest and do a build. set the frequency as 360 seconds.
<triggers>
<intervalTrigger name="Subversion" seconds="360" buildCondition="ForceBuild" />
</triggers>
  • Add a Task block for building the solution, CC.net supports various build automation engines such as MSBuild, VSDevenv,NAnt  etc. We'll configure for MSBuild.
<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe</executable>
<WorkingDirectory>C:\develop\project1WorkingDir</workingDirectory>
<projectFile>Sampleprojects.sln</projectFile >
<executable>
</tasks>
  • Alternatively if you want to use Visual studio to build the solution, following fragment will be helpful
<devenv>      
<solutionfile>C:development\Foo.sln</solutionfile>
        <configuration>Debug</configuration>
        <buildtype>Clean</buildtype>
        <executable>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe</executable>        <buildTimeoutSeconds>360</buildTimeoutSeconds>
      </devenv>
  •  Add an Executable Task in this section after the build task for integrating other third party analysis tools like Microsoft FxCop for static code analysis, SPDisposeCheck tool for memory leak test, Microsoft StyleCop etc.
</exec>
<exec executable="C:\Program Files\Microsoft\SharePoint Dispose Check\SPDisposeCheck.exe">      <buildArgs>C:Foo\bin</buildArgs>
</exec>
  • Above Exec snippet requires all binaries to be stored in a single folder to run SPDisposeCheck, this can be done by adding a post build command in CS Project files.
  • Integrate Unit test case execution tools and code coverage tools like MSTest and NUnit test.
Package and move to staging server
  • Add a Exec task tag for WSP Builder
<exec executable="C:\Program Files\WSPTools\WSPBuilderExtensions\WSPBuilder.exe"><baseDirectory>C:\Foo\solutions</baseDirectory>      <buildTimeoutSeconds>360</buildTimeoutSeconds></exec>
  • Add a task which executes a xcopy command to move all these wsp packages to a staging server
<exec executable="C:\WINDOWS\system32\xcopy.exe">
<buildArgs>C:\Foo\Solutions\Output.WSP\*.wsp \\md-stagingSvr\share</buildArgs></exec>
Remote deployment with Sysinternal's PSExec

  • Add  another exec task to invoke PSExec tool to do the remote deployment
  • Alternatively if you have Windows Powershell in these machines you can make use of power shell to do the remote deployment.
<exec executable="C:\SysinternalsSuite\psexec.exe">
<buildArgs>\\md-stagingSvr-u "md-stagingSvr\aravind" -p 123$ "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o addsolution -filename c:\share\output.wsp</buildArgs></exec>


Wednesday, March 9, 2011

Free alternatives for Redgate Reflector

Recently my Reflector time bombed and refused to open. As a SharePoint developer, this is one of the crucial tool in my toolbox to peep in to SharePoint binaries. Finally it seems like Redgate  betrayed .NET community for not keeping this little tool free and alive.
In search of an alternative for this great tool by Lutz Roeder, found some interesting projects.

ILSpy - a promising open source alternative.developed by SharpDevelop team.
Monoflector- uses Cecil,MEF
Resharper 6 Decompiler - Resharper is planning to provide a free stand alone decompiler,
Kaliro Explorer - bunch of other tools like Moss explorer, calendar sync are also available along with this
DotNet IL Editor - It can disassemble and debug the assemblies

Still wondering why this functionality is not integrated in VS 2010 ?