text:
Device disconnected after write

Prerequisites

[X] I checked the documentation and FAQ without finding a solution
[X] I checked to make sure that this issue has not already been filed
[X] I'm sure that question is related to the library itself and not Bluetooth Low Energy or Classic in general. If that so, please post your question on StackOverflow.
[X] I'm running the latest version

Question
After scanning and connecting the device, I call the following
await plxBleManager       .writeCharacteristicWithoutResponseForDevice(         deviceId,         serviceUUIDs.server,         serviceUUIDs.write,         data,       )       .then(algo => {         console.log('Write successful');       })       .catch(error => {         console.log('Error', error);       });
The first time I run the code I get the 'write successful' text but second time returns a
[BleError: Device D8:3A:DD:83:AE:DC is not connected]
I also have the following method but it won't return anything at all
const onDisconnect = (device: Device) => {     device.onDisconnected(error => {       console.log('device was disconnected', error);     });   };
Am I missing something? Do I need to call another method before doing every write? I'd really appreciate any help.
Testing on Android 13.

Hi @kurogalaxy,
Thank you for raising this question. We will review it and get back to you soon.

I got the current issue now. when I sync data from my BLE device, the BLE device send data to the app(Android) the progress take arround 10 - 30 second. But in the latest version 3.1.2 It's fire disconnection event in this case.  I'm not sure it is the same case. look like when the BLE device do some busy task. that make the library fire disconnect event

same happening to me after updating from 2.0.3 to 3.1.2 on Android, module fires disconnected event a few seconds after connecting.

for me it basically disconnects after the timeout period, despite it actually connecting successfully and I can send and receive data fine before it happens. E.g. below will connect fine for 30 seconds then disconnect for no reason.
const connectedDevice = await this.manager.connectToDevice(device.id, {
      timeout: 30000
});

I have the same problem, in my case iOS works fine, but Android disconnects.

@fustaro, @ex3ndr, @nhaduongc
Thanks for your patience; we'll need a bit more time to get back to you with a solution.

Is there any progress here ? I am also experiencing a disconnect after writing and leading several characteristics (so somehow a heavy read). Unfortunately i have to write a little piece of data after each connect.

Any update on this issue?. I could make it work putting a small delay (around 50ms) before sending every chunk of data, it happens to me with the writeWithResponse call.

Any update on this issue? The same issue, disconnects after 20-30 seconds on Android.

Android 12
React-Native 0.74.5

authors: EmmaZachara ex3ndr fustaro gamilrr jklimke kurogalaxy mikasius nhaduongc

repo: dotintent/react-native-ble-plx


text:
Installation fails becaues of conflicting rspec dependencies on Fedora 34

Installing vagrant-vbguest fails on Fedora 34:
$ vagrant --version
Vagrant 2.2.16
$ cat /etc/redhat-release
Fedora release 34 (Thirty Four)
$ vagrant plugin list
No plugins installed.
$ ruby -v
ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-linux]
$ vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...

Vagrant failed to properly resolve required dependencies. These
errors can commonly be caused by misconfigured plugin installations
or transient network issues. The reported error is:

conflicting dependencies rspec (= 3.10.0) and rspec (= 2.14.1)
  Activated rspec-2.14.1
  which does not match conflicting dependency (= 3.10.0)

  Conflicting dependency chains:
    rspec (= 2.14.1), 2.14.1 activated

  versus:
    rspec (= 3.10.0)

  Gems matching rspec (= 3.10.0):
    rspec-3.10.0

I tried downgrading to Vagrant 2.2.9 but the behavior was the same.
There is a workaround, though:
$ VAGRANT_DISABLE_STRICT_DEPENDENCY_ENFORCEMENT=1 vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Fetching micromachine-3.0.0.gem
Fetching vagrant-vbguest-0.29.0.gem
Installed the plugin 'vagrant-vbguest (0.29.0)'!

After a bit more research this seems like a generic Vagrant / packaging issue:

https://github.com/hashicorp/vagrant/issues/10826

I had the exact same error when trying to install vagrant-hostnamanager plugin. I'll close this ticket but maybe it will be useful to somebody the the same issue

source: gharchive/issue

repo: dotless-de/vagrant-vbguest

license: mit

license_type: permissive

license_source: bigquery


text:
Is HealthCheck functionality moving to Microsoft.Extensions.Diagnostics.HealthChecks from Xabaril / AspNetCore.Diagnostics.HealthChecks?

I recently came across the Microsoft.Extensions.Diagnostics.HealthChecks nuget and was wondering if this is supposed to replace the AspNetCore.Diagnostics.HealthChecks that Xabaril has built at https://github.com/xabaril/AspNetCore.Diagnostics.HealthChecks.
Can you please clarify?

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: c0cbb094-29e9-740a-9fd6-db372641d753
Version Independent ID: 52d8efc9-a336-71d9-6d90-98173cbf6bf4
Content: Health checks in ASP.NET Core
Content Source: aspnetcore/host-and-deploy/health-checks.md
Product: aspnet-core
Technology: aspnetcore-hostdeploy
GitHub Login: @Rick-Anderson
Microsoft Alias: riande

@glennc  can you recommend someone to update the HealthChecks  doc?

@udlose It's not a replacement ... it's a dependency of the framework's healthchecks packages and provides types used by the framework's infrastructure to make health checks work. For example, it's a dependency of Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore. Xabaril's package is a suggestion/example for health check scenarios that simplify some of the set up in common scenarios (this topic uses it for dB probe scenario). If you look at the sample app for this topic, you'll see both in use. Xabaril supports a whole bunch of health check scenarios, which their docs cover. Anything performed by Xabaril's package(s) can be programmed by the dev on their own ... one can even look at their public repo(s) to see and use their approaches per whatever their license is, of course.
@Rick-Anderson AFAIK, there are no changes at this time. We'll need to check with Unai (unaizorrilla) tho for potential 5.0 updates later. Hopefully, we'll just need to update to their 5.0-enabled packages and things will ✨ Just Work! ✨. It's probably best that I take care of this topic when that time comes when we get to the holidays. 🎁 I don't recommend keeping an open issue for it now tho. I'll get it when the time comes.

authors: Rick-Anderson guardrex udlose

license_source: github-api


text:
Provide More Details on "Common Services"

Two requests in this:

For anyone moving to prerendering, they need to know what kind of services need to be registered over on the Server, as opposed to the client. Saying "Common Services" is not at all enlightening nor helpful top that end. Can you explain what kinds of services need to be placed here, vs. which should only be registered on the client?
Can we reference this article from the one discussing converting to PreRendering?

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 53f3209c-2414-9b35-6245-383c9b7c6338
Version Independent ID: cc8dfcd6-8d93-5aa3-c381-2b613e88cdbe
Content: ASP.NET Core Blazor WebAssembly additional security scenarios
Content Source: aspnetcore/blazor/security/webassembly/additional-scenarios.md
Product: aspnet-core
Technology: aspnetcore-blazor
GitHub Login: @guardrex
Microsoft Alias: riande

what kind of services need to be registered over on the Server, as opposed to the client

That's called out by the code block after the line ...

In the server app's Startup.ConfigureServices, register the following additional services:

WRT ...

Saying "Common Services" is not at all enlightening nor helpful top that end. Can you explain what kinds of services need to be placed here, vs. which should only be registered on the client?

... It's whatever services that your app needs to use in both Razor components and in the server-side app. We can't say what they are ... it depends on your app. We show the minimum services AFAIK. This code came over from the PU for inclusion in the docs. I don't recall running it in a test app. This topic is coming up for a UE ("user experience") pass (i.e., a topic overhaul) on https://github.com/dotnet/AspNetCore.Docs/issues/19286, and I've added a cross-link to this issue there so I won't forget to work on this section further.
🐞
I think that there's a bug 🐞 in the works here. The line services.Add...; should be in the ConfigureCommonServices method. I'll take care of that.

I found the original content ...
https://github.com/dotnet/aspnetcore/issues/15253#issuecomment-604581439
"Common services" aren't described in detail, and I took it to mean any service that your app needs to use both via Razor components and via the server-side app.
@javiercn TL;DR ... In your remarks for supporting auth with prerendering, you sent over ...

On your Client/Program.cs factor common service registrations into a separate method.

... and we have the code to show setting up a ConfigureCommonServices method.
"Common services" are just services that both apps need for developer purposes, right? Thare aren't "common" framework services that are placed in the ConfigureCommonServices method, correct?

authors: guardrex taylorchasewhite


text:
Documentation for "Configure Identity services" is not clear

Documentation for "Configure Identity services" is not clear, Microsoft post this:
"
Services are added in Program.cs. The typical pattern is to call methods in the following order:

Add{Service}
Services.Configure{Service}

"
After that there are a example and next this text:
"
The preceding code configures Identity with default option values. Services are made available to the app through dependency injection.
"
BUT

What is the equivalent code for add{service}?

Add{service} means builder.Services.AddDbContext.....?
what about builder.Services?

What is the equivalent code for Services.Configure{Service}?
Services.Configure{Service} means builder.Services.Configure?

What about builder.?
What about "builder.Services.Configure" does don´t have the pattron "Services.Configure{Service}"

Could be a good idea to indicate into documentation what is the specifict section por each part of

Add{Service}
Services.Configure{Service}

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 94bfd895-d2af-390b-0801-428b36a27ff4
Version Independent ID: 0e0d870e-e49a-e16c-c259-68d58e701b8f
Content: Introduction to Identity on ASP.NET Core
Content Source: aspnetcore/security/authentication/identity.md
Product: aspnet-core
Technology: aspnetcore-security
GitHub Login: @Rick-Anderson
Microsoft Alias: riande

The docs for Identity are very confusing and lacking in general.

Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog manageable. If you believe there is a concern which hasn't been addressed, please file a new issue.

authors: Byron2016 Ducki Rick-Anderson


text:
Add a topic on implementing Custom Authentication in Blazor Server

