-
-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visual Studio 2022 Endpoint Explorer Integration #196
Comments
Hmm, the feature is still in preview, right? I haven't used it myself but in the example shown in that article it's working with minimal API endpoints, though they claim it will also work with Controller-based endpoints. This library depends on Controllers, so any feature that discovers Controller-based endpoints should work with it. Do you have a sample you can share? Does the feature work with a vanilla controller class, but not with one that inherits from one of this package's base endpoint classes (which in turn inherit from controllers)? |
Thanks for your fast response Steve. I believe it's out of preview in VS 17.6, I think it relies upon the [ApiController] attribute. |
Hmm, well we have that attribute: |
I suspect it also utilizes the Http* attributes. |
Apparently the endpoints explorer menu option only appears if you first select a web project in solution explorer... |
I can open the "Endpoints Explorer" window and it shows the api project. However, no endpoints are discovered. |
It may not be related, but for me, Endpoints Explorer only picks up if the controller class has WORKS:
DOESN'T WORK:
I am using Visual Studio 2022 17.6.2 Professional |
Yeah, it definitely still has a ways to go to catch all of the endpoints in the project. They could also leverage the swagger file from the running project as a possible way to build their list of endpoints. Probably a good idea to leave feedback for them in their own repo and/or on social media where they'll see it (copy @VisualStudio). In the meantime I don't think it hurts anything if you add "extra" |
I've found that the Endpoints Explorer window only recognizes literal strings for routes. For example, the following declaration shows up in the Endpoints Explorer window: public static class MyEndpoints {
public static void MapMyEndpoints(this IEndpointRouteBuilder routes) {
var group = routes.MapGroup("api/test");
group.MapGet("/{id}", TestGetMethod);
}} However, the following is invisible to the Endpoints Explorer window: public static class MyEndpoints {
private const string ApiBase = "api/Test";
public static void MapMyEndpoints(this IEndpointRouteBuilder routes) {
var group = routes.MapGroup(ApiBase);
group.MapGet($"{ApiBase}/{id}", TestGetMethod);
}} |
Definitely seems like a bug on their end. Have you reported it with the feedback icon in VS? |
Pinged them here: |
Thanks for making me (in)famous Steve 👍 |
Thanks (although I’m not feeling very ‘X’ lately). I did send feedback via VS, so let’s see.
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Chris Markwick ***@***.***>
Sent: Tuesday, September 12, 2023 9:54:28 AM
To: ardalis/ApiEndpoints ***@***.***>
Cc: John Holliday ***@***.***>; Comment ***@***.***>
Subject: Re: [ardalis/ApiEndpoints] Visual Studio 2022 Endpoint Explorer Integration (Issue #196)
Thanks for making me (in)famous Steve 👍
—
Reply to this email directly, view it on GitHub<#196 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABIMPXCTR7PL4BROQXLP3B3X2BSRJANCNFSM6AAAAAAZXGSBNM>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Yeah reports via this method are more likely to be acted upon, it seems: |
Hi. I found the Visual Studio feedback item @johnholliday reported regarding discovering non-literal strings for routes here: This issue is still marked as "Under Consideration" I found a Visual Studio feedback item related to the issue @cmarkwick365 and @Edgaras91 encountered, regarding This issue is marked as "Fixed In: Visual Studio 2022 version 17.7". |
ApiEndPoints does not appear to work with VS 2022 Endpoint Explorer. Is it possible to enable this feature or is there a way to get it working out of the box?
The text was updated successfully, but these errors were encountered: