by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Joe4evr
    @Joe4evr
    tbh, that's an Oracle problem
    SIkebe
    @SIkebe
    Yeah, definitely :confused:
    alealpha2000
    @alealpha2000
    hi! i am looking for some advice. i am writing an app that needs to retry post requests. how do I ensure the server detects a post retry and returns a cached response when a retry is detected? is there any "official" way to do that?
    duckblaster
    @duckblaster
    general method is to add a request id to the original request, retries use the same request id, backend ignores it if it has seen that id before
    alealpha2000
    @alealpha2000
    yup that's exactly what i did. only instead of ignoring it a cached response is sent on a retry
    duckblaster
    @duckblaster
    well, it doesn't do the requested work, so that counts as ignoring in my book :P
    Jesper Hansen
    @jespersh
    If dotnet ef database update outputs More than one DbContext was found, is there a parameter I can set so it tells me what it found?
    Michał Zegan
    @webczat
    yes
    Jesper Hansen
    @jespersh
    oh -v
    Finding DbContext classes in the project...
    Found DbContext 'ApplicationDbContext'.
    Found DbContext 'PersistedGrantDbContext'.
    Found DbContext 'ConfigurationDbContext'.
    Michał Zegan
    @webczat
    dotnet ef dbcontext list? not sure how it was exactly, but in any case the general answer is yes, there is a command to list db contexts.
    oh, or -v, yes
    Jesper Hansen
    @jespersh
    @webczat yours is better though. Gives the full namespace
    Jesper Hansen
    @jespersh
    Thanks. Still learning these commands. Ended up with running this inside the Blazing.Storage project folder: dotnet ef --startup-project ..\BlazingServer\ database update --context PersistedGrantDbContext. In case anyone would need this knowledge in the future
    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...
    app.UseSpa(spa =>
                {
                    spa.Options.SourcePath = "ClientApp";
                    spa.Options.DefaultPage = "/app/";
    
                    if (env.IsDevelopment())
                    {
                        spa.UseReactDevelopmentServer(npmScript: "start");
                    }
                });
    Panos Athanasiou
    @panoukos41
    When i call add on my entity i get the message "Argument types do not match" but i know my types is the same with the DbSet and its the same one in my database. This is my code for this class, it has a custom ValueComparer i suspect something must be wrong there is this correct ? and if no how do i do it the correct way ? This happens when i call the add method to add a new object to the database.
            private readonly ValueComparer<ICollection<string>> valueComparer = new ValueComparer<ICollection<string>>(
                equalsExpression: (c1, c2) => c1 != null && c2 != null && c1.SequenceEqual(c2),
                hashCodeExpression: c => c.Aggregate(0, (a, v) => HashCode.Combine(a, v.GetHashCode())),
                snapshotExpression: c => c.ToHashSet());
    
            public void Configure(EntityTypeBuilder<User> builder)
            {
                builder.Property(x => x.FavoriteStores)
                    .HasConversion(
                        to => string.Join(',', to),
                        from => from.Split(',', StringSplitOptions.None))
                    .Metadata
                        .SetValueComparer(valueComparer);
            }
        }
    Ofc you spend hours searching and then you find the answer right after you ask.... remove the ToHashSet in the snapshotExpression fixed it: https://github.com/dotnet/efcore/issues/17471#issuecomment-579125422
    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.