Hey @guardrex, it's your favorite end user again with another dynamite suggestion:
Add a topic (not sure where) on how to implement Custom Authentication in Blazor Server.
I am struggling to do this, and I have not found any guidance in the docs on this subject, except here   But that topic is about Hybrid Blazor Apps, so it's not directly applicable to Blazor Apps.  It took me a great deal of search to even find that topic.
I have searched and searched, and there are no good blog posts or Stack-Overflow questions about this topic, so I think it would be a great one to add to the docs.  I am still struggling to adapt the Hybrid sample to a regular Blazor Server App.
I think doing Custom Authentication is a worthwhile topic, as Identity/Active Azure Directory/3rd Party Logins are only the start of ways to Authenticate End users.
In my scenario, I am creating a website for a company who wants users to not register, only input a few bits of information which is then validated against their existing user store.  If they pass the validation, then the user should be considered Authorized.  Seems like a valid use case for Custom Authentication.
Also, sense Authentication is an important topic to get correct, so some official guidance would be prudent.
So anyways, I just thought I would pass this on to you as I have spent quite a bit of time trying to work this out.
I think it would be a bit much to include directly in this topic, but a link to another article or a sample app would be great.
I would call it "Custom Authorization", although it is actually about implementing a custom AuthenticationStateProvider, but users searching for the topic are not going to know that.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: f75d9405-19a5-a14b-3a09-a3605b240750
Version Independent ID: 1247ee64-fbc9-ce29-0710-f6e59380f5ee
Content: ASP.NET Core Blazor authentication and authorization
Content Source: aspnetcore/blazor/security/index.md
Product: aspnet-core
Technology: aspnetcore-security
GitHub Login: @guardrex
Microsoft Alias: riande

Hi ... Blazor Server apps are ordinary ASP.NET Core apps, so the guidance in the main doc set applies. We won't provide further info than what u see in the Blazor Server node today per management's decision.

Is there guidance in the main doc set for Custom Authentication?  If so, I cannot find it.  Maybe that would be a good place to add a non-Blazor specific article.  I would expect to find something here on the topic.

Not sure what you mean by "custom authentication." If you mean a custom AuthenticationStateProvider, it's covered here ...
https://docs.microsoft.com/en-us/aspnet/core/blazor/security/server/?view=aspnetcore-6.0&tabs=visual-studio#implement-a-custom-authenticationstateprovider
... the dev can do anything they want in there with the claims principal and/or claims identity.

Great, thank you Luke, that is exactly what I was looking for.  I don't know how I managed to miss that.

One last suggestion:  When I was looking for this topic, I was looking under the "ASP.NET Core Blazor authentication and authorization" topic, under the "AuthenticationStateProvider Service" section.  At the end of this section, there are some links which say "For more information...."
I would like to suggest that you add a link to the above topic to this: https://docs.microsoft.com/en-us/aspnet/core/blazor/security/server/?view=aspnetcore-6.0&tabs=visual-studio#implement-a-custom-authenticationstateprovider
This would have made it easy to find.
For example:  "For more information on creating a Custom Authentication State Provider, see..."
Just my two cents.  I seriously spent quite some time searching for this and only found the topic because you gave it to me above.

commit # #

commit # #

@jereytucker ... Please don't post random comments to issues and PRs here. This is an active repo with lots of work in progress, and these are generating pointless pings to the staff here (i.e., ME 😄 lol).

authors: gregoryagu guardrex jereytucker


text:
Deprecated CSS preprocessor

Delegate.SassBuilder is archived at github. Consider replacing it with AspNetCore.SassCompiler

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: 2703a48e-8b35-53fc-ac36-cfb395833077
Version Independent ID: 39d464d9-aca6-34fa-7e52-5fde2e393ba7
Content: ASP.NET Core Blazor CSS isolation
Content Source: aspnetcore/blazor/components/css-isolation.md
Product: aspnet-core
Technology: aspnetcore-blazor
GitHub Login: @guardrex
Microsoft Alias: riande

Thanks @boppbo ... I'll put it into a PR and see if management would like to approve the swap.

@guardrex found two another occurences. There might be more

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: 164d7efe-01bf-0b26-7a23-f10704f338f5
Version Independent ID: b3e2bc87-1582-2d34-c7c2-7c8e901ac771
Content: Introduction to Razor Pages in ASP.NET Core
Content Source: aspnetcore/razor-pages/index.md
Product: aspnet-core
Technology: aspnetcore-razorpages
GitHub Login: @Rick-Anderson
Microsoft Alias: riande

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: d2e47828-6da8-2323-053f-dcbf7475b1b6
Version Independent ID: 62d4c2be-4233-64e1-2a3d-8a5e98d9d941
Content: Views in ASP.NET Core MVC
Content Source: aspnetcore/mvc/views/overview.md
Product: aspnet-core
Technology: aspnetcore-mvc
GitHub Login: @Rick-Anderson
Microsoft Alias: riande

Thanks ... I'll search the whole repo and get them all out. Stand-by ......

Looks like there were only two other spots, which arrive in those articles by an INCLUDE file. I've added a commit to the PR to change that INCLUDE file.

authors: boppbo guardrex


text:
Error when running the Update Database Command

When i run the Update Database Command this Error pops up.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SNI_PN11, error: 50 - Local Database Runtime error occurred. Error occurred during LocalDB instance startup: SQL Server process failed to start.
Im a complete beginner to asp.net and i couldn't get past this. I hope you guys can help me

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: 6719f08e-3bd7-dc1a-71df-f2ef9fbca9d8
Version Independent ID: 7096fdb3-612e-9e00-bd0b-8ea4886a09ce
Content: Part 2, add a model
Content Source: aspnetcore/tutorials/razor-pages/model.md
Product: aspnet-core
Technology: aspnetcore-tutorials
GitHub Login: @wadepickett
Microsoft Alias: wpickett

Hello! Thanks for contacting us. This sounds like a general question about using ASP.NET Core. While we try to look at and respond to all issues, for questions like this we recommend posting to a community support group like Stack Overflow with the asp.net-core tag.

Stack Overflow
ASP.NET Core Slack
ASP.NET Gitter

Potential bugs in the ASP.NET Core framework and product feedback can be reported at dotnet/aspnetcore issues (include full repro steps and cross-link to a repro project in GH when appropriate). For Visual Studio, use the Report a Problem gesture or Suggest a Feature gesture within VS, which open internal issues for the VS team. For Visual Studio Code, you can open an issue at microsoft/vscode issues.

authors: MaartenvdGoor Rick-Anderson


text:
TEST ISSUE

Description
This is a test issue.
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/?view=aspnetcore-7.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/index.md
Document ID
1668c8fb-024c-c86d-d4d5-e22e3355c04b
Article author
guardrex

Leave open for a bit ... still working out the GH CLI command to add it to the project


text:
Fix typo

Property is named ObjectId in the example shown.

Internal previews

📄 File
🔗 Preview link

aspnetcore/mvc/models/model-binding.md
Model Binding in ASP.NET Core

@dotnet-policy-service agree

@dotnet-policy-service agree

@TsukiCTF please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
@dotnet-policy-service agree [company="{your company}"]

Options:

