[英]Adjust service dependencies startup arguments in Visual Studio 2022
Question问题
Is it possible to set startup parameters or configure them in any way for service dependencies in Visual Studio 2022?是否可以为 Visual Studio 2022 中的服务依赖项设置启动参数或以任何方式配置它们? Can I perhaps create my own?我可以创建自己的吗?
Work around解决方法
Startup azurite
manually with my preferred arguments before opening Visual Studio 2022.在打开 Visual Studio 2022 之前,使用我首选的 arguments 手动启动azurite
。
Information信息
When opening a solution in Visual Studio 2022 Azurite is started when there is a service dependency on Storage Azurite emulator (local)
.在 Visual Studio 2022 中打开解决方案时,如果Storage Azurite emulator (local)
存在服务依赖关系,则会启动 Azurite。 When looking at the output I can see that some parameters are passed which I might want to override.在查看 output 时,我可以看到传递了一些我可能想要覆盖的参数。 Specifically the --location
and --debug
parameters.特别是--location
和--debug
参数。 I am however unable to find where Visual Studio 2022 sets these parameters.但是,我无法找到 Visual Studio 2022 设置这些参数的位置。
Output Output
Ensuring Azure Functions Core Tools are up to date. This may take a few minutes...
Azure Functions Core Tools are up to date.
AwesomeSecretProject.FunctionApp: c:\program files\microsoft visual studio\2022\professional\common7\ide\extensions\microsoft\Azure Storage Emulator\azurite.exe --location "C:\Users\SecretAgentBond\AppData\Local\Temp\Azurite" --debug "C:\Users\SecretAgentBond\AppData\Local\Temp\Azurite\debug.log" --skipApiVersionCheck
AwesomeSecretProject.FunctionApp: Azurite Blob service is starting at http://127.0.0.1:10000
AwesomeSecretProject.FunctionApp: Azurite Blob service is successfully listening at http://127.0.0.1:10000
AwesomeSecretProject.FunctionApp: Azurite Queue service is starting at http://127.0.0.1:10001
AwesomeSecretProject.FunctionApp: Azurite Queue service is successfully listening at http://127.0.0.1:10001
AwesomeSecretProject.FunctionApp: Azurite Table service is starting at http://127.0.0.1:10002
AwesomeSecretProject.FunctionApp: Azurite Table service is successfully listening at http://127.0.0.1:10002
Is it possible to set startup parameters or configure them in any way for service dependencies in Visual Studio 2022?是否可以为 Visual Studio 2022 中的服务依赖项设置启动参数或以任何方式配置它们? Can I perhaps create my own?我可以创建自己的吗?
Yes, you can override the parameters --location
& --debug
parameters of the Azurite Storage emulator.是的,您可以覆盖 Azurite 存储模拟器的参数--location
和--debug
参数。
Cmdlet taken from the source of Azurite GitHub Repo : Cmdlet 取自 Azurite GitHub Repo的来源:
azurite --silent --location C:\Users\HariRepo\source\repos --debug C:\Users\HariRepo\source\repos
Then Azurite will start at the specified location and the logs stored in that specified location of --debug
parameter.然后 Azurite 将在指定位置启动,并将日志存储在--debug
参数的指定位置。
Also, you can specify the --location
and --debug
parameters for each Azurite service like blob, queue, table services individually.此外,您可以为每个 Azurite 服务(如 blob、队列、表服务)单独指定--location
和--debug
参数。 If you want to change the --location
and --debug
parameters value, you can reset the Azurite services and able to set to new path.如果要更改--location
和--debug
参数值,可以重置 Azurite 服务并能够设置为新路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.