TF30063: You are not authorized to access Microsoft-IIS/7.5

This is the second time we have hit this error so this time it was a quick fix. But if you don’t know what it is you might be led astray by the message. When we have received this error is has nothing to do with permissions. This typically occurs on a build failure:

TF30063

The real reason is found in the Event Viewer on the TFS Web Server in all these Errors:

Event Viewer Errors

If you scroll through the jumbled Web Request Details within the event details you will see:

Exception Message: There is not enough space on the disk.
 (type IOException)
Exception Stack Trace:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
   at Microsoft.TeamFoundation.Framework.Server.TeamFoundationFileService.InternalCopyTo(Stream source, Stream destination, Int32 bufferSize)
   at Microsoft.TeamFoundation.Framework.Server.TeamFoundationFileService.CopyStreamToTempStream(TeamFoundationRequestContext requestContext, Stream stream, Int64 compressedLength, CompressionType& compressionType, Boolean compressOutput, Boolean useFileStream)
   at Microsoft.TeamFoundation.Framework.Server.TeamFoundationFileService.RetrieveFile(TeamFoundationRequestContext requestContext, Int32 fileId, Boolean compressOutput, Byte[]& hashValue, Int64& contentLength, CompressionType& compressionType, String& fileName, Boolean failOnDeletedFile, Boolean returnNullIfDelta, Boolean forceFileStream, Boolean readIncompleteData)
   at Microsoft.TeamFoundation.Framework.Server.TeamFoundationFileService.RetrieveFile(TeamFoundationRequestContext requestContext, Int32 fileId, Boolean compressOutput, Byte[]& hashValue, Int64& contentLength, CompressionType& compressionType)
   at Microsoft.TeamFoundation.Server.Core.MidTierDownloadState.CacheMiss(FileCacheService fileCacheService, FileInformation fileInfo, Boolean compressOutput)
   at Microsoft.TeamFoundation.Server.Core.FileCacheService.RetrieveFileFromDatabase(TeamFoundationRequestContext requestContext, FileInformation fileInfo, IDownloadState downloadState, Boolean compressOutput, Stream databaseStream)
   at Microsoft.TeamFoundation.Server.Core.GenericDownloadHandler.DownloadFile(TeamFoundationRequestContext requestContext, DownloadContext downloadContext, HttpRequest request, HttpResponse response, HandleErrorDelegate errorDelegate)

The reason we ran out of disk space is due to IIS Logging. We were having giant transaction logs being recorded for all requests to the TFS Web Services. Archiving (deleting Winking smile) these restored our space quickly.

Technorati Tags:

Adding Microsoft PubCenter Ads with AdDuplex fall-back on Windows Phone 8

DVLUP has a challenge Shamelessly promote your apps with AdDuplex. AdDuplex doesn’t earn you any income so why would you want to give ads to your users without any benefit to yourself? AdDuplex answers this succinctly “According to reports the average fill rate in mobile ad networks could be as low as 10%. AdDuplex helps you utilize 100% of your ad space, so even when you are not making money from the other ad network you get free promotion for your app.”

It is encouraged to use an ad network with fallback to AdDuplex and It only takes 5 minutes to add to your app.

  1. Add references to Microsoft Advertising and AdDuplex
    a. Install Microsoft Advertising SDK, if not already, and add reference
    Reference to Microsoft Advertising SDK
    b. Install AdDuplex via NuGet Package. Enter into the Package Manager Console:
    Install-Package AdDuplexWP8
  2. Add references to the namespace in your Xaml page you want to display the ads

    xmlns:ad="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"
    xmlns:adduplex="clr-namespace:AdDuplex;assembly=AdDuplex.WindowsPhone"
  3. Add controls so that the AdDuplex banner is under the Microsoft Advertising banner.  
    <adduplex:AdControl x:Name="adDuplexAd" AppId="12345" VerticalAlignment="Bottom" />
    <ad:AdControl Name="photoFoodDiaryAdControlRecordPage" Width="480" Height="80" VerticalAlignment="Bottom"
            IsAutoRefreshEnabled="True" IsAutoCollapseEnabled="True" 
            ApplicationId="test_client" AdUnitId="Image480_80" />

    AdDuplex requires that the complete banner is not hidden. With this setup, if the Microsoft Advertising banner fails to get an ad the IsAutoCollapseEnable will set Visibility Collapsed showing the AdDuplex banner.

  4. Generate Ad ids

    a. In WP Dev Center publish or update. Add in-app advertising and Generate ad unit ID. 
    Add in-app advertising

    b. Sign up to Ad Duplex if you haven’t and add a new App.

    AdDuplex New app

  5. Add the required capabilities to your WMAppManifest.xml

    Capabilities
  6. Since the ad network doesn’t always return an ad, to test your ads check for any errors occuring, and set the ApplicationId and AdUnitId to the test values from here. Simple add a break point in the method and inspect e.Error.Message if the break point is hit.

    ErrorOccurred="AdControlRecordPage_ErrorOccurred"
    private void AdControlRecordPage_ErrorOccurred(object sender, Microsoft.Advertising.AdErrorEventArgs e)
    {
    }

    e.Error.Message

