2

何らかの理由で、多くのC#コードをVisualStudio2010からVisualStudio2008に移動する必要があります。

変更を反映するようにslnファイルを編集しました

Microsoft Visual Studio Solution File, Format Version 11.00

Microsoft Visual Studio Solution File, Format Version 10.00

これにより、ソリューションをVS2008にロードできるようになりました。その後、Framework.NET3.5をターゲットにするようにすべてのcsprojを編集しました

これにより、プロジェクトをコンパイルできました

リリースモードで「正しく」実行できます(.NET 4.0の仕様から3.5に相当するものへの変更によるいくつかのバグがあります)

デバッグモードで次のエラーメッセージが表示されました 代替テキスト

私のグーグルフーは、「デバッグしようとしているアプリケーションがバージョンを使用している」を検索しているときにレジストリを台無しにする可能性があることを明らかにしました。このページを指さした

このページには、2005年と2008年の両方のヘルプページで8.0を参照しているエラーがあると確信しています。だから私はそれをしました、私はショーCLRVersionForDebuggingのディレクトリのように値「v3.5」でレジストリキーを作成しましたC:\Windows\Microsoft.NET\Framework

今、私は次のメッセージを受け取ります: 代替テキスト

この問題を解決するための関連情報が見つかりません。これは大きな苦痛です。プロジェクトを手動で再作成したくありません。何百ものソース/構成ファイルがあります。どんな助けでも大歓迎です。

デバッグしないプロジェクトファイルの例を次に示します。

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>9.0.21022</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{61547F81-8F73-4E38-ACDB-B51253A90EBC}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>FlowchartEditor</RootNamespace>
    <AssemblyName>FlowchartEditor</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <TargetFrameworkProfile>
    </TargetFrameworkProfile>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Editor.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="Editor.Designer.cs">
      <DependentUpon>Editor.cs</DependentUpon>
    </Compile>
    <Compile Include="EditorMDI.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="EditorMDI.Designer.cs">
      <DependentUpon>EditorMDI.cs</DependentUpon>
    </Compile>
    <Compile Include="OutputSignalSelect.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="OutputSignalSelect.Designer.cs">
      <DependentUpon>OutputSignalSelect.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="PropertiesEditor.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="PropertiesEditorDisplayUnit.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="ToolboxForm.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="ToolboxForm.Designer.cs">
      <DependentUpon>ToolboxForm.cs</DependentUpon>
    </Compile>
    <EmbeddedResource Include="Editor.resx">
      <DependentUpon>Editor.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="EditorMDI.resx">
      <DependentUpon>EditorMDI.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="OutputSignalSelect.resx">
      <DependentUpon>OutputSignalSelect.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="PropertiesEditor.resx">
      <DependentUpon>PropertiesEditor.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <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>
      <DesignTime>True</DesignTime>
    </Compile>
    <EmbeddedResource Include="ToolboxForm.resx">
      <DependentUpon>ToolboxForm.cs</DependentUpon>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <None Include="app.config" />
    <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>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\flowchart\flowchart\flowchart\flowchart.csproj">
      <Project>{4E7DDA00-651D-4CC0-833C-83E60ADE552B}</Project>
      <Name>flowchart</Name>
    </ProjectReference>
    <ProjectReference Include="..\PluginMiddleMan\PluginMiddleMan.csproj">
      <Project>{CDACB6A0-6DEC-48B6-B3B1-628968B50F5C}</Project>
      <Name>PluginMiddleMan</Name>
    </ProjectReference>
    <ProjectReference Include="..\ToolBox\ToolBox.csproj">
      <Project>{D937E1F4-1B9F-4567-B28E-EED24AA31C9C}</Project>
      <Name>ToolBox</Name>
    </ProjectReference>
    <ProjectReference Include="..\WinFormsUI\WinFormsUI.csproj">
      <Project>{C75532C4-765B-418E-B09B-46D36B2ABDB1}</Project>
      <Name>WinFormsUI</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
4

4 に答える 4

1

.csprojファイルのtolにある「ToolsVersion」を変更しましたか?プロジェクトファイルの1つの例を投稿すると便利な場合があります。

于 2010-10-08T19:15:21.897 に答える
1

VS 2008 SP1のインストールでは、との下に両方AD7MetricsAD7Metrics(Debug)キーがありますHKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0AD7Metrics確かに含まれています{449EC4CC-30D2-4032-9256-EE18EB41B62B}AD7Metrics(Debug)ではない。

{449EC4CC-30D2-4032-9256-EE18EB41B62B}の下にサブキーとそのCLRVersionForDebugging値を作成してみてくださいAD7Metrics(Debug)

于 2010-10-08T19:35:00.070 に答える
1

VS2008で新しいテストプロジェクトを開始してデバッグした場合、これと同じ問題が発生しますか?そうでない場合は、新しいcsprojファイルを作成し、既存のコードファイルを新しいプロジェクトにドラッグする方がよいでしょう。

個人的には、Visual Studioのインストールが安定している場合(r2008プロジェクトは正常にビルドされます)、レジストリ内のグローバル状態をいじくりまわすために、そのルートを使用したいと思います。

于 2010-10-08T21:28:15.463 に答える
0

app.configプロジェクト内のファイルの内容を確認してください。<requiredRuntime>.NET 4をターゲットとする<supportedRuntime>要素が含まれている可能性があり、デバッガーを混乱させる可能性があります。

編集:CLRVersionForDebugging当分の間、値を取り除きます。目標は、最初のエラーメッセージを再現することです(2番目のエラーメッセージについては気分が悪いです...)

于 2010-10-08T22:49:47.537 に答える