Visual Studio Conversion Wizard changing project file to point to office 12.0 for an excel 2003 add-in template project
-
Thursday, May 08, 2008 6:54 PMSo I'm trying to figure out why Visual Studio 2008 is doing this very weird thing.
Background: I had a project for an excel 2003 add-in that worked fine. I upgraded it to visual studio 2008. It worked fine. I installed office 2007, which I've since uninstalled. Visual studio 2008, when I opened the ALREADY MIGRATED project which DID WORK, prompts me to convert the project. I don't want to, but whatever, I play along. The project doesn't compile. Upon looking at the project xml file, i see it is trying to point to vsto 3.0 along with office 12.0 (2007), for an excel add-in 2003 project!
So, I say, no problem. I create a new project, from the excel add-in 2003 template, add my code, compile, debug, build installer, everything works fine........
UNTIL I reload that same solution that I just re-created, i.e. i quit vs2008 and opened it back up. UPON which time it now asks me to convert the project because it "has been created with a previous version of visual studio", which it hasn't since I JUST MADE IT in vs2008.
I have included a detailed HTML diff report from my two solution files, below, where the Left (L) File is after, and the Right (R) file is before. You can see the differences, in context inline, output below.
Note the RED LINES. They are the different ones. Especially note that all the RED LINES added to the solution file (File L) all include 12.0 office libraries.
Also, note that both project files "toolsversion=3.5", so I do'nt know how vs2008 thought I made this project with another tool? or an older tool?
I'm so confused. I don't even know where to start. The only workaround I have is that I can keep recreating new solutions, and working with them until I quit vs2008, which I now just try to never do.........but once I quit, I'm done.Anyways, so the diff file won't post, it is an html file....here is the text redition
Before(RHS)_AND_AFTER(LHS)_Comparison_CSPROJ_Files
Produced: 5/8/2008 1:50:44 PM
Mode: All Lines
Left file: C:\Documents and Settings\g20165\Desktop\csproj_file_after.txt
Right file: C:\Documents and Settings\g20165\Desktop\csproj_Filebefore.txt
L1 <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
R1 <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
------------------------------------------------------------------------
L2=R2 <!--
This section defines project-level properties.
AssemblyName
Name of the output assembly.
Configuration
Specifies a default value for debug.
OutputType
Must be "Library" for VSTO.
Platform
Specifies what CPU the output of this project can run on.
NoStandardLibraries
Set to "false" for VSTO.
RootNamespace
In C#, this specifies the namespace given to new files. In VB, all objects are
wrapped in this namespace at runtime.
-->
<PropertyGroup>
<ProjectTypeGuids>{BAA0C2D2-18E2-41B9-852F-F413020CAA33};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{501E4D2C-9804-4A1B-A6DC-FD247AA4A215}</ProjectGuid>
<OutputType>Library</OutputType>
<NoStandardLibraries>false</NoStandardLibraries>
<RootNamespace>ExcelAddIn2</RootNamespace>
<AssemblyName>ExcelAddIn2</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
------------------------------------------------------------------------
L29 <OfficeApplication>Excel</OfficeApplication>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<BootstrapperEnabled>true</BootstrapperEnabled>
<PublishUrl>http://localhost/ExcelAddIn2/</PublishUrl>
<InstallUrl>http://localhost/ExcelAddIn2/</InstallUrl>
<TargetCulture>en</TargetCulture>
<ApplicationVersion>1.0.0.0</ApplicationVersion>
<AutoIncrementApplicationRevision>true</AutoIncrementApplicationRevision>
<UpdateEnabled>true</UpdateEnabled>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>days</UpdateIntervalUnits>
<IsWebBootstrapper>True</IsWebBootstrapper>
------------------------------------------------------------------------
L45=R29 </PropertyGroup>
<PropertyGroup>
<!--
VSTO_TrustAssembliesLocation
If "true", VSTO gives the project output full trust in user-level policy when the project is built.
VSTO_HostDocumentName
Not used in add-ins.
-->
<VSTO_TrustAssembliesLocation>true</VSTO_TrustAssembliesLocation>
</PropertyGroup>
<PropertyGroup>
<!--
Properties needed to register add-ins.
AddinRegistryHive
Root registry hive for the add-in.
AddinRegistryKey
Registry key where this add-in is registered.
-->
<AddinRegistryHive>CurrentUser</AddinRegistryHive>
<AddinRegistryKey>Software\Microsoft\Office\Excel\Addins</AddinRegistryKey>
</PropertyGroup>
<!--
This section defines properties that are set when the "Debug" configuration is selected.
DebugSymbols
If "true", create symbols (.pdb). If "false", do not create symbols.
DefineConstants
Constants defined for the preprocessor.
EnableUnmanagedDebugging
If "true", starting the debugger will attach both managed and unmanaged debuggers.
Optimize
If "true", optimize the build output. If "false", do not optimize.
OutputPath
Output path of project relative to the project file.
WarningLevel
Warning level for the compiler.
-->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<!--
This section defines properties that are set when the "Release" configuration is selected.
DebugSymbols
If "true", create symbols (.pdb). If "false", do not create symbols.
DefineConstants
Constants defined for the preprocessor.
EnableUnmanagedDebugging
If "true", starting the debugger will attach both managed and unmanaged debuggers.
Optimize
If "true", optimize the build output. If "false", do not optimize.
OutputPath
Output path of project relative to the project file.
WarningLevel
Warning level for the compiler.
-->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<!--
This section enables pre- and post-build steps. However, in VSTO use
MSBuild tasks instead of these properties.
-->
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!--
This section specifies references for the project.
-->
<ItemGroup>
<Reference Include="Accessibility" />
------------------------------------------------------------------------
L131 <Reference Include="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Office.Tools.Common.v9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Office.Tools.Excel.v9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Office.Tools.v9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Office, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<Private>False</Private>
</Reference>
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
------------------------------------------------------------------------
L142=R115 <Reference Include="System" />
------------------------------------------------------------------------
L143 <Reference Include="System.AddIn">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
------------------------------------------------------------------------
L146=R116 <Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
------------------------------------------------------------------------
R128 </Reference>
<Reference Include="Microsoft.Office.Tools.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Office.Tools.Excel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Tools.Applications.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
<ItemGroup>
<Reference Include="Office, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
<Private>False</Private>
</Reference>
<Reference Include="stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Private>False</Private>
------------------------------------------------------------------------
L158=R142 </Reference>
</ItemGroup>
<!--
This section defines the user source files that are part of the project.
A "Compile" element specifies a source file to compile.
An "EmbeddedResource" element specifies an .resx file for embedded resources.
A "None" element specifies a file that is not to be passed to the compiler (for instance,
a text file or XML file).
The "AppDesigner" element specifies the directory where the application properties files
can be found.
-->
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
------------------------------------------------------------------------
L182 <DesignTime>True</DesignTime>
------------------------------------------------------------------------
L183=R166 </Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
------------------------------------------------------------------------
L191 <DesignTimeSharedInput>True</DesignTimeSharedInput>
------------------------------------------------------------------------
L192=R174 </Compile>
<Compile Include="ThisAddIn.cs">
<SubType>Code</SubType>
</Compile>
<None Include="ThisAddIn.Designer.xml">
<DependentUpon>ThisAddIn.cs</DependentUpon>
</None>
<Compile Include="ThisAddIn.Designer.cs">
<DependentUpon>ThisAddIn.Designer.xml</DependentUpon>
</Compile>
<AppDesigner Include="Properties\" />
</ItemGroup>
------------------------------------------------------------------------
L204 <ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.VSTORuntime.3.0">
<Visible>False</Visible>
<ProductName>Visual Studio Tools for the Office system 3.0 Runtime</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
------------------------------------------------------------------------
L231=R186 <!-- Include the build rules for a C# project. -->
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- Include additional build rules for an Office application add-in. -->
------------------------------------------------------------------------
R189 <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2003.targets" />
------------------------------------------------------------------------
L234=R190 <!-- This section defines VSTO properties that describe the host-changeable project properties. -->
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{BAA0C2D2-18E2-41B9-852F-F413020CAA33}">
------------------------------------------------------------------------
L238 <ProjectProperties HostName="Excel" HostPackage="{D2B20FF5-A6E5-47E1-90E8-463C6860CB05}" OfficeVersion="12.0" VstxVersion="3.0" ApplicationType="Excel" Language="cs" TemplatesPath="VSTOTemplates" DebugInfoExeName="#Software\Microsoft\Office\12.0\Excel\InstallRoot\Path#excel.exe" AddItemTemplatesGuid="{147FB6A7-F239-4523-AE65-B6A4E49B361F}" />
R194 <ProjectProperties HostName="Excel" HostPackage="{D53BAEDE-5B63-42BE-8267-3DED11EDC582}" OfficeVersion="11.0" VstxVersion="3.0" ApplicationType="Excel" Language="cs" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\11.0\Excel\InstallRoot\Path#excel.exe" />
------------------------------------------------------------------------
L239=R195 <Host Name="Excel" GeneratedCodeNamespace="ExcelAddIn2" IconIndex="0">
------------------------------------------------------------------------
L240 <HostItem Name="ThisAddIn" Code="ThisAddIn.cs" CanonicalName="AddIn" CanActivate="false" IconIndex="1" Blueprint="ThisAddIn.Designer.xml" GeneratedCode="ThisAddIn.Designer.cs" />
R196 <HostItem Name="ThisAddIn" Code="ThisAddIn.cs" CanonicalName="ThisAddIn" CanActivate="false" IconIndex="1" Blueprint="ThisAddIn.Designer.xml" GeneratedCode="ThisAddIn.Designer.cs" />
------------------------------------------------------------------------
L241=R197 </Host>
<ProjectClient>
------------------------------------------------------------------------
L243 <VSTO_CompatibleProducts ErrorProduct="This project requires Microsoft Office Excel 2007, but this application is not installed." ErrorPIA="This project references the primary interop assembly for Microsoft Office Excel 2007, but this primary interop assembly is not installed.">
<Product Code="{XX12XXXX-XXXX-XXXX-X000-X000000FF1CE}" Feature="EXCELFiles" PIAFeature="Excel_PIA" />
R199 <VSTO_CompatibleProducts ErrorProduct="This project requires Microsoft Office Excel 2003 and the registered primary interop assemblies, but these are not installed." ErrorPIA="This project references the primary interop assembly for Microsoft Office Excel 2003, but this primary interop assembly is not installed.">
<Product Code="{XXXXXXXX-6000-11D3-8CFE-0150048383C9}" Feature="EXCELFiles" PIAFeature="Excel_PIA" />
------------------------------------------------------------------------
L245=R201 </VSTO_CompatibleProducts>
</ProjectClient>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
------------------------------------------------------------------------
L250 <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.targets" />
------------------------------------------------------------------------
L251=R206 </Project>
------------------------------------------------------------------------
All Replies
-
Thursday, May 08, 2008 11:01 PMAnswerer
Hi JefWest,
Do you still have Office 2007 installed? The upgrade wizard might be appearing because it is trying convert your Office 2003 add-in project to an Office 2007 project. The error message might be a bit misleading if this is what is happening and the message says "has been created with a previous version of visual studio". There is one way to find out.
Try this:
Open the Project Upgrade dialog box and then clear the Always upgrade to installed version of Office option. Then, open the add-in project that you backed up before you performed the migration and see if the wizard still appears. The purpose of clearing the Always upgrade to installed version of Office option is so that you can continue compiling and running add-in projects that target 2003 even if you have Office 2007 installed.
You can read more about this in the following MSDN topic - http://msdn.microsoft.com/en-us/library/k2xkefex.aspx.
Please let me know if this helps.
Norm E.

