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.

How gets `RunArguments` property evaluated?

See original GitHub issue

I would like to change RunArguments based on other property value

I have this snippet

<_RunExtraArguments Condition="'$(WasmEnableThreads)' == 'true'">--apply-cop-headers</_RunExtraArguments>
<RunArguments>&quot;$(_BlazorDevServerDll)&quot; --applicationpath &quot;$(TargetPath)&quot; $(_RunExtraArguments)</RunArguments>

If WasmEnableThreads property is set in the csproj, it works as expected (_RunExtraArguments is set to --apply-cop-headers). But if I pass it as an agrument on command line dotnet run /p:WasmEnableThreads=true, the WasmEnableThreads property value is empty when RunArguments are computed.

Do you have any advice on how accomplish such use case?

Issue Analytics

  • State:open
  • Created 4 months ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
baronfelcommented, Jun 20, 2023

Here’s what the behavior should be:

  • properties of all kinds (/p, -p, --property, etc) should be applied to
    • the (implicit) build of the project, if necessary
    • the evaluation of the project (to read RunCommand/RunArguments)
  • properties should not be applied to the application that is run
  • if a user wants the properties to be applied to the application that is run, they need to specify -- to signal that all tokens after the -- are forwarded to the application and not consumed by the run command.

@nagilson can you verify the first two points on preview5? If we’re not applying the properties to the evaluation then we need to start doing so.

0reactions
pavelsavaracommented, Jun 22, 2023

We have open WASM issue https://github.com/dotnet/runtime/issues/85674 in which we also discuss how to also separate arguments to host VM and also mono VM. Possibly with multiple --

Host VM (not dotnet): We are running inside NodeJS, browser or wasmtime VM, all of those have their own parameters. For example which env variables should be propagated into the VM, or which directories should be mounted. I imagine that docker VM would be in the same category, if it becomes supported host.

Mono runtime (dotnet VM): there are runtime flags would be good to set, usually to enable more logging, debugging, profiling.

Perhaps there should be pass-thru argument like --host:xxx=yyy and --runtime:aaa=bbb before application -- ? As an alternative to multiple --.

We considered some side channel, like runtimeconfig.json. It causes extra file download in browser. Extra FS access permissions in wasmtime which is not always possible. Also I’m not clear if passing runtime arguments to dotnet run should modify runtimeconfig.json file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What You Should Know About Real Estate Valuation
Accurate real estate valuation is important to mortgage lenders, investors, insurers, and buyers and sellers of real property.
Read more >
Spring: overriding one application.property from command ...
run.arguments Maven user property. So for Spring 2, you need to do : mvn spring-boot:run -Dspring-boot.
Read more >
How To Value Real Estate Investment Property
Equity valuation is typically conducted through two basic methodologies: absolute value and relative value. The same is true for real estate property valuation....
Read more >
dotnet run looks in the wrong location for project output .dll
So my question is how do I tell dotnet.exe where to look for the compiled output? Note: Running "dotnet.exe L2OCommerceInsights.dll" does not ...
Read more >
MSBuild reference for .NET SDK projects
The RollForward property controls how the application chooses a runtime when multiple runtime versions are available. This value is output to ...
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