rainersigwald on vsix-depend-on-nuget
VSIX dependency on NuGet.BuildT… Disambiguate branch name (compare)
livarcocc on vs16.0
Bump version to disambiguate wi… Merge pull request #4119 from r… (compare)
livarcocc on livarcocc-patch-1
livarcocc on vs16.0
Adding a vs16.0 trigger Updating to a more general trig… Merge pull request #4118 from M… (compare)
Sdk="Microsoft.NET.Sdk.WindowsDesktop", trying to effect a tooling to bump some versions.
MSB4181error, which I think may have to do with pinning to a correct (for the tooling) version of an SDK runtime, possibly.
netstandard2.0that's it. and the intended usage is as stated above, an app targeting
netcoreapp3.1and with project
3.1.402 [C:\Program Files\dotnet\sdk]only, plus
2.1.518 [C:\Program Files\dotnet\sdk], but for purposes of the target assembly build, I think it is trying for
MSB4181errors along these lines.
runtimeconfig.jsonfile in my tooling to help make sure that happens?
3.1.402at any rate, I gather. a total and complete snafu where my tooling is concerned.
Hello. First time here.
I'm discovering the
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Target Name="Build"> <ReadLinesFromFile File="C:\config.txt" > <Output TaskParameter="Lines" ItemName="config"/> </ReadLinesFromFile> <Message Text="@(config)" /> </Target> </Project>
config.txt file looks like this
I have 2 questions
• Is it possible to use
Condition in the
<Output> element to keep only lines matching a pattern?
• Knowing that my config file is named of
key=value lines, is it possible to dynamically populate properties from the resulting
I can do
<ItemGroup> <config2 Include="@(config)" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(Identity)', 'foo'))" /> </ItemGroup>
But when I try
<ReadLinesFromFile File="C:\config.txt" > <Output TaskParameter="Lines" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(Identity)', 'foo'))" ItemName="config"/> </ReadLinesFromFile>
error MSB4095: The item metadata %(Identity) is being referenced without an item name
<Output ... />in this case, with a
configvariable receiving that output. So there is not enough information to do the
<Target />and reporting what that
So I managed to write this
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Target Name="ReadConfig" BeforeTargets="Build"> <ReadLinesFromFile File="C:\config.txt" > <Output TaskParameter="Lines" ItemName="ConfigFile"/> </ReadLinesFromFile> <ItemGroup> <Config Include="@(ConfigFile)" Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(Identity)', '\w+\s*=\s*\w+'))"> <Key>$([System.String]::Copy('%(ConfigFile.Identity)').Split('='))</Key> <Value>$([System.String]::Copy('%(ConfigFile.Identity)').Split('='))</Value> </Config> </ItemGroup> <CreateProperty Value="%(Config.Value)"> <Output TaskParameter="Value" PropertyName="Foo" Condition="'%(Config.Key)' == 'foo'"/> </CreateProperty> <Message Text="[ReadConfig] ConfigFile: @(ConfigFile)" /> <Message Text="[ReadConfig] Foo : $(Foo)" /> <Message Text="[ReadConfig] Foo enabled" Condition="$(Foo)"/> </Target> <Target Name="Build"> <Message Text="[Build] ConfigFile: @(ConfigFile)" /> <Message Text="[Build] Foo : $(Foo)" /> <Message Text="[Build] Foo enabled" Condition="$(Foo)"/> </Target> </Project>
config.txt file containing
Severity Code Description Project File Line Suppression State Error MSB4018 The "TestTask" task failed unexpectedly. System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=184.108.40.206, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'System.Runtime, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at CustomTask.TestTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. TaskConsumer E:\projects\custom-msbuild-task\TaskConsumer\TaskConsumer.csproj 13
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winnt.h(2483): error C2338: Windows headers require the default packing option. Changing this can lead to memory corruption. This diagnostic can be disabled by building with WINDOWS_IGNORE_PACKING_MISMATCH defined. [C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build\Editor\AGS.Native\NativeDLL.vcxproj]
Environment.GetFolderPathin a property function, with the following line
<UnityInstallRoot>$([System.Environment]::GetFolderPath([System.Environment]::SpecialFolder::UserProfile))/Unity/Hub/Editor/</UnityInstallRoot>, but VS is showing a pop-up error with
Invalid static method invocation syntax. It looks like this question has been asked before, but that was back in 2017, so I'm curious if the answer has changed. Am I missing something obvious in this syntax?
[System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::UserProfile)would display my UserProfile. You might try that syntax for your issue. plus-in-net-class-names has a little bit more detail.
$([System.Environment]::GetFolderPath('System.Environment+SpecialFolder.UserProfile'))(note the simplified enum member name with single quotes around it)
<ItemGroup> <ClCompile Include="@(_SliceCompile->'%(OutputDir)\%(Filename).%(SourceExt)')" Exclude="@(ClCompile->'%(FullPath)');@(ClCompile->'%(Identity)')" /> </ItemGroup>
Here the ClCompile generated item has all the metadata from SliceCompile, any pointers as to why this happens
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="SliceCompile" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemDefinitionGroup> <SliceCompile> <AdditionalOptions>--add-header foo.h</AdditionalOptions> </SliceCompile> </ItemDefinitionGroup> <ItemGroup> <SliceCompile Include="Foo.ice"> <AdditionalOptions>%(AdditionalOptions) --other</AdditionalOptions> </SliceCompile> </ItemGroup> <Target Name="SliceCompile"> <ItemGroup> <ClCompile Include="@(SliceCompile->'%(Filename).cpp')"> </ClCompile> </ItemGroup> <Warning Text="@(ClCompile->'%(ClCompile.Identity) %(ClCompile.AdditionalOptions)'"/> </Target> </Project>
not sure where to put this
having an odd issue with msbuild vscode and visual studio all failing and not able to find critical pieces of .netcore 3.1 / .net 5
i have reinstalled 4x and also tried manually installing from the binary package all of which are failing , it started with not finding the sdk at all , the binary package manual install semms to have fixed that issue but now i am recieving errors about not being able to find the netcoreapp targeting pack , this is happening in all products and the cli as well
Having a difficult time getting a project working with
nuget. I want to build a project with a
packages.json. Can someone help me how I can do this? For example I'm working on this repo https://gitlab.com/gitlab-org/security-products/tests/csharp-dotnetcore-multiproject/-/tree/multiproject-joe. I want to build
ServiceA/ServiceA.csproj. From the root of the directory I run:
nuget restore ServiceA/ServiceA.csproj -PackagesDirectory ServiceA
msbuild -t:build -p:RestorePackagesPath=ServiceA ServiceA/ServiceA.csproj
Looking at the debug logs it's not able to find the correct references. Any ideas how I can resolve this? Related gitlab issue: gitlab-org/gitlab#233033
anyone has an idea how i could exclude a referenced analyzer package in a normal "dotnet build" command, but include it in the roslyn compiler stuff whick is used to generate the warnings and hints in vscode (probably called by omnisharp)
is there any environment variable i can check which is set during a normal build and not set on the others?