Cannot register assembly during Team Build (and I don't want too)

by Donovan Brown 6. February 2013 22:27

Problem:

I have a solution that contains a project with the "Make assembly COM-Visible" checked and I get the following error when I attempt to run a team build:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (3885): Cannot register assembly "C:\Builds\1\TeamProject\Libraries - CI\bin\Debug\Mydll.dll" - access denied. Please make sure you're running the application as administrator. Access to the registry key 'HKEY_CLASSES_ROOT\Mydll' is denied.

Solution:

Pass "/p:RegisterForComInterop=false" to MSBuild using the MSBuild Arguments process parameter of your build definition.

Explanation:

The service account running my build agent is not an adminstrator on my build.  Therefore; it does not have permissions to write to the registry to register the COM assembly.  Because this is my build machine I have no desire to have the COM assembly registered on this machine. I simply what the solution to build.

When the "Make assembly COM-Visible" is checked the project file is changed to include a target to register the assembly. That target has a condition testing if RegisterForComInterop is true.  By passing the values to MSBuild you are overriding the default value of True with False.  This will allow the project to compile and skip the step to register.

Tags: , , ,

Work

I don't trust 2012 Auto merge but it does it automatically.

by Donovan Brown 31. January 2013 18:58

Problem:

I would like a chance to review the changes before having Visual Studio 2012 automerge my files.

Solution:

Disable the "Attempt to automatically resolve conflicts when they are generated.

autoMerge

Explanation:

When Visual Studio 2012 is installed it defaults with this option set. If you uncheck this box Visual Studio behaves as it did in the 2010 version.  You are presented the Conflict Resolution window with options to AutoMerge, Merge Changes In Merge Tool, Take Server Version or Keep Local Version.

Tags: ,

Work

How do I convert a Web Site to a Web Application

by Donovan Brown 31. January 2013 01:41

Problem:

We created our application using the Web Site project template and would like to change to a Web Application.

Solution:

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

Explanation:

Just don't use Web Sites! Why would I want my source code (all of my IP) on a server that could be compromised? They also do not play nice with source control systrems or automated build.

Tags: , ,

Work

I want xml transforms to happen on build instead of only publish.

by Donovan Brown 11. January 2013 20:24

Problem:

I have xml transforms I want to preform on build not only on publish. I also want an easy way to transform my config files during my team build.  Finally I want to use it on app.configs in WPF applications as well.

Solution:

Use SlowCheetah XML Transforms package.  You can install it from the Extension Manager in Visual Studio. 

Explanation:

SlowCheetah enables you to transform your app.config or any other XML file based on the build configuration. It also adds additional tooling to help you create XML transforms.

 http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5


 

Tags: , , , , ,

Work

How to connect Visual Studio 2008 (including SQL Server Business Intelligence Development Studio) with TFS 2012

by Donovan Brown 21. December 2012 22:42

Tags: , , ,

Work

I have to create the same branches in every new team project

by Donovan Brown 17. December 2012 23:48

Problem:

I have to create the same branching structure in several team projects.  I would like a way to automate this process.

Solution:

Use the tf.exe and tfpt.exe command line tools in a batch file.

Explanation:

Using the tf.exe and tfpt.exe command line tools you can preform the same task from the command line that you can preform in the IDE.  Using tf.exe and tfpt.exe we can script the creation of the desired branching structure to speed up the process.

You can download the Microsoft Visual Studio Team Foundation Server 2012 Update 1 Power Tools from here.

The script below creates the Basic Branch Plan from the Visual Studio Team Foundation Server Branching and Merging Guide which you can download from here.

The script must by run from a Developer Command Prompt so that tf.exe and tfpt.exe can be found.  Your other option is to update the environment variables for you machine to include the location of tf.exe and tfpt.exe in your path.

@ECHO OFF

REM If they did not provide arguments show them how to 
REM use this batch file
if "%1" == "" GOTO Usage
if "%2" == "" GOTO Usage

REM Create a temp workspace to create the branches in.
REM This will be deleted at the end
tf workspace /new /noprompt temp /collection:%1

REM Before you can create branches you must do a get latest
tf get $/%2

REM Create a main folder that will become the main branch of code
md %2\Main

REM Add this folder to TFS
tf add %2\Main /noprompt

REM Check in the main folder
tf checkin /comment:"Adding main branch" /recursive /noprompt

REM Now start creating the other branches
REM main to dev
tf branch $/%2/Main $/%2/Dev /noget /checkin

REM main to release
tf branch $/%2/Main $/%2/Release /noget /checkin

REM We have to use tfpt from the power tools to convert
REM the folder to a branch so we get the new branch icons
REM in source control explorer
tfpt branches /convertToBranch /collection:%1 /recursive $/%2/Main

Echo Deleting temp workspace
Echo.
tf workspace /delete /noprompt temp

REM Remove the directories we created
rd %2 /s /q

REM Skip usage and just end
GOTO End

REM Show how to use the script
:Usage

Echo This batch file will create the default Main, Dev and Release branches
Echo for a team project.
Echo Requires:
Echo Microsoft Visual Studio Team Foundation Server 2012 Update 1 Power Tools
Echo.

Echo Usage:
Echo   createBraches collection teamProjectName
Echo.
Echo     collection = http://tfs:8080/tfs/myCollection
Echo     teamProjectName = the team project name in that collection 
Echo.
Echo   createBranches http://tfs:8080/tfs/sandboxcollection teamProjectName

:End

createBranches.cmd (1.67 kb)

Tags: , , , , ,

Work

I can't connect to my load test repository.

by Donovan Brown 7. December 2012 02:56

Problem:

When I try to Open and Manage Results from my load test I get an error:

Solution:

Make sure your controller is configured with the full name to the database server instead of . or .\sqlexpress.  Change to mySqlServer or mySqlServer\sqlExpress.

Tags: , , , ,

Work

My web test data source is not loading all the columns from my csv file.

by Donovan Brown 5. December 2012 20:06

Problem:

I have a data driven web test that calls other web test. The called web tests are also data bound to data loaded by the parent data source.  When I run my test I was getting the following error:

Request failed: Context parameter 'FluidManagement.FluidManagement_json#csv.spacer2' not found in test context

Solution:

Expand the Data Sources node of your web test until you can select the desired table.  From the Properties window change the Select Columns from “Only select bound columns” to “Select all columns”.

Explanation:

The default behavior is to only select the columns that are bound the web test that defines the data source.  This is a reasonable assumption as long as the test does not call any other data bound web test.  If the test you call rely on columns that are not bound in the caller you must change the Select Columns setting.

Tags: , , , ,

Work

How do I reset my Visual Studio Settings

by Donovan Brown 4. December 2012 23:12

Problem:

I selected the wrong language when I started Visual Studio for the first time.

Solution:

From the Tools menu select Import and Export Settings.... From the Import and Export Settings Wizard select Reset all settings.  Complete the wizard to reset your settings.

Tags: ,

Work

How do I data drive a coded UI test?

by Donovan Brown 1. December 2012 01:41

Problem:

I would like to feed data to an existing Coded UI test from a datasource.

Solution:

Watch this short video I created for the company I work for.

Using Data Driven Coded UI Test

Tags: , ,

Work

About the author

My name is Donovan Brown and I am a process consultant for Imaginet with a background in application development.  I also run one of the Nation’s fastest growing online registration sites for motorsports events DLBRacing.com.  When I am not writing software I race cars for fun.  DLBRacing.com has given me the opportunity to combine my two passions writing software and racing cars.

AdSense

Month List

AdSense