none
Problème de chargement de projet sous Visual Studio 2017 Community - erreur: '_', hexadecimal value 0x03, is an invalid character. Line 1, position 1. RRS feed

  • Discussion générale

  • Bonjour,

    J'ai un projet que je n'arrive pas ouvrir sous Visual Studio 2017 Community, j'ai l'erreur suivante:

    error  : The imported project file "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets" could not be loaded. '', hexadecimal value 0x03, is an invalid character. Line 1, position 1.  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.WinFX.targets

    J'ai désinstallé et réinstallé NET Framework 4, mias ca a rien changé.

    Il est possible de le charger sans problème dans d'autres postes mais pas sur le mien. 

    Voici le contenu du fichier zl7010xadk.csproj:

    <?xml version="1.0" encoding="utf-8"?>
    <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
        <ProductVersion>8.0.50727</ProductVersion>
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectGuid>{1B988D97-B7F2-49D3-B691-72F1FC443BCE}</ProjectGuid>
        <OutputType>WinExe</OutputType>
        <AppDesignerFolder>Properties</AppDesignerFolder>
        <RootNamespace>Zarlink.Adk.Forms</RootNamespace>
        <AssemblyName>RC_Emulator_0_1_0_0</AssemblyName>
        <ApplicationIcon>
        </ApplicationIcon>
        <IsWebBootstrapper>false</IsWebBootstrapper>
        <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
        <FileUpgradeFlags>
        </FileUpgradeFlags>
        <OldToolsVersion>2.0</OldToolsVersion>
        <UpgradeBackupLocation />
        <TargetFrameworkProfile />
        <PublishUrl>publish\</PublishUrl>
        <Install>true</Install>
        <InstallFrom>Disk</InstallFrom>
        <UpdateEnabled>false</UpdateEnabled>
        <UpdateMode>Foreground</UpdateMode>
        <UpdateInterval>7</UpdateInterval>
        <UpdateIntervalUnits>Days</UpdateIntervalUnits>
        <UpdatePeriodically>false</UpdatePeriodically>
        <UpdateRequired>false</UpdateRequired>
        <MapFileExtensions>true</MapFileExtensions>
        <ApplicationRevision>0</ApplicationRevision>
        <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
        <UseApplicationTrust>false</UseApplicationTrust>
        <BootstrapperEnabled>true</BootstrapperEnabled>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <DebugSymbols>true</DebugSymbols>
        <DebugType>full</DebugType>
        <Optimize>false</Optimize>
        <OutputPath>bin\Debug\</OutputPath>
        <DefineConstants>TRACE;DEBUG</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <DebugType>pdbonly</DebugType>
        <Optimize>true</Optimize>
        <OutputPath>bin\Release\</OutputPath>
        <DefineConstants>TRACE</DefineConstants>
        <ErrorReport>prompt</ErrorReport>
        <WarningLevel>4</WarningLevel>
        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
        <DebugSymbols>true</DebugSymbols>
        <OutputPath>bin\x86\Debug\</OutputPath>
        <DefineConstants>TRACE;DEBUG</DefineConstants>
        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
        <DebugType>full</DebugType>
        <PlatformTarget>x86</PlatformTarget>
        <ErrorReport>prompt</ErrorReport>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
        <OutputPath>bin\x86\Release\</OutputPath>
        <DefineConstants>TRACE</DefineConstants>
        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
        <Optimize>true</Optimize>
        <DebugType>pdbonly</DebugType>
        <PlatformTarget>x86</PlatformTarget>
        <ErrorReport>prompt</ErrorReport>
      </PropertyGroup>
      <ItemGroup>
        <Reference Include="Accessibility" />
        <Reference Include="System" />
        <Reference Include="System.Data" />
        <Reference Include="System.Deployment" />
        <Reference Include="System.Drawing" />
        <Reference Include="System.Windows.Forms" />
        <Reference Include="System.Xml" />
      </ItemGroup>
      <ItemGroup>
        <EmbeddedResource Include="..\..\..\..\..\AppDevPlat\Sw\Pc\Guis\Forms\AdpNonModalMessageBox.resx">
          <Link>AdpNonModalMessageBox.resx</Link>
          <DependentUpon>AdpNonModalMessageBox.cs</DependentUpon>
        </EmbeddedResource>
        <EmbeddedResource Include="..\..\..\..\..\AppDevPlat\Sw\Pc\Guis\Forms\AdpPowMonForm.resx">
          <Link>AdpPowMonForm.resx</Link>
          <DependentUpon>AdpPowMonForm.cs</DependentUpon>
        </EmbeddedResource>
        <EmbeddedResource Include="..\..\Guis\Forms\AdkForm.resx">
          <Link>AdkForm.resx</Link>
          <DependentUpon>AdkForm.cs</DependentUpon>
        </EmbeddedResource>
        <EmbeddedResource Include="..\..\Guis\Forms\AdkTraceViewForm.resx">
          <Link>AdkTraceViewForm.resx</Link>
          <DependentUpon>AdkTraceViewForm.cs</DependentUpon>
        </EmbeddedResource>
        <EmbeddedResource Include="..\..\Guis\Forms\AnyModForm.resx">
          <Link>AnyModForm.resx</Link>
          <DependentUpon>AnyModForm.cs</DependentUpon>
        </EmbeddedResource>
        <EmbeddedResource Include="..\..\Guis\Forms\LinkQualityForm.resx">
          <Link>LinkQualityForm.resx</Link>
          <DependentUpon>LinkQualityForm.cs</DependentUpon>
        </EmbeddedResource>
        <EmbeddedResource Include="..\..\Guis\Forms\NvmForm.resx">
          <Link>NvmForm.resx</Link>
          <DependentUpon>NvmForm.cs</DependentUpon>
        </EmbeddedResource>
        <EmbeddedResource Include="..\..\Guis\Forms\RegDescForm.resx">
          <Link>RegDescForm.resx</Link>
          <DependentUpon>RegDescForm.cs</DependentUpon>
        </EmbeddedResource>
        <EmbeddedResource Include="Properties\Resources.resx">
          <Generator>ResXFileCodeGenerator</Generator>
          <LastGenOutput>Resources.Designer.cs</LastGenOutput>
          <SubType>Designer</SubType>
        </EmbeddedResource>
        <Compile Include="..\..\..\..\..\AppDevPlat\Sw\Pc\Guis\Api\AdpApi.cs">
          <Link>AdpApi.cs</Link>
        </Compile>
        <Compile Include="..\..\..\..\..\AppDevPlat\Sw\Pc\Guis\Api\General.cs">
          <Link>General.cs</Link>
        </Compile>
        <Compile Include="..\..\..\..\..\AppDevPlat\Sw\Pc\Guis\Api\Nvm.cs">
          <Link>Nvm.cs</Link>
        </Compile>
        <Compile Include="..\..\..\..\..\AppDevPlat\Sw\Pc\Guis\Forms\AdpNonModalMessageBox.cs">
          <Link>AdpNonModalMessageBox.cs</Link>
          <SubType>Form</SubType>
        </Compile>
        <Compile Include="..\..\..\..\..\AppDevPlat\Sw\Pc\Guis\Forms\AdpNonModalMessageBox.designer.cs">
          <Link>AdpNonModalMessageBox.designer.cs</Link>
          <DependentUpon>AdpNonModalMessageBox.cs</DependentUpon>
        </Compile>
        <Compile Include="..\..\..\..\..\AppDevPlat\Sw\Pc\Guis\Forms\AdpPowMonForm.cs">
          <Link>AdpPowMonForm.cs</Link>
          <SubType>Form</SubType>
        </Compile>
        <Compile Include="..\..\..\..\..\AppDevPlat\Sw\Pc\Guis\Forms\AdpPowMonForm.designer.cs">
          <Link>AdpPowMonForm.designer.cs</Link>
          <DependentUpon>AdpPowMonForm.cs</DependentUpon>
        </Compile>
        <Compile Include="..\..\..\..\..\AppDevPlat\Sw\Pc\Guis\Forms\Oscilloscope.cs">
          <Link>Oscilloscope.cs</Link>
        </Compile>
        <Compile Include="..\..\..\..\..\AppDevPlat\Sw\Pc\Guis\General\Util.cs">
          <Link>Util.cs</Link>
        </Compile>
        <Compile Include="..\..\Guis\Api\BsmApi.cs">
          <Link>BsmApi.cs</Link>
        </Compile>
        <Compile Include="..\..\Guis\Api\CommonApi.cs">
          <Link>CommonApi.cs</Link>
        </Compile>
        <Compile Include="..\..\Guis\Api\ImApi.cs">
          <Link>ImApi.cs</Link>
        </Compile>
        <Compile Include="..\..\Guis\Build\BuildZL7010XAdk.cs">
          <Link>BuildZL7010XAdk.cs</Link>
        </Compile>
        <Compile Include="..\..\Guis\Forms\AdkForm.cs">
          <Link>AdkForm.cs</Link>
          <SubType>Form</SubType>
        </Compile>
        <Compile Include="..\..\Guis\Forms\AdkForm.designer.cs">
          <Link>AdkForm.designer.cs</Link>
          <DependentUpon>AdkForm.cs</DependentUpon>
        </Compile>
        <Compile Include="..\..\Guis\Forms\AdkTraceViewForm.cs">
          <Link>AdkTraceViewForm.cs</Link>
          <SubType>Form</SubType>
        </Compile>
        <Compile Include="..\..\Guis\Forms\AdkTraceViewForm.designer.cs">
          <Link>AdkTraceViewForm.designer.cs</Link>
          <DependentUpon>AdkTraceViewForm.cs</DependentUpon>
        </Compile>
        <Compile Include="..\..\Guis\Forms\AnyModForm.cs">
          <Link>AnyModForm.cs</Link>
          <SubType>Form</SubType>
        </Compile>
        <Compile Include="..\..\Guis\Forms\AnyModForm.designer.cs">
          <Link>AnyModForm.designer.cs</Link>
          <DependentUpon>AnyModForm.cs</DependentUpon>
        </Compile>
        <Compile Include="..\..\Guis\Forms\LinkQualityForm.cs">
          <Link>LinkQualityForm.cs</Link>
          <SubType>Form</SubType>
        </Compile>
        <Compile Include="..\..\Guis\Forms\LinkQualityForm.designer.cs">
          <Link>LinkQualityForm.designer.cs</Link>
          <DependentUpon>LinkQualityForm.cs</DependentUpon>
        </Compile>
        <Compile Include="..\..\Guis\Forms\NvmForm.cs">
          <Link>NvmForm.cs</Link>
          <SubType>Form</SubType>
        </Compile>
        <Compile Include="..\..\Guis\Forms\NvmForm.designer.cs">
          <Link>NvmForm.designer.cs</Link>
          <DependentUpon>NvmForm.cs</DependentUpon>
        </Compile>
        <Compile Include="..\..\Guis\Forms\RegDescForm.cs">
          <Link>RegDescForm.cs</Link>
          <SubType>Form</SubType>
        </Compile>
        <Compile Include="..\..\Guis\Forms\RegDescForm.designer.cs">
          <Link>RegDescForm.designer.cs</Link>
          <DependentUpon>RegDescForm.cs</DependentUpon>
        </Compile>
        <Compile Include="Actuator.cs" />
        <Compile Include="Analog.cs" />
        <Compile Include="AppTest.cs" />
        <Compile Include="ConfigParam.cs" />
        <Compile Include="GPIO_input.cs" />
        <Compile Include="GPIO_output.cs" />
        <Compile Include="LogEvent.cs" />
        <Compile Include="NVMImplant.cs" />
        <Compile Include="Properties\AssemblyInfo.cs" />
        <Compile Include="Properties\Resources.Designer.cs">
          <AutoGen>True</AutoGen>
          <DependentUpon>Resources.resx</DependentUpon>
          <DesignTime>True</DesignTime>
        </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>
          <DesignTimeSharedInput>True</DesignTimeSharedInput>
        </Compile>
        <Compile Include="PwrCtrl.cs" />
        <Compile Include="ResetSleep.cs" />
        <Compile Include="RTC.cs" />
        <Compile Include="SelfTest.cs" />
        <Compile Include="SystemSettings.cs" />
        <Compile Include="Utils.cs" />
        <Compile Include="XMLCmdParser.cs" />
        <Compile Include="XMLFrameParser.cs" />
        <Compile Include="ZL7010XAdkGui.cs" />
      </ItemGroup>
      <ItemGroup>
        <Content Include="..\..\..\..\..\AppDevPlat\Sw\Pc\Guis\Resources\Osc_DLL.dll">
          <Link>Osc_DLL.dll</Link>
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Include="..\..\Guis\Resources\ImdDatabase.xml">
          <Link>ImdDatabase.xml</Link>
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Include="..\..\Guis\Resources\ZL70103RegistersPage1.txt">
          <Link>ZL70103RegistersPage1.txt</Link>
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Include="..\..\Guis\Resources\ZL70103RegistersPage2.txt">
          <Link>ZL70103RegistersPage2.txt</Link>
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <None Include="..\..\Guis\Resources\MicrosemiIcon.ico">
          <Link>MicrosemiIcon.ico</Link>
        </None>
        <None Include="..\..\Guis\Resources\MicrosemiLogo.gif">
          <Link>Resources\MicrosemiLogo.gif</Link>
        </None>
        <Content Include="..\..\Guis\Resources\ZL70101RegistersPage1.txt">
          <Link>ZL70101RegistersPage1.txt</Link>
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Include="..\..\Guis\Resources\ZL70101RegistersPage2.txt">
          <Link>ZL70101RegistersPage2.txt</Link>
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Include="..\..\Guis\Resources\ZL70102RegistersPage1.txt">
          <Link>ZL70102RegistersPage1.txt</Link>
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
        <Content Include="..\..\Guis\Resources\ZL70102RegistersPage2.txt">
          <Link>ZL70102RegistersPage2.txt</Link>
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </Content>
      </ItemGroup>
      <ItemGroup>
        <BootstrapperPackage Include=".NETFramework,Version=v4.0">
          <Visible>False</Visible>
          <ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
          <Install>true</Install>
        </BootstrapperPackage>
        <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
          <Visible>False</Visible>
          <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
          <Install>false</Install>
        </BootstrapperPackage>
        <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
          <Visible>False</Visible>
          <ProductName>.NET Framework 2.0</ProductName>
          <Install>false</Install>
        </BootstrapperPackage>
        <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
          <Visible>False</Visible>
          <ProductName>.NET Framework 3.5 SP1</ProductName>
          <Install>false</Install>
        </BootstrapperPackage>
        <BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
          <Visible>False</Visible>
          <ProductName>Windows Installer 4.5</ProductName>
          <Install>true</Install>
        </BootstrapperPackage>
      </ItemGroup>
      <ItemGroup>
        <Folder Include="bin\Release\" />
      </ItemGroup>
      <Import Project="$(MSBuildBinPath)\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>
      -->
      <PropertyGroup>
        <PostBuildEvent>@echo Copying ZL7010X ADK DLL to output folder if it's missing or out of date (for details, see the post-build event in the project's properties) ...
    @rem:
    @rem: Note in this "xcopy" command, /D tells "xcopy" to copy file only if the source is newer than the destination, /Y suppresses the prompt to overwrite an existing destination file, and /Q prevents xcopy from listing copied files.
    @rem:
    @xcopy /D /Y /Q "$(ProjectDir)..\ZL7010XAdkDll\bin\$(ConfigurationName)\ZL7010XAdkDll_*.dll" "$(TargetDir)"</PostBuildEvent>
      </PropertyGroup>
    </Project>
    Merci d'avance pour votre aide.
    mardi 12 février 2019 09:06

Toutes les réponses

  • Bonjour ElmarMyo, 

    Est-ce que les ordinateurs sur lesquels cela marche sont avec la même configuration?
    Essayez de nettoyer et régénérer la solution. (Générer et nettoyer des projets et des solutions dans Visual Studio)
    Pourquoi utilisez-vous ToolsVersion="4.0"? Visual Studio 2017 utilise ToolsVersion="15.0".

    Cordialement,
    Nina

    Microsoft propose ce service gratuitement, dans le but d'aider les utilisateurs et d'élargir les connaissances générales liées aux produits et technologies Microsoft. Ce contenu est fourni "tel quel" et il n'implique aucune responsabilité de la part de Microsoft.

    mercredi 13 février 2019 08:45
    Modérateur