Tuesday, 16 October 2012

Enable Treat Warnings as Errors in TFS Build

Hi ,


Here you go with the settings so that the warning will get treated as error in Team Build(TFS 2010).

Provide below value for the section MSBuild Arguments(See screen shot)

/p:TreatWarningsAsErrors="true"

 
And after that all the warnings would get treated as error J

VS2010 vs. SQL Assistant

Hi guys,


My VS2010, started acting VERY weird! Upon startup, it gave my mysterious errors like “Could not load module this and that”.

And when I tried to open a solution, it just “Stopped working”, asking me if I wanted to debug the program. Yeah right, let me just debug visual studio 


Anyways, I ran devenv.exe with the /log switch, and got a pretty sweet XML file. It pointed me to what errors did occur during startup.


I did a Google search, and stumbled across this one: http://www.softtreetech.com/support/phpBB2/viewtopic.php?p=27786&sid=24857705cf905400d2125e79a4b72565

I realized that I just installed SQL Assistant, and guess what, I did not check the checkbox “ Integrate with Visual Studio 2010”. Just as the above link explains.


One guy at the forum, puts it down this way:


I found a solution. I installed SQL Assist with the the Visual Studio Addin checked, even though I don't want it.

Your installer is telling Visual Studio to load the Addin, even if you don't choose to install it.

Well, that’s what I did as well, and now it’s working.
Thanks,

Monday, 8 October 2012

TFS2010: Reconcile Workspace after Gated Checkin is weird if Visual Studio 2010 is Elevated

The Gated Check-in builds in TFS2010


A nice Article to read about “The Gated Check-in build in TFS2010”.

Here you go with the link

Thanks,
Md. jawed

Unattained Installation of Team Visual Studio 2012


Before we start our Silent Installation of Visual Studio 2012. We have to take care of few as mention below:
1.       IF SOURCE FOLDER CONTAINS SPACE(S) ANYWHERE IN THE ENTIRE PATH, INSTALLATION WILL FAIL.
2.       Create a copy of AdminDeployment.xml (to serve as backup in case any unwanted changes occur in original file)

3.        Change value of attribute NoWeb="default" to NoWeb="yes" in AdminDeployment.xml. See the highlighted section.
ORIGINAL:
http://schemas.microsoft.com/wix/2011/AdminDeployment
">
   NoWeb="default"/>
  

CHANGED:
http://schemas.microsoft.com/wix/2011/AdminDeployment
">
   NoWeb="yes"/>
  
3. Copy CHANGED AdminDeployment.xml into packages sub-folder of SOURCE FOLDER.
Now the below Script will do the magic to installed VS2012 in Silent, Unattained mode.
@echo off
echo ========================================================
set application=Visual Studio 2012 Premium
SET ERRORLEVEL=0
SET sourceLocation=D:\VS2012Premium\
SET setupFile=%sourceLocation%vs_premium.exe
SET adminFile=%sourceLocation%AdminDeployment.xml
SET logFileLocation="D:\Logs\Installations\vs2012_premium.log"
echo Installing %application% ....
echo SourceLocation=%sourceLocation%
echo setupFile=%setupFile%
echo adminFile=%adminFile%
echo logLocation=%logFileLocation%
:check
IF EXIST "%setupFile%" goto run
echo sourceLocation doesnot exist
SET ERRORLEVEL=1
goto end
:run
echo running installation file.....
"%setupFile%" /adminfile "%adminFile%" /quiet /norestart
:end
IF %ERRORLEVEL% == 0 (
                ECHO instalation done SUCCESSFULLY.
) ELSE (
                ECHO instalation FAILED. ERROR LEVEL %ERRORLEVEL%.
)
echo ========================================================
pause
exit
~jawed

Unattained Installation of Team Foundation Server 2012


Here you go with the command to installed Team Foundation Server 2012 silently or Unattained.

