by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    DmitryChekh
    @DmitryChekh
    Why my JWT token is invalid?
    I can't request method which required authorization.
    I check on jwt.io and there my token is "Invalid signature"
    https://pastebin.com/SUUK7Wgn
    L Suarez
    @lsuarez5280
    Invalid signature only shows up there if you don't input the signature keys. It doesn't mean the token's actually invalid.
    Generally diagnostic tools will show any reasons policy failed in the traces.
    A tangential question about Visual Studio. Does anyone know if you can roll back to 16.5.x? The latest 16.6.0 is causing failures in our dacpac deploys.
    TeBeCo
    @tebeco
    can invalid signature happen if you use data protection but forgot to mutualize the key store ;)
    or you tempered the token ^^
    Jesper Hansen
    @jespersh

    What am I doing wrong here Microsoft.AspNetCore.SignalR.HubException: Failed to invoke 'GetCategory' due to an error on the server.? In my blazor's signalr client:

            public Task<CategoryModel> GetCategory(int id)
            {
                var cancellationTokenSource = new CancellationTokenSource();
                return _hubConnection.InvokeAsync<CategoryModel>("GetCategory", id, cancellationTokenSource.Token);
            }

    simplified in my aspnetcore signalr hub/server:

            public async Task<CategoryModel> GetCategory(int id, CancellationToken cancellationToken)
            {
                return new CategoryModel((uint)id); // real version has dbcontext and such
            }

    I have working cases with StreamAsync and SendAsync, but InvokeAsync has me scratching my head

    Jesper Hansen
    @jespersh
    It seems to be related to the CancellationToken. If I remove , cancellationTokenSource.Token and , CancellationToken cancellationToken then it gets called. What's the correct use for the token here?
    Jesper Hansen
    @jespersh
    Context.ConnectionAborted inside the hub is the answer?
    pm64
    @pm64
    Did anyone attend Build this year and receive a "Microsoft employee store discound from Microsoft Build" email? I can't tell if this is spam/fraud or not.
    The email comes from the domain "microsoft.regsvc.com" and links to a web site under the domain "store.ecompanystore.com"
    ghendo
    @ghendo
    should I be able to use Microsoft.AspNetCore.SignalR.Client in 2.2 version? Seems like I cantbut surely I should be able to?
    TeBeCo
    @tebeco
    This message was deleted
    server side or client side ?
    yes that would be 1.x for the client side of signalr core i believe
    ghendo
    @ghendo
    a signalr client running on the server to connect to a signalr server
    Simon Ziegler
    @simonziegler
    @simonziegler
    I've spent the last two days failing to get this sample to work for Azure B2C authentication and authorization. Seems to be very out of date with the Azure setup, but I can't find anything current. FWIW Azure B2C setup seems to me to have changed in the last 6 months or so. Has anybody managed to get from A to Z with this? Tx
    https://github.com/Azure-Samples/active-directory-b2c-dotnet-webapp-and-webapi
    TeBeCo
    @tebeco
    @ghendo sooo the client ?
    use 1.x version of the client nuget package
    VittenaDev007
    @VittenaDev007
    I automatic create word document in server side
    I use microsoft.introp.word not working on IIS
    show this error
    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean wrapExceptions, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& hasNoDefaultCtor) at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
    please help me
    Mike Rissen
    @CentriqTraining
    @VittenaDev007 Do you have Word installed on the IIS server?
    Jesper Hansen
    @jespersh
    dotnet ef database update doesn't wrap its migration queries in a transaction?
    Sanjeev M
    @zeus82
    I'm trying to host and SPA along side some razor pages... I want my SPA to be at '/app'. but I can't for the life of me figure out how to do that... this does not work, but its the thing that makes the most sense to me... What am I doing wrong?
    app.UseSpa(spa =>
                {
                    spa.Options.SourcePath = "ClientApp";
                    spa.Options.DefaultPage = "/app/";
    
                    if (env.IsDevelopment())
                    {
                        spa.UseReactDevelopmentServer(npmScript: "start");
                    }
                });
    Mike Rissen
    @CentriqTraining
    @zeus82 I don't do SPA apps, but don't you need app.Map("/app", spa =>...);?
    Sanjeev M
    @zeus82
    How do I tell ASP where I want the root of my app to be? I want to the root page to be at 'localhost/app' so that all my razor pages will continue to work
    Jesper Hansen
    @jespersh
    @zeus82
    app.UseEndpoints(endpoints =>
      endpoints.MapRazorPages();
      endpoints.MapControllers();
      endpoints.MapFallbackToFile("/app/{**slug}", "app/index.html");
      endpoints.MapFallbackToFile("{**slug}", "index.html");
    }
    Sanjeev M
    @zeus82
    thanks @jespersh, but whats ''**slug"?
    Jesper Hansen
    @jespersh
    @zeus82 like if you have endpoints.Map("api/{**slug}", HandleApiFallback);
            private Task HandleApiFallback(HttpContext context)
            {
                string slug = context.Request.RouteValues["slug"].ToString();
                context.Response.StatusCode = StatusCodes.Status404NotFound;
                return Task.FromResult(0);
            }
    if I visit localhost/api/bacon then slug is bacon
    you can use it for logging pages that doesn't seem to exist anymore
    Sanjeev M
    @zeus82
    ahh - I see - cool - thanks!
    Jesper Hansen
    @jespersh
    @zeus82 :thumbsup:
    L Suarez
    @lsuarez5280
    I have a question about the Microsoft.OpenApi lib. Since the models in that library provide a description of the API, is it possible to use that description for model validation in MVC to generate 400 responses?
    It's a lot more capable in terms of describing the kinds of responses I'd like to accept.
    Than say data annotations.
    L Suarez
    @lsuarez5280
    I guess my question is more like "is that functionality already out there somewhere?"
    Meai1
    @Meai1
    how do I add aspnetcore 5 preview to an existing project?
    Jesper Hansen
    @jespersh
    @Meai1 looking to upgrade to 5 or install it?
    TeBeCo
    @tebeco
    he tried to installed the package name Microsoft.AspNetCore that's all
    full answer on dotnet/cli gitter
    also the original question was nasty and blaming msft for an invalid command since 3.x
    that's not very nice (also the issue is that you want to read about FrameworkReference)

    here was the original msg :

    dotnet add myproject.csproj package Microsoft.AspNetCore -v 5.0.0-preview.5.* ---> "Unable to find package Microsoft.AspNetCore with version (>= 5.0.0-preview.5)"
    WHY
    nuget is still a complete joke of a tool
    .net 5 should not be allowed to come out until you fix the horribleness of nuget

    Jesper Hansen
    @jespersh
    Wish people could be friendlier to each other. Guess the world is just that kind of stressful place now
    TeBeCo
    @tebeco
    a recap of the answer:
    • please don't be angry at people when looking for help because it might be your fault to begin with (that's why you are looking for help)
    • You are trying to add a package
    • The source of package truth is nuget.org
    • here is the page of that package https://nuget.org/packages/Microsoft.AspNetCore
    • This package does not exists anymore
    • this change was made with aspnetcore 3.0
    • aspnetcore 3.0 was released 2019-09-23
    • So this means the CLI works properly, it's just your cmd that is invalid as you are trying to add something not existing
    • You are probably looking for either a FrameworkReference or an Sdk
    so @Meai1 are you interested about understanding what changed in 3.0 ? and why the thing you are trying to do, just cannot work because it does not exists anymore ?
    I can't force you to read docs about it so just ping us here if it does interest you so that we could look for docs about it for you to read
    (hope it helps)
    Jesper Hansen
    @jespersh
    @tebeco since the aspnetcore isn't defined as a package in *.csproj, but just <Project Sdk="Microsoft.NET.Sdk.Web">, do you just update TargetFramework to NET5 and it uses aspnetcore5?
    I only recently created my first aspnetcore project and didn't notice this until now
    ghendo
    @ghendo
    Hi there. Regrading .net core 2.2 authentication. I am storing roles data separately from the users store as I am using AWS cognito. I need to add the Roles for a user to the User on login. This does not seem to work in the login page but does work on the Index page. Even after sign in and confirmed signed in there is no capital U user. Would this be because the Login page in not authenticated(obviously) and the claims principle is not created until the first authenticated page is hit? or some other weird reason.
    TeBeCo
    @tebeco
    @jespersh only if you are doing a Host
    the Microsoft.NET.Sdk.Web is not the true fix, it's a way bigger change, if fact that SDK is doing a FrameworkReference under the hood