Had another interesting one today whilst trying to deploy locally during a CI build using MSDeploy, I kept getting the error:

Exception calling "SyncTo" with "4" argument(s): "Connected to the destination computer ("localhost") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site."

I wanted to use integrated security but the Web Management service just wasn't playing.  So I found that you just need to enable NTLM in the registry:

  • Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\WebManagement\Server
  • Create a new DWord key called "WindowsAuthenticationEnabled"
  • Set it's value to 1
  • Restart the Web Management Service


I'm currently working on using Team City as a continous integration(CI) server rather than TFS as from my experience TFS has never really been a contender as a good CI server, it's far too limited and I might list these out one day.  For the purpose of this post I'm documenting my steps to install TeamCity for production use rather than as a play pen on someones desktop.

Prerequisites

- This presumes that SQL Server is already installed

 

  1. Download and install TeamCity from here:  http://www.jetbrains.com/teamcity/download/
  2. Install Team City with the following options:





  3. Use AD for security

    - Edit C:\TeamCity\.BuildServer\config\main-config.xml
    - Change <login-module> to jetbrains.buildServer.serverSide.impl.auth.NTDomainLoginModule
    - When you navigate to Team City for the first time you'll be prompeted to enter an admin accouint, logging in with a domain account will automatially add that user to the TC admin group

    If you find problems trying to login you can try and setup the admins again with http://localhost:8080/setupAdmin.html
  4. Enable per project permissions:  Adminstration -> Global Settings -> select "Per-Project permissions"
  5. Use SQL Server rather than the internal DB:

    - See  http://confluence.jetbrains.net/display/TCD7/Setting+up+an+External+Database#SettingupanExternalDatabase-jtds
    - I used the native SQLJDBC drivers and as per the instructions I created a database.properties file in D:\TeamCity\.BuildServer\config
    - Browse to http://localhost:8080
    - You may get an error saying that some maintenance is required, open the teamcity-server.log and copy the token key at the end of the file and use this to enter the maintenance screen
    - Click "Create Database"
    - After a while the DB will be created, as a success message I received a 404 TomCat message.  
    - Navigating to the Team City home page and running through the admin setup shows that everything is working correctly
  6. Setup SMTP Email With Exchange Server
    - Make sure you have the following "roles" installed: Web Server with IIS6 management tools option selected
    - Make sure you have the SMTP feature installed
    - Run the IIS6 Management tools and drill down to the SMTP server
    - On the SMTP server properties -> Delivery Tab -> Advanced -> [enter the smarthost address]



    - Enable relay for the local server:

  7. In Team City -> Administration -> Email Notifier -> [Set SMTP Host to 127.0.0.1]

 

Notes

 

  • If you need to reconfigure anything afterwards such as changing the TeamCity Data location then you must run C:\TeamCity\Bin\Tomcat7w.exe //ES//TeamCity  which will display a UI where the internal properties can bet set
  • Database problems:

    SEVERE: The web application [] registered the JDBC driver [org.apache.commons.dbcp.PoolingDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

 


When deleting a service using the syntax: sc delete tcbuildagent you might come across the error:

The specified service has been marked for deletion

This is an easy one to fix and no need to reboot, just close down the services window or server manger!


Posted in: Windows 2008  Tags:
Dan posted on April 19, 2012 13:20

Whilst trying to edit some work item definitions in Visual Studio 2010 I came across a nasty error:

"The format of one argument does not meet the contract of the method.  Error 0x80131537"

 

Solution

Clear all contents from C:\Users\USER_NAME\AppData\Local\Microsoft\Team Foundation\3.0\Cache

:-)


Posted in: Tools  Tags:
Dan posted on July 1, 2011 09:04

More for my reference when setting up WinRM I find myself always coming back to these pages for info:

http://msdn.microsoft.com/en-us/library/aa384372(v=vs.85).aspx

And for troubleshooting:

http://technet.microsoft.com/en-us/library/dd347642.aspx



Posted in: PowerShell  Tags:

In PowerShell you can use the Web Administration Provider to administror IIS with PowerShell, these cmdlets are very useful and there are numerous samples around demonstrating how to manage IIS but I still struggled to find out how to do certain things like modifying IIS bindings for a site.

