Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 发布Visual Studio 2013之前的ASP.NET MSBuild自定义任务_C#_Asp.net_Msbuild_Publish - Fatal编程技术网

C# 发布Visual Studio 2013之前的ASP.NET MSBuild自定义任务

C# 发布Visual Studio 2013之前的ASP.NET MSBuild自定义任务,c#,asp.net,msbuild,publish,C#,Asp.net,Msbuild,Publish,我正在ASP.NET web应用程序部署的app.ver文件中维护用户显示的应用程序版本号。在发布应用程序之前,我希望能够增加该文件中的版本号 如何挂接到MSBuild以运行在发布之前执行递增操作的任务 谢谢 在web项目中,使用BeforeTargets目标属性添加在发布目标之前执行的 <Target Name="PrePublish" BeforeTargets="Publish"> ... </Target> ... 根据 ... 我试过这个。在.

我正在ASP.NET web应用程序部署的app.ver文件中维护用户显示的应用程序版本号。在发布应用程序之前,我希望能够增加该文件中的版本号

如何挂接到MSBuild以运行在发布之前执行递增操作的任务


谢谢

在web项目中,使用BeforeTargets目标属性添加在发布目标之前执行的

<Target Name="PrePublish" BeforeTargets="Publish">
    ...
</Target>

...
根据


...  

我试过这个。在.csproj文件末尾的targets Publish和MSDeployPublish之前,两者似乎都没有被调用..可能相关:
<Project>  
    ...  
    <Target Name="BeforePublish">  
        <!-- Insert tasks to run before publish here -->  
    </Target>  
    <Target Name="AfterPublish">  
        <!-- Insert tasks to run after publish here -->  
    </Target>  
</Project>