(default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.

@dotnet-policy-service agree

(when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.

@dotnet-policy-service agree company="Microsoft"

Contributor License Agreement

Thanks for the contribution. Be sure to check out your name as a contributor about the 3rd of next month on the What's new page in the Community contributors section at the bottom.

source: gharchive/pull-request

authors: Rick-Anderson TsukiCTF


text:
Update redirecttologin-component.md

It is inside "Layout" folder. I have checked it in .NET 8.0 version of blazor wasm project.

Hello @yogyogi ... We can't do this without versioning it, and I'm ok not doing so in this case as long as the text doesn't mention it elsewhere. In fact, I may have updated it to remove this on purpose earlier in order to avoid having literally hundreds (😨) of versioning blocks to specify locations of things that changed at 8.0.

Oh ... wait ... hold a sec. I see what you mean about it saying Shared NOW ... today.
Sorry ... I'm wrapping up most of my work for the day and trying to get out of here ... going tooooooo FAST 🏃.
The change will be to remove the folder reference. I'll make the update and merge this. Thanks for the PR.

authors: guardrex yogyogi


text:
Native Mobile Backend: Replaced Postman with curl and jq

Internal Review: Link to edited section on testing
Fixes #31984

Removed Postman testing examples.
Replaced with curl + jq install and test instruction.

The original application example was not changed but was run and the REST API tested with the new curl instruction, keeping to the scope of the issue which is to update the testing tool/instruction.

Internal previews

📄 File
🔗 Preview link

aspnetcore/mobile/native-mobile-backend.md
Create backend services for native mobile apps with ASP.NET Core

@CamSoper, could you review this curl approach for testing the API in the tutorial?
You can skip right to the edited testing section here for review

@CamSoper, could you review this curl approach for testing the API in the tutorial?
You can skip right to the edited testing section here for review


text:
Please fix the link for the referenced blog post

Can you please update the link for the Blog Post?

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: af0b8bf0-8cdb-e5ae-0344-e2e281f41969
Version Independent ID: 90d5f106-4bee-1075-3e43-054556a301df
Content: Handling transaction commit failures - EF6
Content Source: entity-framework/ef6/fundamentals/connection-resiliency/commit-failures.md
Product: entity-framework
Technology: entity-framework-6
GitHub Login: @divega
Microsoft Alias: avickers

@krptodr Unfortunately, almost all old .NET blog links were broken a few years ago. We'll look at finding the new links an updating them in our docs.

authors: ajcvickers krptodr


text:
Useless

[Enter feedback here] Nothing more here than over the IDE. It's not just this page, it's the MS documentation in general 😞

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 3c0cb48c-ea16-6478-2cf1-c0c71a6b3fb2
Version Independent ID: ff4c965b-24b0-26d8-3656-f426218293cd
Content: SqlExpressionFactory.Function Method (Microsoft.EntityFrameworkCore.Query)
Content Source: dotnet/xml/Microsoft.EntityFrameworkCore.Query/SqlExpressionFactory.xml
Product: entity-framework-core
GitHub Login: @dotnet-bot
Microsoft Alias: divega

This API has already been documented more thoroughly for 5.0, which hasn't been released yet. Consult the source code for the new documentation, once 5.0 is out that will appear on the website too.

authors: carlbm roji


text:
Added System.Numerics.Vectors constructors and operators

Following #136
Added System.Numerics.Vectors constructors and implicit/explicit operator converters to:

AffineTransform
Color
Point
PointF
Size
SizeF

Regarding operators, I followed these rules:

Vectors to Maui operators are implicit
Maui to Vectors operators are explicit
Vectors to Maui (double precission) are implicit
Maui to Vectors operators (double precission) not implemented to prevent misleading precission loss.

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.:x: vpenades sign nowYou have signed the CLA already but the status is still pending? Let us recheck it.

authors: dnfadmin vpenades

license: MIT


text:
Exception thrown with auxiliary keyboard keys and knobs

Summary
When using auxiliary keys or knobs on a keyboard, the application crashes.  At first, I thought it was something in my library Velaptor, but after some investigation, I discovered that an InvalidOperationException is being thrown from the Reset() method in the ViewImplementationBase abstract class in the Silk.NET.Windowing.Internals namespace.
I know this is because I looked into the internal exception being thrown in Velaptor, and the exception message is You cannot call 'Reset' inside of the render loop!.  I found this by searching in the Silk source code for tag v2.22.0.
When I say 'auxiliary', I mean custom keyboard keys and knobs that are used for volume, mute, skipping songs, etc.
I have a mechanical keyboard and my laptop keyboard, which have some aux keys and/or knobs that cause the exception to be thrown.
Since Velaptor is open source, you can run the VelaptorTesting project.  Once the window is displayed, adjust the audio knob on a keyboard that has one, and it should crash. I attempted to see if the problem would occur in the Imgui sample project, but I had issues with errors being thrown by nuke.  I am confident you can reproduce the issue with the Silk example projects.
I subscribe to a keyboard key-down event of an IInputContext instance.  I set a breakpoint in my event handler, but it is not invoked.  It simply immediately throws an exception.
Steps to reproduce

Platform: Desktop
Framework Version: dotnet 9.0
API: OpenGL
API Version: OpenGL 4.5 Core

Open the solution for the latest version tag of Velaptor or a Silk sample project.
Run the VelaptorTesting project or a Silk sample project
Adjust the volume knob or hit an aux key on a keyboard that has a this functionality.
Observe that an exception is thrown.

Comments
The screenshots below are the knobs and keys that are causing the exception:

More Info:

MONTECH Mechanical Keyboard
[Asus ROG Zephyrus G16 Laptop](I know this is because I looked into the internal exception being thrown in Velaptor, and the exception message is You cannot call 'Reset' inside of the render loop!.  I found this by searching in the Silk source code for tag v2.22.0.)

[!Note]
This is not just a volume knob.  It can be used for other functions on the keyboard, such as the lighting.
Hitting the volume up and down on my laptop keyboard causes the same issue.

If you need more information or testing, let me know, and I would be glad to help. Thanks!!
If you know how to fix this issue, please submit a pull request instead!

Do you have a stack trace

authors: CalvinWilkinson Perksey


text:
.NET Core Docker images will move to multi-arch based tags

Summary
Docker has a multi-arch feature that microsoft/dotnet-nightly recently started utilizing.  The plan is to port this to the official microsoft/dotnet repo shortly.  The multi-arch feature allows a single tag to be used across multiple machine configurations.  Without this feature each architecture/OS/platform requires a unique tag.  For example, the microsoft/dotnet:1.0-runtime tag is based on Debian and microsoft/dotnet:1.0-runtime-nanoserver if based on Nano Server.  With multi-arch there will be one common microsoft/dotnet:1.0-runtime tag.  If you pull that tag from a Linux container environment you will get the Debian based image whereas if you pull that tag from a Windows container environment you will get the Nano Server based image.  This helps provide tag uniformity across Docker environments thus eliminating confusion.
Current microsoft/dotnet tags:

1.0.5-runtime, 1.0-runtime (1.0/debian/runtime/Dockerfile)
1.0.5-runtime-nanoserver, 1.0-runtime-nanoserver (1.0/nanoserver/runtime/Dockerfile)
1.0.5-runtime-deps, 1.0-runtime-deps (1.0/debian/runtime-deps/Dockerfile)
1.0.5-sdk, 1.0-sdk (1.0/debian/sdk/Dockerfile)
1.0.5-sdk-nanoserver, 1.0-sdk-nanoserver (1.0/nanoserver/sdk/Dockerfile)
1.1.2-runtime, 1.1-runtime, 1-runtime, runtime (1.1/debian/runtime/Dockerfile)
1.1.2-runtime-nanoserver, 1.1-runtime-nanoserver, 1-runtime-nanoserver, runtime-nanoserver (1.1/nanoserver/runtime/Dockerfile)
1.1.2-runtime-deps, 1.1-runtime-deps, 1-runtime-deps, runtime-deps (1.1/debian/runtime-deps/Dockerfile)
1.1.2-sdk, 1.1-sdk, 1-sdk, sdk, latest (1.1/debian/sdk/Dockerfile)
1.1.2-sdk-nanoserver, 1.1-sdk-nanoserver, 1-sdk-nanoserver, sdk-nanoserver, nanoserver (1.1/nanoserver/sdk/Dockerfile)
2.0.0-preview1-runtime, 2.0-runtime, 2-runtime (2.0/debian/runtime/Dockerfile)
2.0.0-preview1-runtime-nanoserver, 2.0-runtime-nanoserver, 2-runtime-nanoserver (2.0/nanoserver/runtime/Dockerfile)
2.0.0-preview1-runtime-deps, 2.0-runtime-deps, 2-runtime-deps (2.0/debian/runtime-deps/Dockerfile)
2.0.0-preview1-sdk, 2.0-sdk, 2-sdk (2.0/debian/sdk/Dockerfile)
2.0.0-preview1-sdk-nanoserver, 2.0-sdk-nanoserver, 2-sdk-nanoserver (2.0/nanoserver/sdk/Dockerfile)

New multi-arch microsoft/dotnet-nightly tags:

1.0.5-runtime, 1.0-runtime:

1.0.5-runtime-jessie (1.0/runtime/jessie/Dockerfile)
1.0.5-runtime-nanoserver (1.0/runtime/nanoserver/Dockerfile)

1.0.5-runtime-deps, 1.0-runtime-deps:

1.0.5-runtime-deps-jessie (1.0/runtime-deps/jessie/Dockerfile)

1.0.5-sdk, 1.0-sdk:

1.0.5-sdk-jessie (1.0/sdk/jessie/Dockerfile)
1.0.5-sdk-nanoserver (1.0/sdk/nanoserver/Dockerfile)

1.1.2-runtime, 1.1-runtime, 1-runtime, runtime:

1.1.2-runtime-jessie (1.1/runtime/jessie/Dockerfile)
1.1.2-runtime-nanoserver (1.1/runtime/nanoserver/Dockerfile)

1.1.2-runtime-deps, 1.1-runtime-deps, 1-runtime-deps, runtime-deps:

1.1.2-runtime-deps-jessie (1.1/runtime-deps/jessie/Dockerfile)

1.1.2-sdk, 1.1-sdk, 1-sdk, sdk, latest:

1.1.2-sdk-jessie (1.1/sdk/jessie/Dockerfile)
1.1.2-sdk-nanoserver (1.1/sdk/nanoserver/Dockerfile)

2.0.0-preview1-runtime, 2.0-runtime, 2-runtime:

2.0.0-preview1-runtime-jessie (2.0/runtime/jessie/Dockerfile)
2.0.0-preview1-runtime-nanoserver (2.0/runtime/nanoserver/Dockerfile)

2.0.0-preview1-runtime-deps, 2.0-runtime-deps, 2-runtime-deps:

2.0.0-preview1-runtime-deps-jessie (2.0/runtime-deps/jessie/Dockerfile)

2.0.0-preview1-sdk, 2.0-sdk, 2-sdk:

2.0.0-preview1-sdk-jessie (2.0/sdk/jessie/Dockerfile)
2.0.0-preview1-sdk-nanoserver (2.0/sdk/nanoserver/Dockerfile)

This change has been in microsoft/dotnet-nightly for a little over a week. If you have feedback please file an issue on the .NET Core Docker GitHub repo.
.NET Core Docker Tools
The tooling to produce multi-arch tags is still evolving.  As a result we found it necessary to create some tooling to build the images and produce the manifest that enables multi-arch.  This tooling is open sourced as well.

@leecow @michaelsimons @richlander

that simplifies image management and deployment!

Just wonder why WindowsServer Core images are not being published anymore, but good start! 😃

@galvesribeiro, The only .NET Core images we are producing for Windows is on Nano Server.  The only .NET full framework images we are producing is on Windows Server Core.  Nano Server is much lighter and thus provides the best docker experience for running your .NET Core apps on Windows.

@MichaelSimons hummm I may be wrong, but I could swear I saw windowsservercore images before. There are legitimate reasons on why you would use Windows Server Core over NanoServer even with .Net Core. For example, one would need PInvoke a Win32 API or a 3rd party native library which depends on it and that API would not be available on NanoServer.
I'm all up to use NanoServer, in fact I am using it. But I have cases where native code is required and NanoServer don't work with it...

@galvesribeiro can still get the 5GB server core based images if that's your bag https://hub.docker.com/r/microsoft/windowsservercore/

@galvesribeiro What do you mean? The lastest windowsservercore image was published just a 7 days ago. Are you referring to the .NET Framework images and windowsservercore not yet moving to 4.7? The full .NET Framework images were pushed just yesterday. We are still researching how moving the latest tag to 4.7 would affect users.

Oh I see. Yes, @benaadams is right. You can always copy and paste layers from our nanoserver Dockerfile that install .NET Core and add them to a Dockerfile that uses the windowsservercore base image.

@galvesribeiro - you are correct in that we had .NET Core images based on windowsservercore for a short period while we were experimenting what made the most sense for everyone.  These were removed under https://github.com/dotnet/dotnet-docker/pull/129.

@benaadams I'm not saying it is impossible, I'm just saying it should be in the list of supported pre-baked .Net Core images.  And it is not a matter of "my bag", it is a legitimate use-case where people with .Net Core applications must  run it on Windows Server Core due to the bigger (native) API surface in it.
@kendrahavens Hey, I was saying that it should be on the list of .Net Core images since it is a valid scenario.
@MichaelSimons sure, I just saw that PR as well. Although I don't agree with the rationale that "it is better to use full framework with Server Core" I respect the decision. 😄
It was just a thought, don't want to make this a big case, just remember that almost everyone in corporate world that is migrating from .Net (full) Framework to .Net Core depends on that API to work and that would help migration paths.
Anyway, kudos for @kendrahavens on the announcement. Good work team!

two things

Could announcements at dotnet/announcements get a separate thread on different repo, and have conversations in this repo get locked? Personally, I enjoy subscribing to announcements, but I'm not sure I want to be emailed for every comment, and reply.

While I would personally never consider running windows server. I'd think it would make sense to publish a servercore aspnetcore dockerfile. I work at a large e-commerce company, and I see many teams that want to move their existing apps to core. They like the programming model, and prefer the unified controllers. They want to eventually get off windows server, but parts of the API are still missing, or they are still dependent on other packages not yet core ready.   Many of those missing api's are making a return in netstandard 2.0 (yuge kudos btw).

I think for many enterprises there is a transitory period, where an existing app is re-written ontop of mvc core, targeting full framework. They keep it on full framework, because much of their existing code relies on it. Then eventually the full framework training wheels are removed. I think it would make sense to provide a docker image for such a story, however its understandable if it seems unnecessary.
I do agree with @galvesribeiro thoughts, but as previously mentioned. We can easily roll our own.

Moving conversation to dotnet-docker issue to clean up notifications for the announcement repo.

Reopening according to process.

authors: Jonathan34 MichaelSimons TerribleDev benaadams galvesribeiro kendrahavens terrajobst

repo: dotnet/announcements


text:
Azure function support

Do you plan to integrate Aspire with Azure functions (I haven’t seen similar question in dotnet Conf nor samples and docs)?

Yes we plan to support functions as well, but it's not yet supported in the first preview.
cc @fabiocav

what's missing to support Aspire in Azure Functions v4 isolated?
Would be nice to sketch out the required elements and identify which one are up for grabs, so we as a community can help. Thanks!

If the Aspire cloud deployment manifest tooling could automate the hosting & config of Azure Functions within Azure Container Apps (ACA) that would be fabulous. I need this but the protracted Dev/Ops guidance docs that describe how to host Azure functions within ACA have deterred me so far.

I added more details.

Also opened an issue and a new milestone in the .NET Worker repo to track the work happening there: https://github.com/Azure/azure-functions-dotnet-worker/issues/2090

I'm currently in the process of developing several local examples using Azure Functions with Aspire to better understand their capabilities and limitations. During this spike, I've encountered several issues and have a few questions. Could you please advise on the appropriate repository and process for reporting these issues and inquiries related to Azure Functions specifically with Aspire?

I am able to spin it up locally, but am having trouble with getting rabbitmq consumer attribute parameter to work properly

And in the logs of the consumer I am seeing some connection issues, which I assume is just the function trying to connect to the container before it's actually up and running

I have been trying to get something working locally also, and you are further than I am - but don't you need the ServiceDefaults added?

Without it, wouldn't it just be using your local.settings.json?

This is good stuff! I was trying to figure out how exactly how do this and stuck on that piece with the service defaults. I can add that to my repo. I'm just doing it in my repo right now and then going to put a pr into the samples repo once I have something presentable lol. Just having issues with the sln building (and something with the csproj and needing to make a build.prop.targets) and just want to stay focused on getting the poc done first. But anyway, I am not sure what the issue is and why anything grpc is being mentioned? Can you send a screenshot of the terminal with the error? I am just running this via visual studio 2022 preview with the .net 8 and all that.

I put my code in a repo for you. Basically just the Aspire Starter template, plus a templated function app (manually set to .NET 8).
Here is a repo: https://github.com/sjasperse/AspireStarterWithFunctions/tree/master/AspireStarter.AppFunctions
Screenshot of the terminal output:

From what I can google, this sounds like an expected error when the function app is started like a regular .exe project, instead of using func start (which makes sense that it would expect the function runtime to be there) - so I'm confused how you have it working :-). I didn't really expect it to work, until I saw your screenshot and I started scratching my head.
Also - I'm on a Mac. Maybe that has something to do with it?

I put my code in a repo for you. Basically just the Aspire Starter template, plus a templated function app (manually set to .NET 8). Here is a repo: https://github.com/sjasperse/AspireStarterWithFunctions/tree/master/AspireStarter.AppFunctions
Screenshot of the terminal output:
From what I can google, this sounds like an expected error when the function app is started like a regular .exe project, instead of using func start (which makes sense that it would expect the function runtime to be there) - so I'm confused how you have it working :-). I didn't really expect it to work, until I saw your screenshot and I started scratching my head.
Also - I'm on a Mac. Maybe that has something to do with it?

I would remove the

 tracing.AddAspNetCoreInstrumentation()
     .AddGrpcClientInstrumentation()
     .AddHttpClientInstrumentation();

from the extension method in service defaults

I realized I never came back and replied to this. I removed those lines you suggested (good suggestion), and had the same result.
I also tried your repo on my windows VM, and got the same gRPC error as on my mac.
I am still so confused how you got your function app to start up at all under Aspire. haha.

It does start, but service discovery doesn't work - this does:
var apiservice = builder.AddProject<Projects.AspireSample_FunctionApp>("apiservice");

builder.AddProject<Projects.AspireSample_Web>("webfrontend")
    .WithReference(cache)
    .WithReference("apiservice", new Uri("http://localhost:7071"));

The trick with @sjasperse's code is that there are overrides that use IHostBuilder instead of IHostApplicationBuilder.
This is my az func, and it seems to work fine - web app correctly gets weather:
[Function("weatherforecast")]
public async Task<HttpResponseData> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req)
{
    _logger.LogInformation("C# HTTP trigger function processed a request.");
    var summaries = new[]
    {
        "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
    };

    var response = req.CreateResponse(HttpStatusCode.OK);

    var forecast = Enumerable.Range(1, 5).Select(index =>
        new WeatherForecast
        (
            DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
            Random.Shared.Next(-20, 55),
            summaries[Random.Shared.Next(summaries.Length)]
        ))
        .ToArray();

    await response.WriteAsJsonAsync(forecast);

    return response;
}

Also, needed to make sure the client was using the right (az func) uri:
public class WeatherApiClient(HttpClient httpClient)
{
    public async Task<WeatherForecast[]> GetWeatherAsync()
    {
        return await httpClient.GetFromJsonAsync<WeatherForecast[]>("/api/weatherforecast") ?? [];
    }
}

Your azure function needs to wire up service discovery to the service collection for it to work.

If I am remembering what I did correctly, I did notice that the grpc issues is that this only happens in the .net aspire 8 sample project. If you go and create a .net aspire stand alone project in a seperate sln, then service discovery seems to work fine from what I remember looking into a few weeks ago in this repo.
I was able to get an example working here
https://github.com/josephaw1022/AspireWithAzureFunctions/tree/master
But when I wrote this pr, I noticed the grpc issue that @sjasperse ran into
https://github.com/dotnet/aspire-samples/pull/81
and that's when I started to think that it's not your device and something in the sln that is the root cause of this issue.

I also have the System.InvalidOperationException: The gRPC channel URI 'http://:'/; could not be parsed. exception when I am trying to run an azure function that it has a QueueTrigger.
@josephaw1022 In your repo, commenting out the AddProject of the QueueConsumer leads on the same error.
So is there any fix for that?

I found a temporary workaround to make azure functions work:
public static class Extensions
{
	public static IResourceBuilder<ExecutableResource> AddAzureFunction<TServiceMetadata>(
		this IDistributedApplicationBuilder builder,
		string name,
		int port,
		int debugPort)
		where TServiceMetadata : IServiceMetadata, new()
	{
		var serviceMetadata = new TServiceMetadata();
		var projectPath = serviceMetadata.ProjectPath;
		var projectDirectory = Path.GetDirectoryName(projectPath)!;

		var args = new[]
		{
			"host",
			"start",
			"--port",
			port.ToString(),
			"--nodeDebugPort",
			debugPort.ToString(),
			"--pause-on-error"
		};

		return builder.AddResource(new ExecutableResource(name, "func", projectDirectory, args))
			.WithOtlpExporter();
	}
}

And then in Program.cs add the following
builder.AddAzureFunction<Projects.MyAzureFunction>(
	"MyAzureFunction", port: 7074, debugPort: 5944);

@ChasakisD Good stuff!! One reservation that I have is that if I'm remembering everything correctly, I do remember I was able to get azure functions working in an Aspire project as is. However, the issue has only occurred in this repo. And this fix that you came up with does work, but it doesn't appear to be representative of how it would look running it normally.

If the Aspire cloud deployment manifest tooling could automate the hosting & config of Azure Functions within Azure Container Apps (ACA) that would be fabulous.

Good news - this is on the horizon. We're working with our partners in Functions to prepare not only Functions support with Aspire, but also publishing of Functions to Azure Container Apps. I can't speak to a timeline today, but I'm aspiring to have this in your hands shortly after our GA of Aspire, as our priority is to give customers a fantastic end-to-end publishing experience to Azure Container Apps first. Publishing Functions to Container Apps is part of that story.

I was finally able to get a working function example going with @ChasakisD helpful extension method!
I like it!.
https://github.com/sjasperse/AspireStarterWithFunctions/
It uses azurite as a queue mechanism, submits a message on each API request, with a correlation id, and then an isolated function app which uses middleware to create an OpenTelemetry trace with correlation id as the parent context (a little ugly how that's done, but it works).
I couldn't figure out how to slip service discovery nicely into the function app, so I had to brute-force it a bit with the connection string environment variable.

In .NET Aspire preview 5 (8.0.0-preview.5.24201.12) the constructor signature of ExecutableResource has changed and the args are set via an extension method:
public static class Extensions
{
    public static IResourceBuilder<ExecutableResource> AddAzureFunction<TProjectMetadata>(
        this IDistributedApplicationBuilder builder,
        string name,
        int port,
        int debugPort)
        where TProjectMetadata : IProjectMetadata, new()
    {
        var projectMetadata = new TProjectMetadata();
        var projectPath = projectMetadata.ProjectPath;
        var projectDirectory = Path.GetDirectoryName(projectPath)!;

        var args = new[]
        {
            "host",
            "start",
            "--port",
            port.ToString(),
            "--nodeDebugPort",
            debugPort.ToString()
        };

        return builder.AddResource(new ExecutableResource(name, "func", projectDirectory))
            .WithArgs(args)
            .WithOtlpExporter();
    }
}

I have some sample code here:

https://github.com/hlaueriksson/Markupolation/tree/main/samples/Markupolation.Sample.Aspire.AppHost

In .NET Aspire preview 5 (8.0.0-preview.5.24201.12) the constructor signature of ExecutableResource has changed and the args are set via an extension method

There is also an AddExecutable extension method that takes care of the creation of the ExecutableResource.

A question, but when deploy in azure, will be container app or azure function?

We're going to start with a container apps because it simplifies the networking requirements. Once we have that end to end working, then we'll explore deploying to functions compute.

Work has started on this here https://github.com/dotnet/aspire/pull/5418

Work has started on this here #5418

This PR has been merged and nightly builds of the new Aspire.Hosting.Azure.Functions package are now available. I made a sample repo with the integration over at https://github.com/captainsafia/AspireAzureFunctionsSample.
There's still a few kinks with the integration that require some changes in the Azure Functions Core Tools and Worker SDKs. The README of the repo above outlines some of the workarounds that need to applied for now in order to work around these issues. If you run into problems that aren't documented, let me know.
With the sample in the repo above, you should be able to:

Use Azure Storage Queue, Azure Storage Blobs, and Azure Event Hubs as resources in your Functions project (support for more coming)
Launch Functions projects in your Aspire App Host

Stay tuned for more work on this front!

Work has started on this here #5418

Thank very much!
If you need my help, I want to contribute to .NET ASPIRE

Will this also support all the dapr and container app related functionality in Aspire? So if I wanted to configure a dapr pubsub trigger in a function, I could run it locally?

Nope, for Aspire 9 we support only a few triggers in preview mode:

HTTP triggers
Azure Storage Queue triggers
Azure Storage Blob triggers
Azure Service Bus triggers
Azure Event Hub triggers

Is there a Github repo or reference for making use of this feature w/ .NET 9, Aspire 9, from the CLI?
The article involves using Visual Studio, but I am on a Mac. So I have tried using the Azure CLI, along with the repo found here:
https://github.com/captainsafia/AspireAzureFunctionsSample/tree/main
The above is referenced in this thread, and works OOTB, but upgrading the NuGet packages to Preview 2 breaks things, so I think that repo is out of date. This can be seen by cloning the above repo and making the following change:
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="2.0.0-preview2" />

Afterward, Program.cs has errors due to FunctionsWebApplicationBuilder being undefined.

@nwoolls The Functions team shipped new packages yesterday that changes the way they implement IHostApplicationBuilder which is why you see the issue you ran into when you upgrade Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore to preview2. While Functions' packages are in preview, there will be breaking changes like this, unfortunately. :/
I've updated the sample app with the latest bits to demonstrate what the new FunctionsApplicationBuilder. See https://github.com/captainsafia/AspireAzureFunctionsSample/commit/2279995c4b9272ddd0586b57b933261246e3143c.

@captainsafia thank you so much for that! With that change things are aligned and I'm seeing a success as far as running the Aspire host and being able to see the Function in the dashboard and trigger it with cURL.
I have a couple of questions to see what the current capabilities are so I have the right expectations (other than the changes to public APIs going on).
Firstly, I can run the Azure Functions app just fine from the CLI using func start, and I can also run it just fine from there CLI using dotnet run —project path/to/AppHost. All good there.
However, if I try to debug from Visual Studio Code (or Rider - working on a Windows VM ATM to try out VS proper), I get an error.
With Preview 1 of the libs, it was:

The gRPC channel URI 'http://:7075' could not be parsed

After updating the libs to Preview 2, the error is:

Configuration is missing the 'HostEndpoint' information. Please ensure an entry with the key 'Functions:Worker:HostEndpoint' is present in your configuration.

Second, I see from your sample repo that you pass the HTTP Functions app into the Web API app as a resource. However, I don't see where you reference that from your application. Is it possible to use the normal Aspire functionality and refer to that resource by name with an HTTP client?

However, if I try to debug from Visual Studio Code (or Rider - working on a Windows VM ATM to try out VS proper), I get an error.

Yes, this is a known limitation at the time. The VS Code team is working on supporting launch and debug for Functions projects so this should be supported soon. At the moment, we're limited to running from Visual Studio or the CLI.

Is it possible to use the normal Aspire functionality and refer to that resource by name with an HTTP client?

Yes, although it is not demonstrated in the sample, service discovery will work with this. You can write code like the following:
builder.Services.AddHttpClient<FunctionsClient>(client =>
{
    // Learn more about service discovery scheme resolution at https://aka.ms/dotnet/sdschemes.
    client.BaseAddress = new("http://funcapp");
});

I've spent quite some time trying to upgrade our existing Aspire setup with Azure Functions to the new version and the preview version of Azure Functions support. Ultimately managed to get it working from dotnet CLI on Windows, but am seeing issues on macOS and in Visual Studio.
On macOS, the App Host starts up correctly, the dashboard is accessible, but the Functions project exits with following error:

2024-10-18T17:44:16 MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
2024-10-18T17:44:22
2024-10-18T17:44:22
2024-10-18T17:44:22
Error building project

On Windows, dotnet CLI works fine, but when running from Visual Studio the Functions project never starts up, and after quite some time in the App Host console I see following:

fail: Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]
timeout of 120 seconds exceeded waiting for the IDE to start a run session; you can set the DCP_IDE_REQUEST_TIMEOUT_SECONDS environment variable to override this timeout (in seconds)    {"Executable": {"name":"functions-gzzaqzxg"}, "Reconciliation": 8, "error": "Put "https://localhost:56393/run_session?api-version=2024-04-23\": context deadline exceeded"}

Also for some reason, if I change the order of projects in our App Host code, any project defined after the Functions project also fails to start with the same error. After moving the Functions project to be the last one, everything else starts up fine, and then Functions fail.
Versions I'm using throughout:

.NET SDK 9.0.100-rc.2.24474.11
Aspire packages 9.0.0-rc.1.24511.1
Aspire.Hosting.Azure.Functions 9.0.0-preview.4.24511.1
Azure Functions packages 2.0.0-preview2
Azure Functions CLI 4.0.6280
Visual Studio 2022 Enterprise, Version 17.11.5

@MarcinJuraszek support requires Core Tools version 4.0.6517 or later. That has not yet been released for macOS (though, it would be good to confirm whether you're simply running dotnet run in that scenario)
For the VS experience, the Functions support require running VS preview. Can you please try running on the latest 17.12.0 preview and see if that helps?

@karolz-ms Any insights on the DCP timeout issue that @MarcinJuraszek  is running into above?

@MarcinJuraszek worth noting that, with that Core Tools version, there will still be some limitations with the Aspire experience (e.g., you may not see logs flowing into the dashboard).
Version 4.0.6517 will be the earliest with proper support for those features. We expect an update for the macOS tools to go out today.

@captainsafia @MarcinJuraszek the DCP error you are seeing means that DCP asked Visual Studio to start the Functions project but never got a confirmation back that the project was successfully started. This is part of the DCP-to-IDE protocol https://github.com/dotnet/aspire/blob/main/docs/specs/IDE-execution.md#create-session-request DCP expects positive response (200 OK or 201 Created) AND a run session ID sent as part of the Location header.
CC @tlmii

wow, ok, this has broken me. Turns out there's an "Update" flow for in-VS Azure Functions tools, separate from global VS update process, and from func CLI:

Clicking "Check for updates" here made it work in VS ...

Hi, please is there any solution to solve timeout problem? I have the same.
Aspire.Hosting.Dcp.dcpctrl.ExecutableReconciler[0]       timeout of 120 seconds exceeded waiting for the IDE to start a run session; you can set the DCP_IDE_REQUEST_TIMEOUT_SECONDS environment variable to override this timeout (in seconds)    {"Executable": {"name":"FunctionApp-uqbhjdte"}, "Reconciliation": 2, "error": "Put \"https://localhost:58792/run_session?api-version=2024-04-23\": context deadline exceeded"}
Thanks

@petrkasnal Can you verify what version of Microsoft.Azure.Functions.Worker.Sdk you're referencing in your Functions project? It should be 2.0.0-preview.2.

@captainsafia
I found where the "mistake" is. The thing is that I have logging set to trace in function and at that moment my application doesn't load. Only if I specify default, it doesn't work. Any idea why?
{
  "version": "2.0",
  "logging": {
    "logLevel": {
      //"Default": "Debug",
      "System": "Information",
      "Microsoft": "Information"
    },

Thank you

I found another problem. This was happening to me even when I tried to implement Azure Function in Aspire itself. Sometimes the connection string would not load. On one run it is there and on the other it is not. For a normal application it works fine.
Aspire:
var bus = builder.AddConnectionString("Messaging");

builder.AddAzureFunctionsProject<Projects.FunctionApp>("FunctionApp")
        .WithReference(bus);

Azure Function
var mes = builder.Configuration.GetConnectionString("Messaging");
It just fills up on one run and not on the next...
Thank you

It shouldn't be random, you should be able to look at the environment variables in the dashboard and inside of the functions process to see if they are being propagated. Dump the environment variables into the logs and see if you can narrow down when this happens.

@davidfowl
It's really happening. And it's just a matter of adding a connection string. I'm deliberately only trying to make sure it doesn't affect anything else. If that's not enough I can set up a demo, but really it's just adding a connection string in Aspire.
Not working - first run

Working- second run

Does this happen in visual studio only or on the command line as well? Can you test both?

@davidfowl I'll definitely try it. Except when I start the Aspire project, via the standard dotnet run, the Aspire board in the console shows me this exception. Is there any other way to run it?
2024-11-01T10:36:48
 Unhandled exception: System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'func' with working directory 'bin\Debug\net8.0\'. The system cannot find the file specified.
2024-11-01T10:36:48
    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
2024-11-01T10:36:48
    at Microsoft.DotNet.Cli.Utils.Command.Execute(Action`1 processStarted)
2024-11-01T10:36:48
    at Microsoft.DotNet.Tools.Run.RunCommand.Execute()
2024-11-01T10:36:48
    at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)
2024-11-01T10:36:48
    at System.CommandLine.ParseResult.Invoke()
2024-11-01T10:36:48
    at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)

@davidfowl i have it. I have 9.0.100-rc.2.24474.11 by console.

@davidfowl Okay, I think I know what the problem is. The settings are messing with the ones in local.settings.json. local.settings is probably loaded by default right? Isn't there some way to say I don't want the variables from local.settings.

Even if the values in local settings are messing with the settings in the environment, it should work the same way across multiple runs.

@davidfowl I'll set up an repository where you can see it.

@davidfowl  Here is the repository. https://github.com/petrkasnal/AzureFunctionLocalSettingsProblem
I use your example. If you try to run AppHost and put a breakpoint in AzureFunctionsTest, you'll see that it sometimes sets one, sometimes all, and it's really different.
There is an empty value in localsetttings and Aspire sets it to the value.

There is an empty value in localsetttings and Aspire sets it to the value.

Can you clarify what you mean by this? What does your localsettings file look like?
Out of curiosity, do you reproduce this issue when running the application with dotnet run on the CLI?

@captainsafia
I'm so sorry, I forgot to add the localsettings to the repository. I put it there, you can sell it - https://github.com/petrkasnal/AzureFunctionLocalSettingsProblem
However, in the localsettings function the values are set to blank. In Aspire they are set to some value.
Function:
{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "ServiceBusConnection__fullyQualifiedNamespace": ""
  },
  "ConnectionStrings": {
    "Messaging": "",
    "Messaging2": "",
    "Messaging3": "",
    "Messaging4": "",
    "Messaging5": "",
    "Messaging6": ""
  }
}

Aspire - appsettings:
{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning",
      "Aspire.Hosting.Dcp": "Warning"
    }
  },
  "ConnectionStrings": {
    "Messaging": "test.servicebus.windows.net",
    "Messaging2": "test.servicebus.windows.net",
    "Messaging3": "test.servicebus.windows.net",
    "Messaging4": "test.servicebus.windows.net",
    "Messaging5": "test.servicebus.windows.net",
    "Messaging6": "test.servicebus.windows.net"
  }
}

No I failed to start the application via dotnet run, I address this somewhere in the comment above.

@captainsafia I found where the "mistake" is. The thing is that I have logging set to trace in function and at that moment my application doesn't load. Only if I specify default, it doesn't work. Any idea why?
{
  "version": "2.0",
  "logging": {
    "logLevel": {
      //"Default": "Debug", If enable function isnt load
      "System": "Information",
      "Microsoft": "Information"
    },

Thank you

Is there a solution to this?

@captainsafia I found where the "mistake" is. The thing is that I have logging set to trace in function and at that moment my application doesn't load. Only if I specify default, it doesn't work. Any idea why?
{
  "version": "2.0",
  "logging": {
    "logLevel": {
      //"Default": "Debug", If enable function isnt load
      "System": "Information",
      "Microsoft": "Information"
    },

Thank you

Is there a solution to this?

And I managed to find one more problem, which may be something of mine and I don't know if it belongs here, but for the example from the repository - https://github.com/captainsafia/AspireAzureFunctionsSample after clicking on some resource and view detail the application throws the following error:

Exception:
Aspire.Hosting.Dashboard.Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'ysCr_EaEGLb2kXCVUYbkRFXITXDQmOhztu2jYjCvhOE'.
System.InvalidOperationException: More than one sibling of component 'Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1[Aspire.Dashboard.Model.ResourcePropertyViewModel]' has the same key value, 'Stav'. Key values must be unique.
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ThrowExceptionForDuplicateKey(Object key, RenderTreeFrame& frame)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.BuildKeyToInfoLookup(DiffContext diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
Aspire.Hosting.Dashboard.Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'ysCr_EaEGLb2kXCVUYbkRFXITXDQmOhztu2jYjCvhOE'.
Microsoft.JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
   at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson, JSCallResultType resultType, Int64 targetInstanceId)
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, CancellationToken cancellationToken, Object[] args)
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
   at Aspire.Dashboard.Model.BrowserStorage.LocalBrowserStorage.GetUnprotectedAsync[T](String key) in /_/src/Aspire.Dashboard/Model/BrowserStorage/LocalBrowserStorage.cs:line 29
   at Aspire.Dashboard.Components.Controls.SummaryDetailsView`1.OnParametersSetAsync() in /_/src/Aspire.Dashboard/Components/Controls/SummaryDetailsView.razor.cs:line 117
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
The thread 42992 has exited with code 0 (0x0).
Aspire.Hosting.Dashboard.Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'Yu_KOkY9Yp4P9iRnnropYzxar741OS6d0l04-nM7s90'.
System.InvalidOperationException: More than one sibling of component 'Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1[Aspire.Dashboard.Model.ResourcePropertyViewModel]' has the same key value, 'Stav'. Key values must be unique.
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.ThrowExceptionForDuplicateKey(Object key, RenderTreeFrame& frame)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.BuildKeyToInfoLookup(DiffContext diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForFramesWithSameSequence(DiffContext& diffContext, Int32 oldFrameIndex, Int32 newFrameIndex)
   at Microsoft.AspNetCore.Components.RenderTree.RenderTreeDiffBuilder.AppendDiffEntriesForRange(DiffContext& diffContext, Int32 oldStartIndex, Int32 oldEndIndexExcl, Int32 newStartIndex, Int32 newEndIndexExcl)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
Aspire.Hosting.Dashboard.Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'Yu_KOkY9Yp4P9iRnnropYzxar741OS6d0l04-nM7s90'.
Microsoft.JSInterop.JSDisconnectedException: JavaScript interop calls cannot be issued at this time. This is because the circuit has disconnected and is being disposed.
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, CancellationToken cancellationToken, Object[] args)
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
   at Aspire.Dashboard.Model.BrowserStorage.LocalBrowserStorage.GetUnprotectedAsync[T](String key) in /_/src/Aspire.Dashboard/Model/BrowserStorage/LocalBrowserStorage.cs:line 29
   at Aspire.Dashboard.Components.Controls.SummaryDetailsView`1.OnParametersSetAsync() in /_/src/Aspire.Dashboard/Components/Controls/SummaryDetailsView.razor.cs:line 117
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Thank you

@JamesNK does this look familiar?

Hi can I just ask if the problems are being worked on? Alternatively, is there a solution? Or a hack? Or am I writing this on the wrong discussion? Thanks

Well it’s the weekend so they’re not being worked on right now. Dotnetconf is this week and the preview of functions support is going out then. I’m sure @captainsafia will get around to this when we resume the work on this after the conference.
Thanks for the repro, we’ll update the issue when someone investigates

I think this is the same issue as https://github.com/dotnet/aspire/issues/6509. It's an issue in RC1, fixed in 9.0
The bug should be fixed when Aspire 9.0 RTM is available, which is next week.

The bug should be fixed when Aspire 9.0 RTM is available, which is next week.

Tomorrow.

@JamesNK @davidfowl
Ok perfect. I will try it tomorrow. And the second problem please?

@petrkasnal Can you file a new issue for the problem you're running into with the repro you shared. Also, if you have the chance to verify if it repros with dotnet run instead of Visual Studio F5 that would be great.

We've shipped Aspire 9 today...and with that the first (technically second) preview of the Aspire and Azure Functions support.
With the new integration package, you can do the following:

Add Azure Functions projects to your Aspire app host
Use Aspire client integrations in your Functions projects
Use Aspire hosting integrations to configure resources for Azure Storage Queue, Azure Storage Blob, Azure Service Bus, and Azure Event Hub triggers
Debug Azure Functions projects in Visual Studio or VS Code (with C# Dev Kit)
Deploy Aspire apps with Azure Functions projects to ACA containers (without event-based autoscaling)
Enable OpenTelemetry and Aspire dashboard integrations with Azure Functions

Documentation for the integration package is available over in our Aspire integration docs page. We'll be rolling out tutorial-based docs soon. You can also find an example application over in the aspire-samples repo.
Future work items in this space are tracked under the azure-functions label in the repo. If you encounter any issues while using the package or have proposals for features to support, please open a new issue.
And with that, I'm going to close out this issue to mark completion of the first set of work on this front. Thanks for your patience and contributions to the thread so far and looking forward to more in the future!

authors: ABNERMATHEUS ChasakisD JamesNK MarcinJuraszek alefranz bradygaster captainsafia davidfowl fabiocav flibbertigibbet-uk hlaueriksson josephaw1022 jurackavlasta karolz-ms kfrancis nwoolls petrkasnal sjasperse vl4d4

repo: dotnet/aspire


text:
Getting Started with F# on .NET Core Improvements

I merged the Getting Started with F# on .NET Core article so that we have something available for folks to took at.  Some feedback that was mentioned was to cut out most of the step-by-step stuff and just list the project.json changes supply code to copy/paste.  This would shorten and change the tone of the article, but could be good since it would be less for folks to read through.
I'm also open to other changes as well.
/cc @svick @mairaw @dsyme @enricosada

This is my personal opinion, so weight it appropriately with other feedback.
I prefer seeing a bit more detail rather than just supplying code to copy and paste. I find that the pure copy / paste articles don't help me learn anything. I get to the end, and I've got a working sample (that's cool). However, I can't extend those techniques to applications I'm building.
Humans are pretty good at skimming text, so I try to err on the side of more detail rather than less.

@BillWagner I'm not sure the goal of this article is to teach about details of project.json. That section is just a stopgap until dotnet new -l fs -t lib becomes available.

@svick is right here, this is a stopgap until dotnet new is updated to have correct template support for F# class library, console app, and test project.  I don't know when that will happen, though.

If it's a stop-gap solution then having the copy and paste only would be appropriate in this case.
But I agree with @BillWagner that in general we should provide the steps with an explanation of why you're doing that. Then if someone wants just to skip all that and go to the final one, that's fine. That's why I also suggested that we provide the whole sample too so people can just download the whole thing if they want as well.

authors: BillWagner cartermp mairaw svick

repo: dotnet/core-docs


text:
Where to download the 2.0.8 runtime

Hi,
I use vs to upgrade the nuget to the newest 2.0.8 version.
but this download link not include the 2.0.8 runtime.
How to solve this issue

And  I  need the "Hosting Bundle Installer",Thanks.

Hi,
Please check out the following thread, https://github.com/aspnet/Docs/issues/6281
You will find your answer here.
Grtz,
Colin

Thanks.Fixed it by using DotNetCore.2.0.7-WindowsHosting.exe and AspNetCore.2.0.8.RuntimePackageStore_x64.exe

authors: ColinRaaijmakers jingliancui

repo: dotnet/core


text:
Signature XML file with dotnet

.Net Framework 4.0, 4.5.2, 4.6 to use signing of XML use the dependencies:
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
My sign function was as follows:
public void Assinar(string strArqXMLAssinar, string strUri, X509Certificate2 x509Certificado, string strArqXMLAssinado)
        {
            //Atualizar atributos de retorno com conteúdo padrão
            this.intResultado = 0;
            this.strResultadoAss = "XML Assinado Com Sucesso!";
            StreamReader SR = null;
            try
            {
                //Abrir o arquivo XML a ser assinado e ler o seu conteúdo
                SR = File.OpenText(strArqXMLAssinar);
                string vXMLString = SR.ReadToEnd();
                SR.Close();
                try
                {
                    // Verifica o certificado a ser utilizado na assinatura
                    string _xnome = "";
                    if (x509Certificado != null)
                    {
                        _xnome = x509Certificado.Subject.ToString();
                    }

                    X509Certificate2 _X509Cert = new X509Certificate2();
                    X509Store store = new X509Store("MY", StoreLocation.CurrentUser);
                    store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
                    X509Certificate2Collection collection = (X509Certificate2Collection)store.Certificates;
                    X509Certificate2Collection collection1 = (X509Certificate2Collection)collection.Find(X509FindType.FindBySubjectDistinguishedName, _xnome, false);

                    if (collection1.Count == 0)
                    {
                        this.strResultadoAss = "Detectou problemas com o certificado digital. (Código do Erro: 2)";
                        this.intResultado = 2;
                        return;
                    }
                    else
                    {
                        // certificado ok
                        _X509Cert = collection1[0];
                        string x;
                        x = _X509Cert.GetKeyAlgorithm().ToString();

                        XmlDocument doc = new XmlDocument();
                        doc.PreserveWhitespace = false;

                        try
                        {
                            doc.LoadXml(vXMLString);

                            // Verifica se a tag a ser assinada existe é única
                            int qtdeRefUri = doc.GetElementsByTagName(strUri).Count;

                            if (qtdeRefUri == 0)
                            {
                                // a URI indicada não existe
                                this.strResultadoAss = "A tag de assinatura " + strUri.Trim() + " não existe no XML. (Código do Erro: 4)";
                                this.intResultado = 4;
                                return;
                            }
                            // Exsiste mais de uma tag a ser assinada
                            else
                            {
                                if (qtdeRefUri > 1)
                                {
                                    // existe mais de uma URI indicada
                                    this.strResultadoAss = "A tag de assinatura " + strUri.Trim() + " não é unica. (Código do Erro: 5)";
                                    this.intResultado = 5;
                                    return;
                                }
                                else
                                {
                                    if (doc.GetElementsByTagName("Signature").Count == 0)
                                    {
                                        try
                                        {
                                            SignedXml signedXml = new SignedXml(doc);
                                            signedXml.SigningKey = _X509Cert.PrivateKey;
                                            Reference reference = new Reference();
                                            // pega o uri que deve ser assinada
                                            XmlAttributeCollection _Uri = doc.GetElementsByTagName(strUri).Item(0).Attributes;
                                            foreach (XmlAttribute _atributo in _Uri)
                                            {
                                                if (_atributo.Name == "Id")
                                                {
                                                    reference.Uri = "#" + _atributo.InnerText;
                                                }
                                            }
                                            XmlDsigEnvelopedSignatureTransform env = new XmlDsigEnvelopedSignatureTransform();
                                            reference.AddTransform(env);
                                            XmlDsigC14NTransform c14 = new XmlDsigC14NTransform();
                                            reference.AddTransform(c14);
                                            signedXml.AddReference(reference);
                                            KeyInfo keyInfo = new KeyInfo();
                                            keyInfo.AddClause(new KeyInfoX509Data(_X509Cert));
                                            signedXml.KeyInfo = keyInfo;
                                            signedXml.ComputeSignature();
                                            XmlElement xmlDigitalSignature = signedXml.GetXml();
                                            // Gravar o elemento no documento XML
                                            doc.DocumentElement.AppendChild(doc.ImportNode(xmlDigitalSignature, true));
                                            XMLDoc = new XmlDocument();
                                            XMLDoc.PreserveWhitespace = false;
                                            XMLDoc = doc;
                                            // Atualizar a string do XML já assinada
                                            this.vXMLStringAssinado = XMLDoc.OuterXml;
                                            // Gravar o XML Assinado no HD
                                            StreamWriter SW_2 = File.CreateText(strArqXMLAssinado);
                                            SW_2.Write(this.vXMLStringAssinado);
                                            SW_2.Close();
                                        }
                                        catch (Exception caught)
                                        {
                                            if (intResultado == 0)
                                            {
                                                this.intResultado = 3;
                                                this.strResultadoAss = caught.Message;
                                                return;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        catch (Exception caught)
                        {
                            if (intResultado == 0)
                            {
                                this.intResultado = 6;
                                this.strResultadoAss = caught.Message;
                                return;
                            }

                        }
                    }
                }
                catch (Exception caught)
                {
                    if (intResultado == 0)
                    {
                        this.intResultado = 1;
                        this.strResultadoAss = caught.Message;
                        return;
                    }

                }
            }
            catch (Exception ex)
            {
                if (intResultado == 0)
                {
                    this.intResultado = 6;
                    this.strResultadoAss = ex.Message;
                    return;
                }
            }
            finally
            {
                SR.Close();
            }
        }

Does anyone know how this is now done in dotnet core?

Opened this one up on dotnet/corefx#10277. Closing this one.

authors: blackdwarf ralmsdeveloper


text:
dotnet: command not found

Issue Title
dotnet: command not found
General
I have installed the .net core version. I dont know what version is it, I just downloaded the .net core and installed it few seconds ago. Operating System is MacOS Mojave.
here's the screenshot that I have successfully installed the .net core, when I type in dotnet in the terminal as instructed it says "command not found" and my mac details:

For some issues, you will get a quicker and better response if you file it at a more specific .NET repo. For example, if the problem is with ASP.NET Core, you are encouraged to use the aspnet/home repo.

Did you try to open a new terminal window after the installation? Sometimes that can help with the dotnet not found issue.

Did you try to open a new terminal window after the installation? Sometimes that can help with the dotnet not found issue.

Same issue for me (-bash: dotnet: command not found), and opening a new terminal window doesn't fix it.
Where is dotnet actually installed by the installer ?
What is the required context ?
Is it Intel Core 2 Duo compatible ? etc…

Where is dotnet actually installed by the installer ?

Looks like "Summary" page of the installer tells you where it's being installed at. The 1st post for example, has a picture that shows that the installation was done in /usr/local/share/dotnet -- which matches what I have locally from a recent install. I added that locally to my PATH exports & good to go.


text:
Unable to install Docker

Problem encountered on https://dotnet.microsoft.com/learn/aspnet/microservice-tutorial/install-docker
Operating System: windows.
I am trying to install the docker as instructed by the guide in my machine(WIndows 10- 64 bit) however i was unable to do so as the installer was throwing error "Docker Desktop requires the Server service to be enabled."

See if this thread on Stack Overflow helps:
https://stackoverflow.com/questions/60326173/docker-installation-on-windows-10
If not, I'd try to open an issue on the Docker repo: https://github.com/docker/for-win

authors: mairaw swapnajeetgonchoudhury


text:
命令提示符无法成功运行

在运行dotnet这个命令时，cmd会闪退，无法进行下一步

在运行dotnet这个命令时，cmd会闪退，无法进行下一步


text:
docker build failing in local

Problem encountered on https://dotnet.microsoft.com/en-us/learn/aspnet/microservice-tutorial/docker-image
Operating System: windows
Provide details about the problem you're experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.

docker build -t mymicroservice .
ERROR: error during connect: this error may indicate that the docker daemon is not running: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/_ping": open //./pipe/docker_engine: The system cannot find the file specified.

Judging by the error message, it looks like you haven't started docker. If you are using Docker on Windows, you might need to start Docker Desktop app first. You can check docker info command to troubleshoot. In general, you can check out https://docs.docker.com/config/daemon/troubleshoot/#check-whether-docker-is-running

authors: CarnaViire DevanshuFullStack


text:
Ubuntu + Dotnet 1.0.0-preview1-002702 = 100% CPU loop

On a fresh Ubuntu 14.04 installation, running dotnet causes 100% CPU load.
It looks like the process becomes zombied and is unstoppable.
Version: Ubuntu 14.04.2 LTS running on 4.2.0-23-generic

Hi @BenHall does this still occur with .NET Core 1.0 / .NET Core 1.0 SDK Preview 2?

Ah, no it doesn't. Turned out to be an AUFS bug.

authors: BenHall joshfree


text:
System.Reflection.Metadata.Cil does not emit accessibility on types

It looks like Visit(CilTypeDefinition typeDefinition) is missing handling for Attributes.

@SantiFdezM ?

authors: AlexGhiondea ericstj

repo: dotnet/corefxlab


text:
Added System.Azure.Experimental Project

This adds a new corfxlab project where we want to experiment with building blocks for Azure SDK.
The initial commit contains an API to general CosmosDB authentication header without allocations.
The currently recommended way to generate the headers is described at https://docs.microsoft.com/en-us/rest/api/documentdb/access-control-on-documentdb-resources
The following is a result of a micro benchmark run comparing the currently recommended methods and the experimental corfxlab API:

Method
Mean
Error
StdDev
Scaled
Gen 0
Allocated

SignatureGenerate
2.236 us
0.0009 us
0.0007 us
0.36
-
0 B

MsdnSample
6.292 us
0.0051 us
0.0045 us
1.00
0.7248
3056 B

The improvements are mainly due to using non-allocating System.Text.Primitives APIs for text manipulation, Spans for slicing, non-allocating SHA256 generation, and native UTF8 text generation.
Note: Do not merge the PR. It does not work on Linux. I will have an update to make it work.
@AlexGhiondea, @joshfree, @shiftylogic, @ahsonkhan

@dotnet-bot help

@dotnet-bot test Innerloop Ubuntu16.04 Debug Build and Test please


text:
Fixed #869

The existing code was checking if a code point is a surrogate characters, but it should be checking for whether the code point needs a surrogate characters.
Also the encoder was incorrectly computing the high surrogate value.

@krwq, @troydai


text:
Mirror changes from dotnet/corefx,coreclr

This PR contains mirrored changes from dotnet/corefx,coreclr
Please REBASE this PR when merging
cc @tannergooding

@dotnet-bot test OSX10.12 Debug and CoreFX tests please

authors: Dotnet-GitSync-Bot jkotas

repo: dotnet/corert


text:
Milestone Management in dotnet/dnceng

[x] When an epic issue is closed, the associated milestone is also closed. Do not allow an epic to be closed if there are still open issues associated with that epic's milestone.
[x] When an epic label is added to an issue, include the title of that issue in the list of milestones
[x] When an epic issue's title is updated, update the name in the milestones
[x] Do not allow an epic label to be removed from an epic if any open issues are still associated with it
[x] Make this webhook usage opt-in (config file) per repo
[x] Document how this webhook works

Release Note Category

[ ] Feature changes/additions
[ ] Bug fixes
[ ] Internal Infrastructure Improvements

Release Note Description
No release notes required

This was rolled out and verified that it's working.

repo: dotnet/dnceng


text:
Remove outdated helixosauto and helixosconfig blobs

viewing the helixosauto / on-prem / config list of folders containing config.json files for on-premise queues and the helixosconfig / configuration list of Zip files containing ClientSettings.json files for all of our queues is unnecessarily confusing. both blob stores contain information about long-dead queues. e.g., helixosconfig / configuration contains blobs that haven't been updated since March 2022. we should remove these blobs to save our eyes, avoid confusion (when we miss the Last modified date), and save on storage costs.
fix would probably be fairly simple e.g., intersect current queues (even if unmonitored) with the two blob stores' content and remove what shouldn't exist. might need some special cases for on-premise queues that are being taken out of service.
not sure but we may also want to do something similar for old image versions and images for removed VM queues left around in the HelixImages resource group. this may actually save us real money.

Release Note Category

[x] Feature changes/additions
[ ] Bug fixes
[x] Internal Infrastructure Improvements

Release Note Description
We cleaned up some of our blob storage in an effort to avoid confusing ourselves and save some money.

Would this be a good candidate for the helix-machines improvements epics ramping up?

Would this be a good candidate for the helix-machines improvements epics ramping up?

yes

Moving there!

authors: dougbu riarenas


text:
Redundant text

The first two paragraphs are verbatim identical, with the only exception the link at the end.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 9024fd6b-79b6-4b3e-17f7-b7257fe39139
Version Independent ID: dbdfb5d0-7d61-b4e1-3e91-42f785445c64
Content: XAML Syntax In Detail - WPF .NET Framework
Content Source: dotnet-desktop-guide/framework/wpf/advanced/xaml-syntax-in-detail.md
Product: dotnet-framework
Technology: dotnet-wpf
GitHub Login: @adegeo
Microsoft Alias: adegeo

HA! Thank you for pointing this out. I also need to do a bunch of link updates too.

repo: dotnet/docs-desktop


text:
The result docs don't work on IPad mini 5. Header, navigation and right side of the layout is missing from the layout

If you browse to any learn.Microsoft.com on IPad mini 5, you can see how the layout has been rendered poorly

Hi @moattarwork
This repo is for our teams internal tools, and isn't part of the main rendering pipeline. I've notified the folks responsible for the iPad rendering, and they've got an issue filed in their internal backlog.
Thanks for reporting this.

authors: BillWagner moattarwork

repo: dotnet/docs-tools


text:
Remove calls to HashAlgorithm.ComputeHash

Calls to HashAlgorithm.ComputeHash should be removed from the documentation.

@bartonjs

What's the reason for removing calls to HashAlgorithm.ComputeHash?
Calls to ComputeHash in code examples are for specific algorithms -- does this mean we want to remove all calls to ComputeHash for all algorithms?
Does "remove calls ... from the documentation" mean delete any snippets that contain such calls? Or keep the snippets but replace the ComputeHash calls with something else?

I'm... not sure.
ComputeHash is the preferred API to use on HashAlgorithm... anything that uses TransformBlock or TransformFinalBlock should be rewritten to use IncrementalHash.
My best guess is it was meant for MD5/SHA1, but since the member lives on HashAlgorithm it ended up being collapsed down to HashAlgorithm.
I think my recommendation here is to close it as non-actionable/lost-context.

authors: bartonjs rpetrusha tdykstra

repo: dotnet/docs


text:
[WinForms] Deprecate Switch.System.Windows.Forms.UseLegacyContextMenuStripSourceControlValue quirk

Deprecate Switch.System.Windows.Forms.UseLegacyContextMenuStripSourceControlValue quirk
Deprecate Switch.System.Windows.Forms.UseLegacyContextMenuStripSourceControlValues` quirk
Version introduced
3.0
Old behavior
Prior to .NET Framework 4.7.2 ContextMenuStrip's SourceControl property returned null for a source control when a user opened a menu from a nested ToolStripMenuItem control. In .NET Framework 4.7.2 the behavior was changed to return a source control.
Switch.System.Windows.Forms.UseLegacyContextMenuStripSourceControlValue was introduced allow to use the legacy behavior.
For more information please refer to https://github.com/dotnet/docs/blob/master/docs/framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element.md.
New behavior
The switch is deprecated, and no alternative functionality is available.
Reason for change
.NET Core 3.0 is a new moderm development platform, and it brings significantly simpler servicing scenarios, thus allowing for removal of quirks targeting specific legacy use cases.
Recommended action
Remove the switch.
Update the code that may have dependent on the legacy behavior.
Category

Windows Forms

Affected APIs
Not detectable via API analysis

Issue metadata

Issue type: breaking-change

/cc: @OliaG @merriemcgaw


text:
Tutorial: Write a custom string interpolation handler – couple of small mistakes

# 1
[InterpolatedStringHandler]
public ref struct LogInterpolatedStringHandler
{
    …
    // Add the receiver argument:
    …

I guess // Add the receiver argument: is forgotten since Improved Interpolated Strings discusses declaratively receiver term.
# 2
public LogInterpolatedStringHandler(int literalLength, int formattedCount, LogLevel level, Logger logger, out bool isEnabled)
{
    enabled = logger.EnabledLevel >= level;
    Console.WriteLine($"\tliteral length: {literalLength}, formattedCount: {formattedCount}");
    if (enabled)
    {
        builder = new StringBuilder(literalLength);
    }
    isEnabled = enabled;
}

In fact there are 2 failures:

logger and level parameters are switched so declaration [InterpolatedStringHandlerArgument("", "level")] LogInterpolatedStringHandler builder does not work with it.
LogInterpolatedStringHandler is declared as struct so builder must be definitely assigned when .ctor returns. So either it must be changed to class or used something like builder = enabled ? new () : null;.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 99599c47-14ba-6e35-9b63-daa928f764bb
Version Independent ID: e80a06db-bfbc-29f1-1cca-248460e523d3
Content: Explore string interpolation handlers
Content Source: docs/csharp/whats-new/tutorials/interpolated-string-handler.md
Product: dotnet-csharp
Technology: csharp-whats-new
GitHub Login: @BillWagner
Microsoft Alias: wiwagn

I'll leave this open to inviestigate.
For #1, that's a stray comment in the initial sample and should be removed.
For #2, the code compiles in the samples repo, so I'll have to look at where the text disagrees with the sample code.

For #2, the code compiles in the samples repo, so I'll have to look at where the text disagrees with the sample code.

Yes, it gets compiled since call site in snippets specified correctly [InterpolatedStringHandlerArgument("level", "")] LogInterpolatedStringHandler builder) but this implementation is not used on page.


text:
Concerns about whitespace in the new #line grammar rules

I'm writing a formal spec for this feature for the C# standards committee, and have some comments re the proposed new grammar rules:
line_indicator
    : '(' decimal_digit+ ',' decimal_digit+ ')' '-' '(' decimal_digit+ ',' decimal_digit+ ')' decimal_digit+ whitespace file_name
    | '(' decimal_digit+ ',' decimal_digit+ ')' '-' '(' decimal_digit+ ',' decimal_digit+ ')' file_name
    ...
    ;

As you can see, whitespace is required in one place and disallowed between all other tokens. This doesn't look right!
I'm using Visual Studio Community 2022 (64-bit) Version 17.2.0 for my tests.
The compiler accepts the following source lines, without error:
#line (  2  ,  3  )  -  (  4  ,  5  )  "f"
#line (  2  ,  3  )  -  (  4  ,  5  )  6  "f"

which suggests that an arbitrary amount of white space is permitted between any two tokens
The compiler also accepts
#line (2,3)-(4,5)6"f"

where there is no white space between the character-offset number, 6, and the filename, contrary to the proposed grammar.
Note that like this proposal, the long-time directive format #line 123 "f" does require white space between the line number and filename, which is consistent. However, the compiler relaxes that in the test above, which means it's an extension or a bug.
Assuming that the one required white space place is correct, and that an arbitrary amount of white space is allowed between tokens, the new grammar rules should be
line_indicator
    : '(' whitespace? decimal_digit+ whitespace? ',' whitespace? decimal_digit+ whitespace? ')'
      whitespace? '-' whitespace?
      '('  whitespace? decimal_digit+ whitespace? ',' whitespace? decimal_digit+ whitespace? ')'
      whitespace? decimal_digit+ whitespace file_name
    | '(' whitespace? decimal_digit+ whitespace? ',' whitespace? decimal_digit+ whitespace? ')'
      whitespace? '-' whitespace?
      '('  whitespace? decimal_digit+ whitespace? ',' whitespace? decimal_digit+ whitespace? ')' whitespace? file_name
    ...
    ;

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 19676f37-72c5-ace5-f1e0-f2693c0ffe46
Version Independent ID: ee32bc8f-4a21-dba1-5ab4-38852321190e
Content: Enhanced #line directives - C# 10.0 draft specifications
Content Source: proposals/csharp-10.0/enhanced-line-directives.md
Product: dotnet-csharp
Technology: csharp-spec
GitHub Login: @dotnet-bot
Microsoft Alias: wiwagn

cc @tmat

I've discussed this with @tmat.
The parser should require spaces:

before the first (
before the character offset
before the file name.

Spaces should be optional elsewhere.
I've logged https://github.com/dotnet/roslyn/issues/61663.

Fixed in dotnet/csharplang#6195

authors: BillWagner RexJaeschke cston