Unique Assembly name every build

匆匆过客 提交于 2019-12-06 21:23:28

I had some success doing this inside the csproj file in VS2013:

<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
[...]
  <PropertyGroup>
    <MyNewGuid>$([System.Guid]::NewGuid())</MyNewGuid>
  </PropertyGroup>
[...]
  <AssemblyName>$(MyNewGuid)</AssemblyName>

At least, every time I do a Rebuild it appears to generate an assembly with a different GUID for a name.

If you are using an especially old version of msbuild, you might want to look here for an alternative way to create GUIDs: http://phoebix.com/2013/08/08/who-got-the-func-part-3-generating-a-guid-in-msbuild/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!