While creating Web Setup, Visual J# .NET automatically included in the MSI package.
When we install this MSI on a server machine which does not have Visual J# .NET installed, installer prompts a message to install Visual J# .NET.

Usually we dont need to install Visual J# .NET and it can be avoided to add into installer. To do this:-

- Open setUp project (.vdproj) file in a text editor.
- Find below section for LauchCondition for Visual J# .NET and remove it.
"LaunchCondition"
        {
            "{836E08B8-0285-4809-BA42-01DB6754A45D}:_237E8F40F1A4464FBD27D8992CFDD623"
            {
            "Name" = "8:Visual J# .NET"
            "Condition" = "8:REQ_VJSLIB_VER_PRESENT = \"TRUE\""
            "Message" = "8:[VSDVJSMSG]"
            "InstallUrl" = "8:http://msdn.microsoft.com/vjsharp"
            }
            "{836E08B8-0285-4809-BA42-01DB6754A45D}:_DF1CA2119CD64D4B94CE993CF1624ACE"
            {
            "Name" = "8:IIS Condition"
            "Condition" = "8:IISVERSION >= \"#4\""
            "Message" = "8:[VSDIISMSG]"
            "InstallUrl" = "8:"
            }
        }
- Save .vdproj file and Build again to generate new MSI installer.
- Install the MSI on a new machine again where J# does not exist, It should not prompt the same message to install J#.

 

 


http://www.microsofttranslator.com/widget/ tool from Microsoft allows you to convert the language of your content on the fly. It is very intutive, effective and can be used for various locale generation requirements.

It emits the below given <div> with the javascript:-

<div id="MicrosoftTranslatorWidget" style="width: 200px; min-height: 83px; border-color: #3A5770; background-color: #78ADD0;"><noscript><a href="http://www.microsofttranslator.com/bv.aspx?a=URL_TO_TRANSLATE">Translate this page</a><br />Powered by <a href="http://www.microsofttranslator.com">Microsoft® Translator</a></noscript></div> <script type="text/javascript"> /* <![CDATA[ */ setTimeout(function() { var s = document.createElement("script"); s.type = "text/javascript"; s.charset = "UTF-8"; s.src = ((location && location.href && location.href.indexOf('https') == 0) ? "https://ssl.microsofttranslator.com" : "http://www.microsofttranslator.com" ) + "/ajax/v2/widget.aspx?mode=manual&from=en&layout=ts"; var p = document.getElementsByTagName('head')[0] || document.documentElement; p.insertBefore(s, p.firstChild); }, 0); /* ]]> */ </script>

We just need to change the url of the site where we want to convert the content. It connects to http://www.microsofttranslator.com/bv.aspx and passes the site url as querystring and we see the quick Ajax based translation of the page.

I installed VS 2005 on my machine.. and later I installed a few Extentions for .Net framework 3.5 (LINQ, AJAX etc).

Later I come up with a requirement to convert a website into WebApplicationn I did it earlier so I was sure It will be done by installing  Web Application Project  Addin by Microsoft. Unfortunately it did not work and I cound not found the reason. I tried many ways but no success infact I get VS 2005 updated by installing it again.

I found the below resolution from
http://blogs.msdn.com/b/astebner/archive/2007/02/11/uninstall-vs-2005-update-to-support-web-application-projects-before-installing-vs-2005-sp1.aspx.

  1. Click on the Start menu, choose Run, type appwiz.cpl and click OK
  2. In the Add/Remove Programs control panel, locate and remove the item named Microsoft Visual Studio 2005 Web Application Projects
  3. Check the box named Show updates at the top of the Add/Remove Programs control panel
  4. Under Microsoft Visual Studio 2005, locate the update named Update for Microsoft Visual Studio 2005 (KB915364) and choose to uninstall it.

After uninstalling both of the above packages, you should no longer receive a blocking dialog related to the Web Application Project add-in when trying to install VS 2005 SP1.

 


Unit test suites are often used as a quality tool during the development process to keep the codebase stable as it changes and expands. Tools such as NUnit, MSTest are often used to run and report on the test suites. However, when implementing unit testing in your build process, you have no way of knowing how much of your code the unit tests are actually testing. This is where code coverage comes in. You can run NUnit, MSTest within the Code Coverage tool and use the report to determine which code was not tested by that test suite.

NCover is the prominent tool but its not free I fount PartCover interesting moreover its free.
Partcover  provides 2 style sheets to view the xml report: based on Classes or based on assemblies. Apparently if we have a single Test assembly we should use Class wise report else assembly wise.

Steps to Integrate Partcover into cruisecontrol.net:
http://ccnetlive.thoughtworks.com/ccnet/doc/CCNET/Using%20CruiseControl.NET%20with%20PartCover.html