Create bat file and name it’s as TFS2012.cmd file.  And paste the below code in TFS2012.cmd,
When you are done just double click the cmd for some time and you are done with the installation of tfs2012.
                @echo off
echo ========================================================
set application=Team Foundation Server 2012 x64
SET ERRORLEVEL=0
set sourceLocation="D:\Team Foundation Server 2012\Team Foundation Server 2012 x64\tfs_server.exe"
set logFileLocation="D:\Logs\Installations\TFS2012-X64.log"
echo Installing %application% ....
echo SourceLocation=%sourceLocation%
echo logLocation=%logFileLocation%

:check
IF EXIST %sourceLocation% goto run
echo sourceLocation doesnot exist
SET ERRORLEVEL=1
goto end

:run
echo running installation file.....
%sourceLocation% /q /i /norestart /l*v %logFileLocation%

:end
IF %ERRORLEVEL% == 0 (
                ECHO instalation done SUCCESSFULLY.
) ELSE (
                ECHO instalation FAILED. ERROR LEVEL %ERRORLEVEL%.
)
echo ========================================================
pause
exit

Thanks,
Md. Jawed

Thursday, 4 October 2012

What's New with TFS 2012

Javascript unit tests using QUnit

I would like to recommend you few links which would be helpful for you to go ahead.



To know more about QUNIT and create you first script suing Qunit you can follow below link:

http://net.tutsplus.com/tutorials/javascript-ajax/how-to-test-your-javascript-code-with-qunit/

To Integrate JavaScript Unit testing into your website and enables to run JavaScript unit tests from Visual studio you can look into below open source tool.

http://chutzpah.codeplex.com/

Hope this would help you!!

Thanks!!

Announcing Git Integration with TFS

http://blogs.msdn.com/b/bharry/archive/2012/08/13/announcing-git-integration-with-tfs.aspx


Wednesday, 29 August 2012

Tracker Response files not found (Tracker.exe)

Few Days Back while building one of the project we were getting below error continuously.


On looking in to msdn we finally got the workaround solution for this issue.








