Archive

Posts Tagged ‘.NET’

Using TFS 2010 Team Build Web Deployment with IIS 6

December 13th, 2010 1 comment

We recently attempted to get a Visual Studio 2010 web project set up for automatic deployment using Team Foundation Server 2010. There are plenty of blog posts outlining the setup procedure when deploying to IIS 7 but there is minimal documentation on deploying to IIS 6.

After digging we ended up with the following MSBuild parameters which worked on our dev laptops using msbuild.exe but didn’t work on our Team Build server:

/p:DeployOnBuild=true
/p:DeployTarget=MSDeployPublish
/p:MSDeployPublishMethod=RemoteAgent
/p:DeployIisAppPath="Default Web Site/(directory>)"
/p:MsDeployServiceUrl="http://(webserver)/msdeployagentservice"
/p:username=****
/p:password=****

When running a Team Build, the build failed with the following error:

C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\
Microsoft.Web.Publishing.targets (1657): The "MapUriToIisWebServer" task failed unexpectedly. 
System.Runtime.InteropServices.COMException (0x80005000): Unknown error (0x80005000) 
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_IsContainer()
at System.DirectoryServices.DirectoryEntries.CheckIsContainer()
at System.DirectoryServices.DirectoryEntries.Find(String name, String schemaClassName)    
at Microsoft.Web.Publishing.Tasks.MapUriToIisWebServer.get_IisMajorVersion()
at Microsoft.Web.Publishing.Tasks.MapUriToIisWebServer.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, 
TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, 
TaskExecutionMode howToExecuteTask, Boolean& taskResult)

When we ran msbuild.exe on the project locally using the same parameters we noticed the following warning in the output (in bright yellow):

Validating Web Deploy package/publish related properties... 
C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3436,5): warning : Setting both property values of DeployAsIisApp and IncludeIisSettingsOnPublish to true is not recommended, as IncludeIisSettingsOnPublish is a superset of DeployAsIisApp [(projectfile).csproj]

Our solution for getting the deployment working with IIS 6 was simply to append the following additional MS Build parameter:

/p:IncludeIisSettingsOnPublish=false

Seeking a GIS Developer to Join Our Team

September 13th, 2010 Comments off

This position has been filled.

My development team is currently looking for a mid-level GIS Developer.

We are looking for someone that has experience in ArcObjects and ArcGIS Server development and administration but that is also interested in moving more into “Web 2.0″ GIS application development (RESTful services, ArcGIS Server JavaScript API, Dojo, ASP.NET MVC, WCF etc.).

Our team develops primarily in C# and makes extensive use of the Visual Studio Team System. We develop software using the Scrum software development framework, allowing us to be agile and to work closely with our customers.  We have a team room available to us that provides an excellent team collaboration space.

We value high quality software and we use continuous integration (automated builds, automated unit testing, static code analysis and automated test deployments) to allow us to develop software rapidly.

If you think you have the skills and you are interested in shaping the future of Denver’s GIS program apply online at http://www.denvergov.org/jobs.

Note: The position is listed as ‘Associate GIS Developer’.

New Team Foundation Server 2010 Scrum Template

June 9th, 2010 Comments off

Microsoft has just released a new Scrum process template (beta) for Team Foundation Server 2010.

From the Visual Studio Gallery:

Team Foundation Server Scrum v1.0 is a new process template from Microsoft built for Scrum teams.   Scrum is an iterative, incremental framework for project management and agile software development.  This template includes work items and reports to help your Scrum team be successful.   Click here more information and a detailed FAQ.

This template includes:

  • Work Item Types
    • Product Backlog Item
    • Bug
    • Task
    • Impediment
    • Test Case
    • Sprint
  • Reports
    • Release Burndown
    • Velocity
    • Sprint Burndown
  • SharePoint Project Portal

More details on the new Scrum process template from bharry.

Convert WCF Binding to a Custom Binding

June 8th, 2010 Comments off

A recent post on Aggregated Intelligence pointed out WCF Binding Box, an excellent tool that allows you to convert an out-of-the-box WCF binding to a custom binding configuration.

I had to give this another mention as this is a huge time saver if your use case doesn’t quite fit the default WCF binding scenarios and you don’t want to start from scratch with a custom binding

Categories: Software Development, Windows Tags: , , ,

We’re Hiring! (Senior GIS Developer)

May 26th, 2010 Comments off

This position has been filled.

My development team is currently looking for a talented Senior GIS Developer to join us in building innovative solutions for the Geoweb.

We are looking for someone that has strong “Web 2.0″ development experience including strong JavaScript skills (Dojo and/or jQuery experience is a big plus).

Our team is skilled in the latest technologies including ArcGIS Server, the ArcGIS Server JavaScript API, Dojo, ASP.NET MVC, WCF (SOAP and RESTful JSON services), Entity Framework and the Visual Studio Team System.

Our team develops software using the Scrum software development framework, allowing us to be agile and to work closely with our customers.