Above example is based on Nant build tools, For MSBuild refer below given sample using Exec task:-

  <Target Name="PartCover" >
    <Exec Command="$(CCNetServer)tools\PartCover.NET4.0\PartCover.exe --settings $(CCNetServer)$(ProjectName)\Factory\partcover\$(projectname).xml --output $(project_artifacts_path)PartCover-results.xml"
      ContinueOnError="true"
      WorkingDirectory="$(CCNetServer)tools\PartCover.NET4.0\"
    />
  </Target>

Above target is an exerept from my build file where you can see few properties used. Below is the explaination for each property.

1/ PartCover.exe: Command line executable for Partcover.
2/ --settings: argument is case sensitive in build script so use "settings" only. It requires setting.xml file:-

<PartCoverSettings>
  <Target>C:\Program Files\NUnit-2.5.3.9345\bin\net-2.0\nunit-console.exe</Target>
  <TargetWorkDir>C:\Program Files\CruiseControl.NET\server\MyProject\WorkingDirectory\MyProject\bin\Debug</TargetWorkDir>
  <TargetArgs>MyAssembly.NUnitTest.dll</TargetArgs>
  <Rule>+[MyAssembly1*]*</Rule>
  <Rule>+[MyAssembly2*]*</Rule>
  <Rule>-[MyAssembly.NUnitTest*]*</Rule>
  <Rule>-[nunit*]*</Rule>
  <Rule>-[log4net*]*</Rule>
</PartCoverSettings>

Here + indicates the inclusion and - indecates the excution of a file * acta as wild card notation.

Nunit is one important prerequisite to run  this tool. Below is the sample target.
<ItemGroup>
 <TestAssembly Include="$(BuildDirectory)MySolution\MyProject\bin\$(Configuration)\MyAssembly.TestNUnit.dll" />
</ItemGroup>

<Target Name="NUnit" Condition="$(Configuration)==debug" >
 <NUnit
  ToolPath="$(CCNetServer)tools\NUnit-2.5.3.9345\bin\net-2.0"
  Assemblies="@(TestAssembly)"
  OutputXmlFile="$(project_artifacts_path)NUnit-results.xml"
  ContinueOnError="true"
  WorkingDirectory="$(CCNetServer)tools\NUnit-2.5.3.9345\bin\net-2.0"
 />
</Target>

This will help you to integrate code coverage on your build tool.

More tools and resources on Unit Testing
http://www.testdriven.net/Default.aspx?tabid=27
 


While implementing Continuous Integration there was no such simple way to create ASP.Net web packages using MSBuild or NAnt. Below article is the workaround to create web setups using VS.Net development environment devenv exe.
Team Build DevEnv Task

VS 2010 introduced web packaging using MSBuild:
Web Package using VS 2010 

Deploying ASP.NET Applications article explains the manual option available in VS.Net IDE to create setups.

 


It has really been a head scratching task for me. I 've tried many options but nothing worked. Finally I found a workaround on google to achive this by TaskScheduler.

PROBLEM
When we run Teamsite user administration command line tool IWUSERADM.exe though ASP.Net it gives following error:

Application popup: cmd.exe - Application Error : The application failed to initialize properly (0xc0000142). Click on OK to terminate the application.

CAUSE
No specific cause, it seems to be a bug, supposed to be resolved with this Microsoft patch http://support.microsoft.com/kb/960266, Moreover there is nothing related to permission issue my web application is impersonated with an administrator account. offcourse running a .bat file from admin account is a potential security threat but for this scenario lets conifne our discussion to run the command line tool only.

RESOLUTION
I have not tried this patch as I have not permitted to run this patch on server. Below are the steps to achive the requirement.

1/ Create a batch file which runs the IWUSERADM.exe. 
       echo - Add Teamsite User
   CD E:\Appli\GN00\iw-home\bin
   iwuseradm add-user %1


2/ Temporarily create a schedule task and run  the .bat file by scheduled task by ASP.Net code using TaskScheduler http://www.codeproject.com/KB/cs/tsnewlib.aspx.

3/ Here is the function:
private int AddTeamsiteUser(string strBatchFilePath, string strUser)
{
//Get a ScheduledTasks object for the local computer.
ScheduledTasks st = new ScheduledTasks();
// Create a task
Task t;
try{
t = st.CreateTask("~AddTeamsiteUser");
}
catch
{
throw new Exception("Schedule Task ~AddTeamsiteUser already exist.");
}
  

t.ApplicationName = strBatchFilePath;
t.Parameters = strUser;
t.Comment = "Adding user to Teamsite Application"

t.SetAccountInformation(yourLogin, yourPassword); 
t.Save();
t.Run();


Thread.Sleep(2000); //for sync issue 

//Remove the scheduled task
st.DeleteTask("~AddTeamsiteUser");  

return t.ExitCode;
}

