msbuild

How to use .settings files in .NET core?

一个人想着一个人 提交于 2019-12-14 03:44:46
问题 I'm porting an application to .NET core which relies on a .settings file. Unfortunately, I can't find a way to read it from .NET core. Normally, adding the following lines to the .csproj would generate a TestSettings class that would let me read the settings. <ItemGroup> <None Include="TestSettings.settings"> <Generator>SettingsSingleFileGenerator</Generator> </None> </ItemGroup> Unfortunately, this no longer seems to do anything. I can't even verify that the SettingsSingleFileGenerator runs

Visual Studio Solution — Any way to create a “special” folder?

和自甴很熟 提交于 2019-12-14 03:43:27
问题 Basically, I want one of my folders to appear above the other folders as a type of "special folder", similar to how Properties has it's own special place even though it's a folder, same with App_Data, etc. Is this possible? 回答1: By default, Visual Studio doesn't support adding special project folders. The Properties folder is hard-coded to behave the way that it does. However, anything is possible with code. You could build an extension to do this, but it wouldn't be simple. You'd probably

Import .targets file from command line in msbuild

瘦欲@ 提交于 2019-12-14 03:39:44
问题 I currently have multiple projects being build using msbuild. I have a small customisation to the build that is handled by a .targets file. One solution is to add the snippet <Import Project="MyTargets.targets"/> to each project file. However, ideally I would like to not touch the project files, and be able to pass this information as a parameter to msbuild. That way I could easily control whether I run this customisation from the command line, and I don't have to touch the existing project

msbuild PackageReference.PrivateAssets = All does not seem to work

倾然丶 夕夏残阳落幕 提交于 2019-12-14 03:07:57
问题 I have a test project which reference NUnit3TestAdapter. I do not this reference to be copied over to the projects that depend on this one. I thought setting PrivateAssets = All would do it, but apparently I misunderstand how it works, because it does not have the desired effect. Here is the code: Rollup\Rollup.csproj <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net472</TargetFramework> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\UITests\UITests.csproj"/>

Unable to host an NServiceBus Saga from another Service with SQL Persistence

北战南征 提交于 2019-12-14 03:06:37
问题 I am attempting to host a Saga from one project in another project using NServiceBus 6 with SqlPersistence and SqlDialect.MsSqlServer . In most examples I have found, the Saga is contained in the same assembly as the hosting app, and perhaps this is why I am struggling. When hosting everything in the same app, the NServiceBus.Persistence.Sql.MsBuild package correctly outputs Saga .sql files during the build and then picks these up and executes them on run. Using a separate app, only the

No ProjectInfo.xml files were found error from command prompt using MSBuild SonarQube Runner v1.0

给你一囗甜甜゛ 提交于 2019-12-14 02:38:39
问题 I'm trying out SonarQube using the new MSBuild SonarQube Runner v1.0. The Pre-processing works fine E:\sonarQube\MSBuild.SonarQube.Runner-1.0>MSBuild.SonarQube.Runner.exe begin /k:"MyKey" /n:"MyProject" /v:"1.0" ....... Process returned exit code 0 Pre-processing succeeded. Then MSBuild works E:\sonarQube\WebApplication2013>msbuild Microsoft (R) Build Engine version 4.0.30319.34209 [Microsoft .NET Framework, version 4.0.30319.34209] Copyright (C) Microsoft Corporation. All rights reserved. ..

MSBuild Target that always runs when clicking build in VS2013

假装没事ソ 提交于 2019-12-14 02:32:18
问题 I want to run a target whenever you click build for the project in VS2013. I tried several ways including changing the DefaultTargets of the project to something custom and then have the custom target call my target and then Build. However, the problem is that it only works once. If I run it again, it doesn't seem to run anything. Is there anyway to do this? 回答1: I came up with a solution. My major problem was that VS2013 was no longer checking if the files didn't change. I needed to add this

echo All Elements of an ItemGroup

别说谁变了你拦得住时间么 提交于 2019-12-14 02:28:51
问题 I have an MSBuild ItemGroup and I would like to be able to echo it out in the "Post-Build Event". However when I try commands like: echo My ItemGroup: @(Foo) I get the error: error MSB4164: The value "echo My ItemGroup: @(Foo)" of metadata "Command" contains an item list expression. Item list expressions are not allowed on default metadata values. I'm not very good with ItemGroup s as of yet. Is there a way I can just echo the list of files that Foo contains? 回答1: You'll want something like:

Specify a logger in MSBuild configuration file

点点圈 提交于 2019-12-14 02:04:55
问题 I've written some custom logger for my MSBuild process and it's working fine from the command line: msbuild <project> /logger:mylogger.dll the question now is how should I specify my custom logger in the .csproj file so that when I build from Visual Studio my custom logger is used the same way as I use it when running msbuild from the command line. I haven't found anything to do that here or here. 回答1: This is not possible. In MSBuild API, RegisterLogger has to be called before the build is

“Specified cast is not valid” only on release build from MS build

纵饮孤独 提交于 2019-12-14 01:28:51
问题 I am getting a "Specified cast is not valid" valid when doing only a release build from MSBuild 4.0. I tested this out in using a release build from Visual Studio 2012 and didn't get this issue. I also tested this out using a debug build from MSBuild 4.0 and didn't get this issue. Exception: Code public abstract class CachedSessionBase : ISessionObject { protected Dictionary<MethodBase, Object> _getAndSetCache = new Dictionary<MethodBase, object>(); protected TResult SetAndGet<TResult>