Solution:
Edit the build definition (Team Explorer => solution => builds => (select your build definition) right click Edit Build Definition => Process (on left) => 3. Advanced => under MSBuild Arguments paste the following:

/p:TrackFileAccess=false

from http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/baf16a4b-c25d-4722-a844-6276344b0db2

Here are words from MSBuild Developer from Microsoft.

The trigger for the error is that the GenerateResource task must be run during the build in such a way that we embed FileTracker (a tool we have been using for up-to-date check) in the process itself -- when targeting 4.0, when targeting 3.5 on a 32-bit machine, or when targeting 3.5 on a 64-bit machine when running 64-bit MSBuild.

To work around the error, you can either set TrackFileAccess=false, as has already been observed, or if you're on a 64-bit machine and targeting 3.5 exclusively, the error should also go away if you start using 32-bit MSBuild instead.

TrackFileAccess=false works around the error by turning off the use of FileTracker; the downside is that that means the you will no longer be able to use FileTracker-based up-to-date check, so your VS 2010 C++ projects and your GenerateResource task invocations will now always build, even when there have been no changes -- the latter generally causing a cascading rebuild for the managed compilers as well, since they consume the .resources files.

Thanks,
Sara Joiner
Developer, MSBuild

For more Info you can visit below links.
https://connect.microsoft.com/VisualStudio/feedback/details/508650/tracker-response-file-not-found


Feel free to provide your comments and suggestion.
Thanks!!
MD. Jawed

NetTcpPortSharing service: failed to start the service

Few Days back when I was running and build, it started throwing an exception as:
The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: failed to start the service because it is disabled.
An administrator can enable it by running 'sc.exe config NetTcpPortSharing start= demand'..
---> System.InvalidOperationException: Cannot start service NetTcpPortSharing on computer '.'. ---> System.ComponentModel.Win32Exception: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
Solution
To enabled, run the following command in console windows as mention in the error log
sc.exe config NetTcpPortSharing start= demand

 



To disable it, run the following command in a console window.
sc.exe config NetTcpPortSharing start= disabled


And after that run you build once again. I'm sure it would not throw any error next time.


Thanks,
Md. Jawed

Tuesday, 28 August 2012

Add an Alert on TFS when a build failed or partially succeeded

To get the notification related to your build you have launched the Team Foundation Build Notification tool to have a small popup alert every time a build finishes and starts.
But now you would like to go a bit further and receive a mail with the build result every time a build fails (or let's say do not succeed).
Use the TFS' alerts
The Team Foundation Server includes a powerful alert system, but by default, you cannot do so many things.




Use the Team Foundation Server Power Tools
If the Project Alerts does not allow so many things, the underlying alert system is very powerful. And you can use the Team Foundation Server Power Tools  that allow a very fine control of the alerts.





You can then create a new rule like the following one : 





Note that for the Send To field, you can either indicate an account name, or an email address. In the case of an account name, this corresponds to an AD account, and you must have configured the email address of that person in the Active Directory.


~jawed

Build Failed with an error as SGEN: Unable to generate a temporary class (result=1). SGEN: Internal compiler error (0xc00000fd) SGEN: Out of memory

One of the build were continuously failing with an error as


 
But in other hand the same build were getting succeeded on 32 bits Build agent machine.
Then we triggered the same build on our other 62 bits Build agent and we found that all 62 bits build agent are giving the same error while compiling this build.
And finally we came to this conclusion that the versioning of MSBUILD.exe which is creating an issue not the Build agent machine.
It means to run the same build with green we have to trigger the build on 62 bits build agent but force them to take 32 bits MSBuild.exe to run this Build.
To do this we have to perform this.
Edit Build Definition
Processes ->Advance-> MSBuild Platform-> X86.

 
Thanks,
MD. Jawed

Monday, 27 August 2012

Script to installed Visual Studio 2008 SDK in Silent mode

Here is the script to installed Visual Studio 2008 SDK in Silent Mode:

@echo off


echo ========================================================

set application=Visual Studio 2008 SDK v 1.1

SET ERRORLEVEL=0

set sourceLocation="D:\Applications\Visual Studio 2008 SDK v 1.1\VsSDK_sfx1_1.exe"

set logFileLocation= "D:\Logs\Installations\Visual Studio 2008 SDK v 1.1.log"

echo Installing %application% ....

echo SourceLocation=%sourceLocation%

echo logLocation=%logFileLocation%

set dest="D:\Logs\VsSDK_sfx1_1.exe"

set destfolder="D:\Logs\"

set destMsi="D:\Logs\vssdk.msi"
:check

IF EXIST %sourceLocation% goto run

echo sourceLocation doesnot exist

goto end

:run
echo copying the exe file to local drive

copy %sourceLocation% %dest%

echo extrating the file

%dest% /x:%destfolder% /q
echo running the setup file now

msiexec /q /i %destMsi% /l*v %logFileLocation%


:end

IF %ERRORLEVEL% == 0 (

ECHO instalation done SUCCESSFULLY.

) ELSE (

ECHO instalation FAILED. ERROR LEVEL %ERRORLEVEL%.

)

echo ========================================================

pause

 exit     ============= Thanks, Md. Jawed

Friday, 20 April 2012

Tutorial: Getting Started with Microsoft Visual Studio Team Foundation Server 2010

A nice Tutorial, if you are interested into knowing about TFS 2010.
Below is the link for the same.

http://msdn.microsoft.com/en-us/library/dd286491.aspx


Thanks,
Md. Jawed

Wednesday, 15 February 2012

Custom error reporting in ASP.NET by using C# .NET

The title sound interesting right. So, in this post we are going to discuss about the custom error reporting in ASP.Net application.


                                                    source Code

We are going to use C#.Net code to trap and respond to errors when they occur in the ASP.net or rather I would say in our web application.

To trap the errors occurs we have written a separate class with the name ExceptionLog.cs, and we are using Global.asax to know about the error and trap through our ExceptionLog.cs class file and record the details into text file.

ExceptionLog.cs file:

In the class file we will write our logic to trap the errors occurred in application and logged that error details into text file.


The Log File:

As I had mentioned that the error details would get logged in textile with the name ErrorLog.txt




Global.asax

We will use the benefit of Global.asax to call error trap method on any Application error.

To know more about the Global.asax file you can visit below links:

1. http://en.wikipedia.org/wiki/Global.asax

2. http://msdn.microsoft.com/en-us/library/1xaas8a2(v=vs.71).aspx

3. http://www.dotnetcurry.com/ShowArticle.aspx?ID=126

4. http://support.microsoft.com/kb/306355

So here is the piece of code to catch the error occurred in the application and logged those into text file through our custom error logged class.



Hope it will be useful for you!!

Feel free to provide your comments and any suggestions!!

~jawed

Saturday, 11 February 2012

My Name in the list of winners at C-sharp corner for the month of December, 2011.


I was unable to express my happiness when I saw my name in the list of winners. 
While posting any article on http://www.c-sharpcorner.com ,I never thought that my name would get listed over there with in 2 months .

But now this became true. All this happen due to all my readers’ comments and suggestion which gave me courage to write more and more.
Thanks to all my readers, http://www.c-sharpcorner.com and mentors who encourage me share my knowledge and experience.

These kinds of encouragement provide me a better and nice path to share my knowledge/experience with much bigger audiences. 

Lists of winners:


Thanks,
Md. jawed

Tuesday, 31 January 2012

http://seleniumdotnet.blogspot.com

Hello All, it’s giving me intense pleaser to share that now I have started one more blog. That is http://seleniumdotnet.blogspot.com./


In this blog I’m going to share my learning about selenium web driver in .net using C#.

If you have any issues related to selenium dot net then feel free to visit this blog and feel free to provide your valuable comments and suggestion. Thanks!!

One glimpse of the blog:


http://seleniumdotnet.blogspot.com.

Thanks,
Md. Jawed
http://seleniumdotnet.blogspot.com./


Tuesday, 24 January 2012

Let's customize Google to show previous searchs by Hitesh Sharma

while going through code project website i show one article published by Hitesh sharma.
which catches my eyes with his nice idea and explanation of the article.
awesome!!
here is little introduction:
Introduction


Usually when I Google something there are a good amount of chances that I'll be googling the same thing again after a few days to recollect whatever I learned last time. So I run Internet Explorer and look into the history if I feel like hitting the search button again with the same keywords as I used last time to get the results I am looking for. This works great but one day I just wondered that why doesn't google shows recently searched text on its page, if it does so it will provide Googlers much ease. Certainly since I can't approach Google with the idea so I decided to customize google for my machine so that it may show me whatever I looked for last few times

you can visit this link to get the more details about the artile.

Let's customize Google to show previous searchs



Sunday, 22 January 2012

Google Automation-Automated Testing Search Engine


While I was reading Sep 2011 issue of Automated Software Testing Magazine, but at one page my eye got stuck, where the publisher has partnered with Google to create a software test automation search engine. I tried this and its work great it means gave my all search related to automation.
So here is the word complied for the same magazine.

“The Automated Testing Institute has partnered with Google to create a software test automation search engine. If your are looking for the software test automation information, you will get the best results by using this search engine, because it only searches the sites that matter most to automators. You can also restrict searches to blogs and forum sites."





Enjoy happy automation.
Thanks,
Md. jawed

Monday, 16 January 2012

Script to Get Microsoft Product Installed on your machine with version Number

Few days back I was working on build machine. Or you can say I need to release new build machine installed with some specific software.


To achieve this I wrote few bat file to installed particular software silently.

But to verify this whether that software or application has been installed or not I need to check this through control panel. It was kind of manual process.

So avoid this manual process I came across bat file or VBscript file which will list out the entire Microsoft product with version number installed on that particular machine.

First I will show you the bat file to write the entire product with version list in test file:

echo CompanyName SoftwareInstalled VersionNumber>ListOfMicroSoftware.txt


echo ===========================================>>ListOfMicroSoftware.txt
cscript //nologo D:\Install-Jawed\GetListOfSoft.vbs >>ListOfMicroSoftware.txt
 
 
Now here is the logic written in VBscript file.
On Error Resume Next

Const strComputer = "."
Const HKLM = &H80000002
Const strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
Dim oReg, arrSubKeys, strProduct, strDisplayName, strVersion
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
' Enumerate the subkeys of the Uninstall key
oReg.EnumKey HKLM, strKeyPath, arrSubKeys
For Each strProduct In arrSubKeys
' Get the product's display name
oReg.GetStringValue HKLM, strKeyPath & "\" & strProduct, "DisplayName", strDisplayName
' Process only products whose name contain 'Microsoft'
If InStr(1, strDisplayName, "Microsoft", vbTextCompare) > 0 Then
' Get the product's display version
oReg.GetStringValue HKLM, strKeyPath & "\" & strProduct, "DisplayVersion", strVersion
WScript.Echo strDisplayName &"======"& vbTab &"===========================================" & strVersion
End If
Next



 
Click on bat file and it will generate the text file with all products with version number.


Thanks,
Md. jawed

Thursday, 12 January 2012

Enable Sound when Breakpoint is hit in Visual Studio 2010

It is really interesting and funny to let Visual studio make sound or give some signal that it hit break point.


So here is the tips to do the same. I have done this in windows 7 machine. Might be for other OS setting would be different.

First look at the below snap shot.




Steps:
1. Go to Control Panel.
2. Click on Hardware and Sound. A different window appears.
3. On new popup window click on Change System sounds. A different pop window would appear, refer above snap shot.
4. Select sound tab and scroll down to Microsoft Visual Studio.
5. Select Break point Hit.
6. Now select your desired sound from Sounds drop down menu.
7. Click on Apply and then ok.

Now you are ready to hear the Hit sound, whenever visual studio would hit the breakpoint.

Happy Debugging.

Thanks,

Md. Jawed

 

Wednesday, 11 January 2012

Deploy your web application other than default Web Site virtual directory using wix template

The below wix template would create a MSI to deploy your application under different virtual directory. It means it would not create your directory under Default Web Site.


So here is the price of code to do the same.

To know more about Wix you can Google it and you will loads of information of various sites.



Let me know your feedback or for any questions.

HTTP Status Code returns by IIS

Below is the detail of all HTTO status code which return by IIS and this code indicates the status of the response.


I complied this information from http://support.microsoft.com/kb/943891 for more details you can visit above link.
 
Images taken from http://www.tutorialchip.com/wp-content/uploads/2010/12/HTTP-Status-Code-List.gif


The HTTP status codes

1xx - Informational

These HTTP status codes indicate a provisional response. The client computer receives one or more 1xx responses before the client computer receives a regular response.

IIS 7.0 uses the following informational HTTP status codes:

• 100 - Continue.
• 101 - Switching protocols.

2xx - Success

These HTTP status codes indicate that the server successfully accepted the request.

IIS 7.0 uses the following success HTTP status codes:

200 - OK. The client request has succeeded.
• 201 - Created.
• 202 - Accepted.
• 203 - Nonauthoritative information.
• 204 - No content.
• 205 - Reset content.
• 206 - Partial content.

3xx - Redirection

These HTTP status codes indicate that the client browser must take more action to fulfill the request. For example, the client browser may have to request a different page on the server. Or, the client browser may have to repeat the request by using a proxy server.



IIS 7.0 uses the following redirection HTTP status codes:

• 301 - Moved permanently.
• 302 - Object moved.
• 304 - Not modified.
• 307 - Temporary redirect.

4xx - Client error

These HTTP status codes indicate that an error occurred and that the client browser appears to be at fault. For example, the client browser may have requested a page that does not exist. Or, the client browser may not have provided valid authentication information.



IIS 7.0 uses the following client error HTTP status codes:

• 400 - Bad request. The request could not be understood by the server due to malformed syntax. The client should not repeat the request without modifications.



IIS 7.0 defines the following HTTP status codes that indicate a more specific cause of a 400 error:

o 400.1 - Invalid Destination Header.
o 400.2 - Invalid Depth Header.
o 400.3 - Invalid If Header.
o 400.4 - Invalid Overwrite Header.
o 400.5 - Invalid Translate Header.
o 400.6 - Invalid Request Body.
o 400.7 - Invalid Content Length.
o 400.8 - Invalid Timeout.
o 400.9 - Invalid Lock Token.
• 401 - Access denied.

IIS 7.0 defines several HTTP status codes that indicate a more specific cause of a 401 error. The following specific HTTP status codes are displayed in the client browser but are not displayed in the IIS log:

o 401.1 - Logon failed.
o 401.2 - Logon failed due to server configuration.
o 401.3 - Unauthorized due to ACL on resource.
o 401.4 - Authorization failed by filter.
o 401.5 - Authorization failed by ISAPI/CGI application.
• 403 - Forbidden.


IIS 7.0 defines the following HTTP status codes that indicate a more specific cause of a 403 error:

o 403.1 - Execute access forbidden.
o 403.2 - Read access forbidden.
o 403.3 - Write access forbidden.
o 403.4 - SSL required.
o 403.5 - SSL 128 required.
o 403.6 - IP address rejected.
o 403.7 - Client certificate required.
o 403.8 - Site access denied.
o 403.9 - Forbidden: Too many clients are trying to connect to the Web server.
o 403.10 - Forbidden: Web server is configured to deny Execute access.
o 403.11 - Forbidden: Password has been changed.
o 403.12 - Mapper denied access.
o 403.13 - Client certificate revoked.
o 403.14 - Directory listing denied.
o 403.15 - Forbidden: Client access licenses have exceeded limits on the Web server.
o 403.16 - Client certificate is untrusted or invalid.
o 403.17 - Client certificate has expired or is not yet valid.
o 403.18 - Cannot execute requested URL in the current application pool.
o 403.19 - Cannot execute CGI applications for the client in this application pool.
o 403.20 - Forbidden: Passport logon failed.
o 403.21 - Forbidden: Source access denied.
o 403.22 - Forbidden: Infinite depth is denied.
o 403.502 - Forbidden: Too many requests from the same client IP; Dynamic IP Restriction limit reached.
• 404 - Not found.

IIS 7.0 defines the following HTTP status codes that indicate a more specific cause of a 404 error:

o 404.0 - Not found.
o 404.1 - Site Not Found.
o 404.2 - ISAPI or CGI restriction.
o 404.3 - MIME type restriction.
o 404.4 - No handler configured.
o 404.5 - Denied by request filtering configuration.
o 404.6 - Verb denied.
o 404.7 - File extension denied.
o 404.8 - Hidden namespace.
o 404.9 - File attribute hidden.
o 404.10 - Request header too long.
o 404.11 - Request contains double escape sequence.
o 404.12 - Request contains high-bit characters.
o 404.13 - Content length too large.
o 404.14 - Request URL too long.
o 404.15 - Query string too long.
o 404.16 - DAV request sent to the static file handler.
o 404.17 - Dynamic content mapped to the static file handler via a wildcard MIME mapping.
o 404.18 - Querystring sequence denied.
o 404.19 - Denied by filtering rule.
o 404.20 - Too Many URL Segments
• 405 - Method Not Allowed.
• 406 - Client browser does not accept the MIME type of the requested page.
• 408 - Request timed out.
• 412 - Precondition failed.

5xx - Server error

These HTTP status codes indicate that the server cannot complete the request because the server encounters an error.

IIS 7.0 uses the following server error HTTP status codes:

• 500 - Internal server error.

IIS 7.0 defines the following HTTP status codes that indicate a more specific cause of a 500 error:

o 500.0 - Module or ISAPI error occurred.
o 500.11 - Application is shutting down on the Web server.
o 500.12 - Application is busy restarting on the Web server.
o 500.13 - Web server is too busy.
o 500.15 - Direct requests for Global.asax are not allowed.
o 500.19 - Configuration data is invalid.
o 500.21 - Module not recognized.
o 500.22 - An ASP.NET httpModules configuration does not apply in Managed Pipeline mode.
o 500.23 - An ASP.NET httpHandlers configuration does not apply in Managed Pipeline mode.
o 500.24 - An ASP.NET impersonation configuration does not apply in Managed Pipeline mode.
o 500.50 - A rewrite error occurred during RQ_BEGIN_REQUEST notification handling. A configurationr inbound rule execution error occurred.


Note Here is where the distributed rules configuration is read for both inbound and outbound rules.


o 500.51 - A rewrite error occurred during GL_PRE_BEGIN_REQUEST notification handling. A global configuration or global rule execution error occurred.
Note Here is where the global rules configuration is read.
o 500.52 - A rewrite error occurred during RQ_SEND_RESPONSE notification handling. An outbound rule execution occurred.
o 500.53 - A rewrite error occurred during RQ_RELEASE_REQUEST_STATE notification handling. An outbound rule execution error occurred. The rule is configured to be executed before the output user cache gets updated.
o 500.100 - Internal ASP error.
• 501 - Header values specify a configuration that is not implemented.
• 502 - Web server received an invalid response while acting as a gateway or proxy.

IIS 7.0 defines the following HTTP status codes that indicate a more specific cause of a 502 error:

o 502.1 - CGI application timeout.
o 502.2 - Bad gateway.
• 503 - Service unavailable.



IIS 7.0 defines the following HTTP status codes that indicate a more specific cause of a 503 error:

o 503.0 - Application pool unavailable.
o 503.2 - Concurrent request limit exceeded.

More information you can visit below site:

http://support.microsoft.com/kb/943891

Thanks,
Md. jawed

Copy files from source directory to target directory using Xcopy in C#.

If you are interested to copy files and folder to target location using Xcopy then just use the below piece of code to perform you desired operation.
private static void ProcessXcopy(string SolutionDirectory, string TargetDirectory)

{
     // Use ProcessStartInfo class
    ProcessStartInfo startInfo = new ProcessStartInfo();
    startInfo.CreateNoWindow = false;
    startInfo.UseShellExecute = false;
    startInfo.FileName = "xcopy";
    startInfo.WindowStyle = ProcessWindowStyle.Hidden;
    startInfo.Arguments = "\"" + SolutionDirectory + "\"" + " " + "\"" + TargetDirectory + "\"" +          
                                                                                                                                      @" /e /y /I";
    try
    {
         using (Process exeProcess = Process.Start(startInfo))
          {
             exeProcess.WaitForExit();
          }
    }
catch (Exception exp)
    {
         throw exp;
    }
}

Thanks,
Md. jawed

Get Assembly Version

Below code would help you get the Assembly version.
This code also stamp the build version in a file where you want to write the build version.
The build version is nothing but versioning provided after building the Project from tfs.
so here the code:
///

/// This method will get the version
///
/// return version of version as string
private static string GetVersion()
{
Assembly assembly = Assembly.GetExecutingAssembly();
FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);
return fileVersionInfo.ProductVersion;
}

Thanks,
Md. jawed