Now you should see the Microsoft test ad. Remember to switch you ApplicationId and AdUnitId back to what you got from the Dev Center and you are done.

Microsoft Test Ad

Technorati Tags:

Adding Localization to a Windows Phone app

If you have any Windows Phone 7 apps from the original templates, unlike the Windows Phone 8 app templates they did not come with localization setup already. So lazy me just wrote the strings inline. Fortunately adding localization after updating to Windows Phone 8 is easy.

  1. Add a Resources folder
  2. Add new Resources resx to the folder named AppResources.resx
    AppResources.resx
  3. Ensure Custom Tool is set to PublicResXFileCodeGenerator
    AppResources.resx Properties
  4. Add a new class named LocalizedStrings to the root of your project
    using YourAppNamespace.Resources;
    
    namespace YourAppNamespace
    {
        /// <summary>
        /// Provides access to string resources.
        /// </summary>
        public class LocalizedStrings
        {
            private static AppResources _localizedResources = new AppResources();
    
            public AppResources LocalizedResources { get { return _localizedResources; } }
        }
    }
  5. Add an Application.Resource of your LocalizedStrings class to your App.xaml

        <Application.Resources>
            <local:LocalizedStrings xmlns:local="clr-namespace:YourAppNamespace" x:Key="LocalizedStrings"/>
        </Application.Resources>
  6. Add strings in AppResources.resx

    AppResources.resx Content

  7. Use localized strings anywhere in your Xaml

    CompanyName="{Binding Path=LocalizedResources.CompanyName, Source={StaticResource LocalizedStrings}}"
  8. To Add other languages and for more details follow How to build a localized app for Windows Phone

New Work Item State on TFS Kanban Board

Continuing our Quest we currently have the states To Do, In Progress and Done. We need to add another for when it goes into testing so we will call that Boss Battle.

Firstly we need to add the new state to the work item type. Export the Quest work item type:

witadmin exportwitd /collection:http://vsalm:8080/tfs/FabrikamFiberCollection /p:FabrikamFiber /n:Quest /f:%userprofile%\desktop\QuestWitd.xml

Add a new state under witd > WORKITEMTYPE > WORKFLOW > STATES:

<STATE value="Boss Battle"/>

Modify the transitions to go through the new state:

<TRANSITION from="In Progress" to="Done">
<TRANSITION from="In Progress" to="Boss Battle">

<TRANSITION from="Done" to="In Progress">
<TRANSITION from="Done" to="Boss Battle">

In practice you might want to add more transitions around the state. This is much easier using the TFS Power Tools Process Template Editor. This will now have the workflow in place with the new state, but when that state is selected the work item will not appear on the board.

Export the process configuration definition:

witadmin exportprocessconfig /collection:http://vsalm:8080/tfs/FabrikamFiberCollection /p:FabrikamFiber /f:%userprofile%\desktop\ProcessConfiguration.xml

Under the TaskBacklog add a new InProgress state:

<States>
  <State type="Proposed" value="To Do" />
  <State type="InProgress" value="In Progress" />
  <State type="InProgress" value="Boss Battle" />
  <State type="Complete" value="Done" />
</States>

Import the process configuration definition:

witadmin importprocessconfig /collection:http://vsalm:8080/tfs/FabrikamFiberCollection /p:FabrikamFiber /f:%userprofile%\desktop\ProcessConfiguration.xml

You now have a new column on your iteration board:

New Column on Board

Technorati Tags: