msbuild

Delete everything in a directory except for one hidden directory in MSBuild

时间秒杀一切 提交于 2020-08-07 06:24:01
问题 What's the best way to delete the entire contents of a directory, except for one (hidden) child directory? Thanks! 回答1: <Target Name="DeleteMe"> <ItemGroup> <DeleteMe Include="$(PathRoot)/FolderToDelete/**/*.*" Exclude="$(PathRoot)/FolderToDelete/DoNotDeleteThisHiddenFolder/**/*.*" /> </ItemGroup> <Delete Files="@(DeleteMe)" /> </Target> 来源: https://stackoverflow.com/questions/10014240/delete-everything-in-a-directory-except-for-one-hidden-directory-in-msbuild

MSBuild 输出日志可视化工具 MSBuild Structured Log Viewer 简介

做~自己de王妃 提交于 2020-08-06 09:35:58
感谢 Vatsan Madhavan 小伙伴推荐的 MSBuild 输出日志可视化工具,这个工具可以使用漂亮的 WPF 界面预览 MSBuild 复杂的输出内容 这是一个完全开源的工具,请看 KirillOsenkov/MSBuildStructuredLog: A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values. 这个工具的使用方法很简单,首先是在项目里面使用 MSBuild 命令加上 /bl 生成 msbuild.binlog 文件,如使用下面代码 msbuild /bl 从官网 MSBuild Log Viewer 下载最新版本 打开软件,将 msbuild.binlog 文件拖进去就可以显示日志的信息 另外这个工具还提供了 NuGet 库可以用来读取 binlog 文件 先安装 MSBuild.StructuredLogger 库,然后使用下面代码 using System; using Microsoft.Build.Logging.StructuredLogger; class BinaryLogReadBuild { static void Main(string[] args) {

dotnet publish profile ignores pubxml file

为君一笑 提交于 2020-07-30 03:44:25
问题 I have the following pubxml file which I created via Visual Studio 2019: <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <WebPublishMethod>FileSystem</WebPublishMethod> <PublishProvider>FileSystem</PublishProvider> <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> <LastUsedPlatform>Any CPU</LastUsedPlatform> <SiteUrlToLaunchAfterPublish /> <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> <ExcludeApp_Data>False<

在ASP.NET MVC中编译视图

淺唱寂寞╮ 提交于 2020-07-27 14:41:59
问题: I want an msbuild task to compile the views so I can see if there are compile time errors at well... compile time. 我想要一个msbuild任务来编译视图,这样我就可以看到编译时是否存在编译错误...编译时。 Any ideas? 有任何想法吗? 解决方案: 参考一: https://stackoom.com/question/1bgW/在ASP-NET-MVC中编译视图 参考二: https://oldbug.net/q/1bgW/Compile-Views-in-ASP-NET-MVC 来源: oschina 链接: https://my.oschina.net/u/3797416/blog/4285696

How to show Analyzer errors/warnings during msbuild in VS Dev Cmd & using MSBuildWorkspace

拈花ヽ惹草 提交于 2020-07-23 06:41:43
问题 I'll explain the situation with an example. Suppose I have created a Roslyn Analyzer which throws Error when Class name is TestClass . Analyzer code is as below: public override void Initialize(AnalysisContext context) { context.RegisterSyntaxNodeAction(Method, SyntaxKind.ClassDeclaration); } private static void Method(SyntaxNodeAnalysisContext context) { var node = (ClassDeclarationSyntax)context.Node; var name = node.TryGetInferredMemberName(); if(name == "TestClass") { context

How to show Analyzer errors/warnings during msbuild in VS Dev Cmd & using MSBuildWorkspace

那年仲夏 提交于 2020-07-23 06:40:33
问题 I'll explain the situation with an example. Suppose I have created a Roslyn Analyzer which throws Error when Class name is TestClass . Analyzer code is as below: public override void Initialize(AnalysisContext context) { context.RegisterSyntaxNodeAction(Method, SyntaxKind.ClassDeclaration); } private static void Method(SyntaxNodeAnalysisContext context) { var node = (ClassDeclarationSyntax)context.Node; var name = node.TryGetInferredMemberName(); if(name == "TestClass") { context

How to show Analyzer errors/warnings during msbuild in VS Dev Cmd & using MSBuildWorkspace

﹥>﹥吖頭↗ 提交于 2020-07-23 06:39:30
问题 I'll explain the situation with an example. Suppose I have created a Roslyn Analyzer which throws Error when Class name is TestClass . Analyzer code is as below: public override void Initialize(AnalysisContext context) { context.RegisterSyntaxNodeAction(Method, SyntaxKind.ClassDeclaration); } private static void Method(SyntaxNodeAnalysisContext context) { var node = (ClassDeclarationSyntax)context.Node; var name = node.TryGetInferredMemberName(); if(name == "TestClass") { context

Treating warnings as errors in Visual Studio 2019 for build but NOT intellisense

依然范特西╮ 提交于 2020-07-23 06:16:20
问题 I've just started using <TreatWarningsAsErrors>true</TreatWarningsAsErrors> in my csproj files, and when messing up a bit of code, I've found myself taking quite a bit of extra time hovering over all the different red lines to find the one that's actually an error, as I want to prioritse fixing the errors over the warnings. It would be great if the intellisense warnings could still show as green lines in the text editor, but also cause the build to fail. I think that I could make the test

Treating warnings as errors in Visual Studio 2019 for build but NOT intellisense

心不动则不痛 提交于 2020-07-23 06:15:41
问题 I've just started using <TreatWarningsAsErrors>true</TreatWarningsAsErrors> in my csproj files, and when messing up a bit of code, I've found myself taking quite a bit of extra time hovering over all the different red lines to find the one that's actually an error, as I want to prioritse fixing the errors over the warnings. It would be great if the intellisense warnings could still show as green lines in the text editor, but also cause the build to fail. I think that I could make the test

Treating warnings as errors in Visual Studio 2019 for build but NOT intellisense

僤鯓⒐⒋嵵緔 提交于 2020-07-23 06:14:11
问题 I've just started using <TreatWarningsAsErrors>true</TreatWarningsAsErrors> in my csproj files, and when messing up a bit of code, I've found myself taking quite a bit of extra time hovering over all the different red lines to find the one that's actually an error, as I want to prioritse fixing the errors over the warnings. It would be great if the intellisense warnings could still show as green lines in the text editor, but also cause the build to fail. I think that I could make the test