Here's some useful Powershell IIS sniippets that I found useful:

Return all bindings for a site

Get-WebBinding -Name "SiteName"

Return all HTTP bindings for a site

Get-WebBinding -Name "SiteName" | where-object {$_.protocol -eq "http"}

 


Posted in: PowerShell  Tags: , ,

 

I've been working with PowerShell recently to automate our deployments particularly around IIS so more for my benefit I'm starting a Powershell tips section containing things that I need to remember or others routines that I couldn't easily find on the Internet.

So for my first tip:  How to Update IIS Virtual Directories With Powershell

 

import-module webadministration


Set-Location 'IIS:\Sites\XpertHR.Blue'

foreach ($item in Get-Childitem 'IIS:\Sites\SiteName.Blue' | 
         where {$_.Schema.Name -eq 'Application'}) {

 $item.PhysicalPath = $item.PhysicalPath.Replace("Blue", "Green")

 set-itemproperty $item.PSPath -name physicalPath -Value 
       $item.PhysicalPath.Replace("Blue", "Green")

 Write-Host $item 

}

Posted in: IIS7 , PowerShell  Tags: , ,
Dan posted on February 28, 2011 13:38

Doing some wix work at the moment and came across the need to default some varibles if they weren't passed in to candle.  In my case we have a private build that creates an installer for an application but as it's a private build we don't have a version number (well we do but it's 1.0.0.0 to denote developer build).

Anyway the below code defines a varible if it doesn't exist:

<?ifndef ProductVersion ?>
<?define ProductVersion="1.0.0.0" ?>
<?endif ?>

<Product Id="*" Name="AppName" Language="1033" Version="$(var.ProductVersion)" Manufacturer="ATeam" UpgradeCode="$(var.UpgradeCode)">

 

 


Posted in: wix  Tags: ,
Dan posted on February 17, 2011 15:14

Had a nasty one today that had me scratching my head.  On our TFS build server for one particular build it suddenly stopped when we executed tf.exe  checkout commands with the error:

Unable to determine the workspace

I tried a few things but in the end it was down to the workspace cache so to resolve:

 

- Log in to the build server as the account running the Visual Studio Team Foundation Build service

- Shell out to a command prompt and make sure you can execute the tf.exe command (normally in %programfiles%\Microsoft Visual Studio 10.0\Common7\IDE )

- run tf workspaces /remove:*

- run tf workspaces /s:http://tfscontroller:8080   (performs a refresh)

Try the build again!

If it still fails then it's possible that the file you are trying to checkout is not actually part of the workspace in which the case the error message is actually right.

 


Posted in: TFS  Tags:

I’ve just started to look at SharePoint 2010 and from first glances it seems to be a bit nicer than SharePoint 2007 in terms of look and functionality for developers.  Anyway the purpose of this post is to describe getting a fresh install of SharePoint 2010 working with Visual Studio 2010 to debug a straight forward hello world web part.

So once you’ve got your server built and ready to go and if you try and follow the MSDN HelloWorld sample http://msdn.microsoft.com/en-us/library/ms415817.aspx you will more then likely encounter the following errors.

Error occurred in deployment step 'Activate Features': Cannot start service SPUserCodeV4 on computer '[server]'.

This one is quite straight forward just fire up Server Manager –> Services and make sure that the “SharePoint 2010 User Code Host” service is enabled and set to start up automatically.

Next if you try and build your project you’ll receive:

Error occurred in deployment step 'Activate Features': This feature cannot be activated at this time. The contents of the feature's solution requires the Solution Sandbox service to be running.

To fix go to Central Administration
Under "System Settings" -> Manage servers in this farm
You'll see a list of services running, click on the server name.
Make sure "Microsoft SharePoint Foundation Sandboxed Code Service " is enabled.

Job done!  Apparently this is by design as an out of the box install.  Why doesn’t the MSDN HelloWorld artiicle tell you about these fundamental things!?


Posted in: Sharepoint  Tags:

Calendar

«  May 2012  »
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
View posts in large calendar

Recent Comments

Banners

Theme Grabber
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012 Dan Gibbons .Net Developer