Calling function
//Add User in Teamsite
string strBatFilePath = ConfigurationManager.AppSettings["batFilePath"];
this.AddTeamsiteUser(strBatFilePath, domainName\UserName)

Below are few resources related to the above scenario:-
- Task Scheduler Class Library for .NET
 http://www.codeproject.com/KB/cs/tsnewlib.aspx
- Run a .BAT file from ASP.NET
 http://codebetter.com/blogs/brendan.tompkins/archive/2004/05/13/13484.aspx
- TaskScheduler Class
 http://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler.aspx
- Application Hangs whle running iwuseradm.exe through ASP.Net
 http://bytes.com/topic/asp-net/answers/733098-system-diagnostics-process-hangs

 


Here is a brief summary how we can send a text message to webpage by a web user control.
Delegates is the slolution. There are many good articles on .net delegates you can refer some of them below.

The scenario is we want to send a text message to the page on completion of some activity on webcontrol.

1/ Create a Base class for webcontrol (refer code below), assuming we are passing some text messages to page from web user control, and later inherit your web user control by this class.
 - Declare a delegate
 - Declare an event of type delegate

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;  

//Declaring delegate with message parameter
public delegate void SendMessageToThePageHandler(string messageToThePage); 

public class ControlBase: System.Web.UI.UserControl
{
public ControlBase()
{
// TODO: Add constructor logic here
}

protected override void OnInit(EventArgs e)
{
 base.OnInit(e);
}

private string strMessageToPass;

/// <summary>
/// MessageToPass - Property to pass text message to page
/// </summary>
public string MessageToPass
{
get { return strMessageToPass; }
set { strMessageToPass = value; }
}

/// <summary>
/// SendMessageToPage - Called from control to invoke the event
/// </summary>
/// <param name="strMessage">Message to pass</param>
public void SendMessageToPage(string strMessage)
{
  if (this.sendMessageToThePage != null)
      this.sendMessageToThePage(strMessage);
}

 Now Inherit as many web user control with this base class
   -  public partial class Controls_WebUserControl1 : ControlBase
  -  public partial class Controls_WebUserControl2 : ControlBase
 

 2/ Register events on webpage on page Load event
     - this.AddControlEventHandler((ControlBase)WebUserControl1);
     - this.AddControlEventHandler((ControlBase)WebUserControl2);

/// <summary>
/// AddControlEventHandler- Hooking web user control event
/// </summary>
/// <param name="ctrl"></param>
private void AddControlEventHandler(ControlBase ctrl)
{
 ctrl.sendMessageToThePage +=
delegate(string strMessage)
{
  //Display message
  lblMessage.Text = strMessage;
};
}

3/ Now Call the method SendMessageToPage(string strMessage) from web user control with the text message as parameter and this message will be displayed on your webpage (on lblMessage)

References:
http://www.akadia.com/services/dotnet_delegates_and_events.html 

 


I remember in 2006 we were working on a portal for our client Venetian, Las Vegas and the portal is full of AJAX features. One of my friend facing a challange to retain browser history with all AJAX operation. In terms of user experience it is an important aspect which could not be avoided in that scenario. Well that time we have made some workarounds to achieve the same but that may not be the perfect solution.

Ok.. Now with Microsoft AJAX there are a lot of such features can be achieved with optimum efficiency. Microsoft AJAX has grown its features over the past few years. Microsoft.Web.Preview.dll is an addon in conjunction with ASP.Net AJAX. It contains a control named "History" for that purpose.

Source code:-
http://download.microsoft.com/download/8/3/1/831ffcd7-c571-4075-b8fa-6ff678794f60/CS-ASP-ASPBrowserHistoryinAJAX_cs.zip

Below is a small sample to demonstrate the control.
1/ Get dll from the above source code bin, and add reference to your web application.
2/ Rightclick on toolbox panel and Choose Item, browse assembly. now you will be able to see History control.
3/ Add below section group in web.config under <configSections>

<sectionGroup name="microsoft.web.preview" type="Microsoft.Web.Preview.Configuration.PreviewSectionGroup, Microsoft.Web.Preview">
<
section name="search" type="Microsoft.Web.Preview.Configuration.SearchSection, Microsoft.Web.Preview" requirePermission="false" allowDefinition="MachineToApplication"/>
<
section name="searchSiteMap" type="Microsoft.Web.Preview.Configuration.SearchSiteMapSection, Microsoft.Web.Preview" requirePermission="false" allowDefinition="MachineToApplication"/>
<
section name="diagnostics" type="Microsoft.Web.Preview.Configuration.DiagnosticsSection, Microsoft.Web.Preview" requirePermission="false" allowDefinition="MachineToApplication"/>
</
sectionGroup>

4/ Now create a simple webpage a textbox (txt1), button (btn1)  in an updatePanel with History control (History1). We will fill in text box and post the fom by clicking button a few times then verify if the browse history is retained. Remember button and textbox must be inside UpdatePanel and History control outside the UpdatePanel.
<%@Page Language="C#" AutoEventWireup="true" CodeFile="History.aspx.cs" Inherits="History" %>
<%
@ Register Assembly="Microsoft.Web.Preview" Namespace="Microsoft.Web.Preview.UI.Controls" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" >
<
head runat="server">
<title>Untitled Page</title>
</
head>
<
body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"></asp:ScriptManager>
<div>
<cc1:History ID="History1" runat="server" OnNavigate="History1_Navigate">
</cc1:History>
<asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>
<asp:TextBox ID="txt1" runat="server"></asp:TextBox><br />
<asp:Button ID="btn1" runat="server" Text="Test" OnClick="btn1_Click" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="History1" />
</Triggers>
</asp:UpdatePanel>
</div>
</form>
</
body>
</
html>

5/ Below code to add the textbox value in history everytime we post back using btn1 click. 
protected void btn1_Click(object sender, EventArgs e)
{
History1.AddHistoryPoint(
"txtState",txt1.Text);
}

6/ and finally Navigate event of History control
protected void History1_Navigate(object sender, Microsoft.Web.Preview.UI.Controls.HistoryEventArgs args)
{
string strState = string.Empty;
if (args.State.ContainsKey("txtState"))
{
strState = (
string)args.State["txtState"];
}
txt1.Text = strState;
}

Now all set to go :)

