在我的 Windows CE 应用程序中,我一直在尝试将所有项目引用从“Any CPU”(或“AnyCPU”)更改为“x86”
为此,我手动编辑了 .csproj 文件(项目 > 属性...只有“任何 CPU”作为选项可用,没有“x86”(或其他任何东西)。
现在我不知道,但我得到,“没有为这个项目设置 OutputPath 属性。请检查以确保您指定了有效的配置/平台组合。配置='调试'平台='AnyCPU' "
问题出在哪里,我无法想象。.csproj 文件中不再有任何“CPU”!
现在我注意到还有一个神秘的 .csdproj(扩展名中嵌入了额外的“d”)文件……但它也没有“CPU”,更不用说“AnyCPU”了……
更令人困惑的是,.csproj 文件似乎表明该项目需要许多 DLL,例如 Symbol*.DLL 文件——但这些文件在手持设备上并不存在,而 .exe 在那里运行良好。这是怎么回事?
这是 .csproj 文件(省略了特别无聊的部分),然后是 .csdproj 文件:
<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{CA63566E-76DE-4EE5-8292-71EBF90A9AC9}</ProjectGuid>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectTypeGuids>{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ApplicationIcon>.\HHS.ico</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>HHS</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<OutputType>WinExe</OutputType>
<OutputFileFolder>\Program Files\PDAClient</OutputFileFolder>
<RootNamespace>PDAClient</RootNamespace>
<StartupObject>PDAClient.MainApplication</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>0.0</OldToolsVersion>
<NativePlatformName>Windows CE</NativePlatformName>
<FormFactorID>
</FormFactorID>
</PropertyGroup>
<PropertyGroup>
<PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
<PlatformFamilyName>WindowsCE</PlatformFamilyName>
<DeployDirSuffix>$(AssemblyName)</DeployDirSuffix>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\Debug\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>0</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>0</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>
</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup>
<ItemGroup>
<Reference Include="HUtilCE, Version=1.5.0.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\HHS\HUtilCE.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsCE.Forms">
<Name>Microsoft.WindowsCE.Forms</Name>
</Reference>
<Reference Include="mscorlib">
<Name>MSCorLib</Name>
<Private>False</Private>
</Reference>
<Reference Include="OpenNETCF, Version=1.3.50123.0, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\HHS\OpenNETCF.dll</HintPath>
</Reference>
<Reference Include="OpenNETCF.Windows.Forms, Version=1.3.50123.0, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\HHS\OpenNETCF.Windows.Forms.dll</HintPath>
</Reference>
<Reference Include="Symbol">
<Name>Symbol</Name>
</Reference>
<Reference Include="Symbol.Barcode">
<Name>Symbol.Barcode</Name>
</Reference>
<Reference Include="Symbol.BarcodeForms">
<Name>Symbol.BarcodeForms</Name>
</Reference>
<Reference Include="Symbol.Printing">
<Name>Symbol.Printing</Name>
</Reference>
<Reference Include="Symbol.StandardForms">
<Name>Symbol.StandardForms</Name>
</Reference>
<Reference Include="System">
<Name>System</Name>
<Private>False</Private>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
<Private>False</Private>
</Reference>
<Reference Include="System.Data.SqlClient">
<Name>System.Data.SqlClient</Name>
</Reference>
<Reference Include="System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=3be235df1c8d2ad3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System.Drawing">
<Name>System.Drawing</Name>
<Private>False</Private>
</Reference>
<Reference Include="System.Windows.Forms">
<Name>System.Windows.Forms</Name>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml">
<Name>System.XML</Name>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AppSettings.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
. . .
<Compile Include="WriteXML.cs">
<SubType>Code</SubType>
</Compile>
<EmbeddedResource Include="frmAbout.resx">
<DependentUpon>frmAbout.cs</DependentUpon>
</EmbeddedResource>
. . .
<EmbeddedResource Include="PrinterPickerForm.resx">
<DependentUpon>PrinterPickerForm.cs</DependentUpon>
</EmbeddedResource>
<Content Include="HHS.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="HHT.ICO">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}">
<HostingProcess disable="1" />
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<Import Condition="'$(TargetFrameworkVersion)' == 'v3.5'" Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
</Project>
PDAClient.csdproj 中没有“AnyCPU”(或“x86”)...
更新
现在,当我卸载项目以编辑它(.csproj 文件)时,项目文件说它“不可用”;也许它总是这么说,我只是注意到了,但无论如何,它不可用是“有趣的”;我可以从 Windows 资源管理器访问/编辑它...
更新 2
关闭并重新打开项目导致它告诉我它是在早期版本的 Visual Studio 中创建的,需要升级..???...我让它继续,特别是当它正在创建一个备份副本时,错误消失了......???