I figured out a way for this to work! If you look at the XML in your project you see a node that looks like this:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<RegisterForComInterop>true</RegisterForComInterop>
</PropertyGroup>
The problem here is of course the line that tells the project to register for com interop. I also see a similar definition for the release configuration. I can solve the issue by removing the line or, through the UI, unchecking the box but I have other people on the project that need to get the code and it would be better if the version of the project in source control just worked for them. the answer is to uncheck the register interop box on the release definition but keep it on the debug definition and then alter the build TFS definition to only build for release. That way, my co-workers can have the com object and the build server doesn’t complain.