Reference:
http://www.dotnetglobe.com/2008/08/using-asp.html
http://www.asp.net/learn/3.5-SP1/video-242.aspx

 


Some times when we access few CHM (compiled HTML) files over network share, CHM content doed not display and shows an error "The Page Can not be displayed".
This may be due to a Microsoft security update installed on your machine. Here is the resolution:-

========================================================================
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\HHRestrictions]
"MaxAllowedZone"=dword:00000001
"UrlAllowList"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]
"MaxAllowedZone"=dword:00000001
"UrlAllowList"=""
========================================================================

Put above content in a file and save as with .REG extension, then execute it from your machine.
Thats it.. you should be able to view your CHM files.

Reference


In my previous posts I discussed about Cruisecontrol.net and its legacy support to .Net development.

Hudson  is yet another continuous integration tool. Hudson is also free like CCNet and built in java.

- CCNet has its legacy support to .Net applications where as Hudson can be easily configured on both the environments (.Net and Java).

- One of the major differences in CCNet and Hudson is the richer GUI of Hudson provide user interactive screens for project configuration where as in CCNet we have to play with a few xml configuration files.

Both the tools are capable of providing basic features of continuous integration e.g.:-

- Source Control configuration
- Code Compilation/Build
- Ad hoc plugin tools to be configured along with compilation

Support for adhoc tools seems to be bigger with CCNet e.g. There are almost every source control plugin available with CCNet where as Hudson has support for limited source control servers.


Basically there is an interseting point to see is that there are 2 major partsof whole CI system one performed by build tool and rest. Build tool takes care of all adhoc plugin tools  so no matter if CI tool does not have plugin for that tool if thet tools provides command line support that can be configured in build tool and that build tool is then configured with CI tool inturn. For example if I have a build script configured in MSBuild and CCNet can be easily switched to Hudson. Here we need not to change anything in build script we just need to configure MSBuild on Hudson and pass the path of script file and thats it... all is same.

Hudson Resources:-
- https://hudson.dev.java.net/
- http://wiki.hudson-ci.org/display/HUDSON/Meet+Hudson
- http://wiki.hudson-ci.org/display/HUDSON/Plugins
- http://callport.blogspot.com/2009/02/hudson-for-net-projects.html

Java support on CCNet
http://confluence.public.thoughtworks.org/display/CC/Getting+Started+With+CruiseControl?focusedCommentId=19988484#comment-19988484

Please share your thoughts...


 

News

Employers
Soppa Group India
iSmart Panache Inc
R Systems Internationals Ltd
Technovate eSolutions Pvt Ltd
The contents of this blog are my personal opinion and do not represent in any way the view of my employer.
These postings are provided "AS IS" with no warranties, and confer no rights.

Google PR™ - Post your Page Rank with MyGooglePageRank.com

Archives

Post Categories

Image Galleries

Articles & Magazines

ASP.Net 2.0 Compilation

ASP.Net, Blogs I refer...

Atlas

Dost

Drivers and Software Download

Garhwal

Travel Domain

WSS and WebParts

Syndication: