Skip to end of metadata

 

Go to start of metadata

 

You can integrate SmartAssembly in your build process.

You set up your project in SmartAssembly once, and you can then build your assembly in your normal MSBuild process. The settings you chose in the SmartAssembly project are applied without needing to run SmartAssembly separately.

Note that the SmartAssembly task should be the last stage of your build process. Because of the way SmartAssembly changes your assembly, running other tasks after SmartAssembly is not supported. (An exception to this is assembly-signing tools, if you choose not to sign your code with SmartAssembly).

To integrate SmartAssembly directly into the build process, follow these steps:

  1. Create your project in SmartAssembly (see Working with projects) and set the project options (see Working with project settings).
  2. Open your application's .csproj or .vsprojfile in an XML editor.
    The .csproj or .vsproj file is actually a MSBuild XML file that you can edit to add SmartAssembly to the build tasks. For more information about the MSBuild XML schema, see the MSBuild documentation on MSDN.
  3. Add references to SmartAssembly to your C# or VB.NET project file, as follows. 

    Note that the <UsingTask> element includes SmartAssembly's major version number. This page has been written for SmartAssembly 6.x. If you are using a different version of SmartAssembly, you will need to change the version number specified in the <UsingTask> element. For example, if you use SmartAssembly 5.5, change the version to Version=5.0.0.0

     

    <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        ...
      </PropertyGroup>
      ...
      <ItemGroup>
        ...
      </ItemGroup>
      <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
      <UsingTask
     TaskName="SmartAssembly.MSBuild.Tasks.Build"
    AssemblyName="SmartAssembly.MSBuild.Tasks, Version=6.0.0.0,
    Culture=neutralPublicKeyToken=7f465a1c156d4d57" />
      <Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release' ">
        <SmartAssembly.MSBuild.Tasks.Build ProjectFile="c:\path\to\project.saproj"/>
      </Target>
    </Project>

     

  4. Edit the following line (near the bottom of the XML which you just added to the project), setting the ProjectFile attribute to the path to your *.saproj file:
    <SmartAssembly.MSBuild.Tasks.Build ProjectFile="c:\path\to\project.saproj"/>
  5. If required, add any of the following optional attributes to the same element:

    OverwriteAssembly

    Set to True if you want to overwrite the original assembly with the obfuscated one.

    If this option is not set, or set to False, SmartAssembly uses the destination file name from the .saproj project.

    If you set this option to True, SmartAssembly ignores the OverwriteAssembly attribute, if set.

    Input

    If this option is set, SmartAssembly will process the assembly specified as this attribute's value.

    If this option is not set, SmartAssembly will process the assembly specified in the .saproj project is used.

    This is useful if you want to build an assembly using exactly the same settings as those you chose for a different assembly.

    Output

    If this option is set, SmartAssembly will use this attribute's value as the file name when saving the built assembly.

    If this option is not set, SmartAssembly will use the file name in the .saproj file when saving the built assembly.

    This attribute is ignored if the OverwriteAssembly property is set to True.

    This option is useful if you want to save a test build to a different path from other builds.

    MarkAsReleased

    (Deprecated)

    This option was used in SmartAssembly 6.2 and earlier to preserve map files (see About map files).

    SmartAssembly 6.5 stores map files permanently, so this option is ignored.

    A diff showing the added lines in a .csproj file is shown below.

    Build your assembly with MSBuild. SmartAssembly is run automatically, using the settings in your SmartAssembly project file.

    If you use a .mdb file for your SmartAssembly database, ensure that Visual Studio is run as an administrator when running MSBuild.

Using SmartAssembly with MSBuild的更多相关文章

  1. Jenkins配置MSBuild实现自动部署(MSBuild+SVN/Subversion+FTP+BAT)

    所要用到的主要插件: [MSBuild Plugin] 具体操作: 1.配置MSBuild的版本 [系统管理]->[Global Tool Configuration]->[MSBuild ...

  2. 使用roslyn代替MSBuild完成解决方案编译

    原本我是使用批处理调用 MSBuild 完成解决方案编译的,新版的 MSBuild 在 Visual Studio 2015 会自带安装. 当然在Visual Studio 2015 中,MSBuil ...

  3. MSBuild 编译 C# Solution

    Microsoft(R) 生成引擎版本 4.6.1055.0 [Microsoft .NET Framework 版本 4.0.30319.42000] 版权所有 (C) Microsoft Corp ...

  4. UWP Jenkins + NuGet + MSBuild 手把手教你做自动UWP Build 和 App store包

    背景 项目上需要做UWP的自动安装包,在以前的公司接触的是TFS来做自动build. 公司要求用Jenkins来做,别笑话我,之前还真不晓得这个东西. 会的同学请看一下指出错误,不会的同学请先自行脑补 ...

  5. MSBuild的简单介绍与使用

    MSBuild 是 Microsoft 和 Visual Studio的生成系统.它不仅仅是一个构造工具,应该称之为拥有相当强大扩展能力的自动化平台.MSBuild平台的主要涉及到三部分:执行引擎.构 ...

  6. Jenkins学习九:Jenkins插件之构建MSBuild

    Jenkins是Java语言编写的,一直好奇是否可以构建NET语言的项目,目前只了解到有一个插件MSBuild支持构建NET项目. 一.Jenkins安装插件MSBuild 二.VS构建CsharpH ...

  7. CCNET+MSBuild+SVN实现每日构建

    最近开始将源代码迁移到SVN,于是便考虑到如何从SVN定期获取源码,自动编译并部署以减轻工作量并提高工作效率.通过多方搜集资料并进行研究,基本实现了这个功能.对于每日构建的概念就不具体展开了,可以在各 ...

  8. Msbuild项目集成右键菜单编译

    DS1.背景:   我们为什么要将VS2008命令行编译.sln文件集成到右键菜单呢? 原因一:VS2008很好很强大,但太费系统资源了,尤其是在虚拟机在里面装VS2008的时候更是如此. 原因二:有 ...

  9. 集成Visual Studio/MSBuild的开发/发布流程和 FIS3

    谁不想让自己的网站速度更快?为此需要多方面的优化,但优化又会增加开发工作量.Fis3 是很不错的前端优化工具,能够让前端的优化变得自动方便,解决前述问题.Fis3是百度开发的,开源的,在国内比较六流行 ...

随机推荐

  1. 解决maven项目java中配置文件打包被忽略

    pom.xml中添加以下配置 <build> <!--配置打包时不过滤非java文件开始 --> <!--说明,在进行模块化开发打jar包时,maven会将非java文件 ...

  2. 微信小程序前端坑

    链接:https://www.cnblogs.com/showMagic/p/7677551.html

  3. 学习笔记(21)- texar 文本生成

    今天试了文本生成框架texar https://github.com/asyml/texar 这个texar框架里面,也有端到端的实现 pwd /Users/huihui/git/ git clone ...

  4. 【Hibernate QBC】

    HibernateQBC public class HibernateQBC { //演示离线查询 @Test public void testSelect6() { SessionFactory s ...

  5. idea垂直分屏

    1.找到分屏功能 搜索keymap(注意大小写): 2.Split Vertically 垂直分屏/Split Horizontally 水平分屏 3.添加快捷方式

  6. Python - __getattr__和__getattribute__的区别

    传送门 https://docs.python.org/3/reference/datamodel.html#object.__getattr__ https://docs.python.org/3/ ...

  7. Linux - Shebang(#!)

    1. Shebang这个符号通常在Unix系统的脚本中第一行开头中写到,它指明了执行这个脚本文件的解释程序.

  8. Mysql 连接时的 option 含义

    官网文档: https://dev.mysql.com/doc/refman/5.7/en/mysql-real-connect.html

  9. Mysql基本用法-left join、right join、 inner join、子查询和join-02

    left join #左连接又叫外连接 left join 返回左表中所有记录和右表中连接字段相等的记录  test_user表 phpcvs表 SQL: select * from test_use ...

  10. sarima模型

    以下内容引自:https://blog.csdn.net/qifeidemumu/article/details/88782550 使用“网格搜索”来迭代地探索参数的不同组合. 对于参数的每个组合,我 ...