微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Wix C# 自定义操作不生成 CA.dll,只生成 .dll

如何解决Wix C# 自定义操作不生成 CA.dll,只生成 .dll

我正在将 Wix 集成到日常构建中,并且我正在尝试构建自定义操作,而无需在本地安装 Wix 工具集。因此,我使用了 wix 提供的二进制文件,它们适用于基本安装程序本身。

当我尝试构建 C# 自定义操作时出现问题,构建本身通过,但它只生成 .dll,而不是我需要的 CA.dll。 我怀疑问题出在我修改的 .csproj 本身

.csproj 用于自定义操作:

<?xml version="1.0" encoding="utf-8"?>
<Project Toolsversion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{970397C2-1306-47C4-8E61-20949BD061E3}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>InstallerExtensions</RootNamespace>
    <AssemblyName>InstallerExtensions</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <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' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
    <PropertyGroup>
        <WixToolPath>$(SystemDrive)\WixTools\</WixToolPath>
        <WixTargetsPath>$(WixToolPath)wix.targets</WixTargetsPath>
        <WixExtDir>$(WixToolPath)</WixExtDir>
        <WixTasksPath>$(WixToolPath)WixTasks.dll</WixTasksPath>
        <WixsdkPath>$(WixToolPath)sdk\</WixsdkPath>
        <WixCATargetsPath>$(WixsdkPath)wix.nativeca.targets</WixCATargetsPath>
    </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Data" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Xml">
      <HintPath>..\..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Deployment.WindowsInstaller">
    <HintPath>$(WixsdkPath)Microsoft.Deployment.WindowsInstaller.dll</HintPath>
      <Private>True</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Configuration.cs" />
    <Compile Include="CustomAction.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Content Include="CustomAction.config" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\..\Company\Company.Util\Company.Util.csproj">
      <Project>{02c36290-8ce5-43ec-a21a-b61151e17642}</Project>
      <Name>Company.Util</Name>
    </ProjectReference>
  </ItemGroup>
    <Import Project="$(WixCATargetsPath)" />
    <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。