question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dotnet build and publish don't have parameters for platform

See original GitHub issue

Steps to reproduce

Have a csproj file with conditional configs as such: <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">

Expected behavior

There’s a configuration parameter (dotnet build -c Debug) (dotnet publish -c Debug) that fills in $(Configuration) so I expect there to be a parameter to fill in $(Platform)

Actual behavior

There is no parameter and specific configuration details don’t get applied because Platform does not get set to x64

Current Work-around

Explicitly setting the Platform EV for the current command prompt using SET Platform=x64

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:8
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

24reactions
livarcocccommented, Dec 1, 2018

You can pass it using dotnet build /p:Platform=x64

18reactions
CanIGetaPRcommented, Dec 1, 2018

Shouldn’t that be added to the documentation then?

Usage: dotnet build [options] <PROJECT>

Arguments:
  <PROJECT>   The project file to operate on. If a file is not specified, the command will search the current directory for one.

Options:
  -h, --help                            Show command line help.
  -o, --output <OUTPUT_DIR>             The output directory to place built artifacts in.
  -f, --framework <FRAMEWORK>           The target framework to build for. The target framework must also be specified in the project file.
  -c, --configuration <CONFIGURATION>   The configuration to use for building the project. The default for most projects is 'Debug'.
  -r, --runtime <RUNTIME_IDENTIFIER>    The target runtime to build for.
  --version-suffix <VERSION_SUFFIX>     Set the value of the $(VersionSuffix) property to use when building the project.
  --no-incremental                      Do not use incremental building.
  --no-dependencies                     Do not build project-to-project references and only build the specified project.
  --no-restore                          Do not restore the project before building.
  -v, --verbosity <LEVEL>               Set the MSBuild verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
  --force                               Force all dependencies to be resolved even if the last restore was successful.
                                        This is equivalent to deleting project.assets.json.
Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet publish command - .NET CLI
Any parameters passed to dotnet publish are passed to MSBuild. The -c and -o parameters map to MSBuild's Configuration and PublishDir properties ...
Read more >
dotnet publish commandline with platform parameter value ...
Build parameters are passed to msbuild via the dotnet command using the following syntax: /p:Platform="Any CPU".
Read more >
10 commands you don't want to be without in .Net Core
Here's a full list of commands that runs restore implicitly: dotnet new; dotnet build; dotnet build-server; dotnet run; dotnet test; dotnet publish; dotnet...
Read more >
.NET | TeamCity On-Premises Documentation
Parameter references are supported. If you have a finished build, you can use the file/directory selector here. Framework. Target framework.
Read more >
API - DotNetPublishSettings Class
Gets or sets a value indicating whether to bundle all content when publishing a platform-specific single-file executable. This will extract all files before ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found