We value high quality software and we use continuous integration (automated builds, automated unit testing, static code analysis and automated test deployments) to allow us to develop software rapidly.

We now have a team room (new last year!) that provides an excellent team collaboration space.

If you think you have the skills and you are interested in shaping the future of Denver’s GIS program apply online at http://www.denvergov.org/jobs.

Implementing a Minimal SOAP 1.2 Binding in WCF

May 6th, 2010 4 comments

This post decribes a method for creating a minimal SOAP 1.2 binding for a WCF service.  If you need to create a basic SOAP 1.1 binding take a look at my post on WCF Interoperability with SOAP 1.1 and SOAP 1.2 Clients.

WCF provides several pre-configured bindings for SOAP services that implement common binding scenarios. If the provided binding configurations do not meet your needs you can also create custom bindings.

A WCF service created from the Visual Studio template will by default use the WSHttpBinding configuration. This binding implements SOAP 1.2 over HTTP with the following features (as described on MSDN):

The WSHttpBinding is similar to the BasicHttpBinding but provides more Web service features. It uses the HTTP transport and provides message security, as does BasicHttpBinding, but it also provides transactions, reliable messaging, and WS-Addressing, either enabled by default or available through a single control setting.

In many cases you won’t need some of these features (like WS-Addressing or Secure Context Tokens) and I like to keep the binding as simple as possible for interoperability with other clients.

To do so you can create a custom binding and set it as the endpoint binding of your service. The following is a custom binding that provides a basic implementation of SOAP 1.2 over HTTP. You will need to add this custom binding to the web.config for your WCF project (I have left out the rest of the web.config for brevity).

<system.serviceModel>
    <bindings>
      <customBinding>
         <binding name="httpSoap12">
           <textMessageEncoding messageVersion="Soap12"/>
           <httpTransport />
         </binding>
      </customBinding>
    </bindings>
  </system.serviceModel>

Now on your service endpoint in the web.config set the “binding” parameter to “customBinding” and set the “bindingConfiguration” parameter to the name of the custom binding (in this case “httpSoap12″).

<endpoint name="Service1Soap12" address="soap12" binding="customBinding" bindingConfiguration="httpSoap12" contract="InteroperableWcfService.IService1"/>

Before and After

Here is what a sample request looks like with the default BasicHttpBinding

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
               xmlns:tem="http://tempuri.org/">
  <soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Action>http://tempuri.org/IService1/GetData</wsa:Action>
    <wsa:To>http://localhost:5558/Service1.svc</wsa:To>
  </soap:Header>
  <soap:Body>
    <tem:GetData>
      <tem:value>1</tem:value>
    </tem:GetData>
  </soap:Body>
</soap:Envelope>

And here is what a sample request now looks like with the minimal binding.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/">
   <soap:Header/>
   <soap:Body>
      <tem:GetData>
         <tem:value>1</tem:value>
      </tem:GetData>
   </soap:Body>
</soap:Envelope>

Consuming a Default WCF Service in SoapUI

May 5th, 2010 16 comments

When you create a WCF service (using the template in Visual Studio 2008) and try to test it in soapUI you get the following error:

The message could not be processed. This is most likely because the action ‘http://tempuri.org/IService1/GetData’ is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. The security context token would be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint’s binding.

The reason for this is that the default WCF binding (wsHttpBinding) implements a security context token which is not supported in soapUI.

To disable the security context token requirement in the binding add the following to your web-config:

<system.serviceModel>
  <bindings>
    <wsHttpBinding>
      <binding name="wsHttpBindingNoSCT">
        <security mode="None">
          <transport clientCredentialType="None" />
          <message establishSecurityContext="false" />
        </security>
      </binding>
    </wsHttpBinding>
  </bindings>
</system.serviceModel>

Then change the service endpoint configuration to use the new binding (set the bindingConfiguration to the name specified above):

<endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpBindingNoSCT" contract="WcfService1.IService1">

You should now be able to test this service using soapUI.

Note that you will have to check the “Add default was:To” in the WS-Addressing settings for the request in soapUI as the wsHttpBinding requires WS-Addressing action headers.

TFS Build Error When Publishing Test Results to TFS

April 29th, 2010 Comments off

When running a build on a Team Foundation Build Server 2008 I was unable to get unit test results to be reported back to TFS.  The following entry was found in the build log (where <projectname> is the name of the TFS project):

Build “vstfs:///Build/Build/830″ cannot be found under team project “<projectname>”.

The problem is a result of a fix in TFS 2008 SP1. Before SP1, $(BuildNumber) was used to report test results back to TFS.  This was a problem since the build number was not always guaranteed to be unique.  In SP1 this was fixed by using $(BuildUri) instead.

This problem shows up if you are running TFS 2008 SP1 along with TFS Build 2008 (without SP1). The simple solution is to install TFS 2008 SP1 on the build server.

To complete the update just run the installer on the build server.  It will detect that TFS Build is installed and it will update it to SP1.