Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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
    also using this Microsoft.NET.Sdk.WebSDK will tell the compiler that you are not doing a ClassLib but a "Web" project (hence the Web Sdk)
    last but not least, since 3.0, AspNetCore is not netstandard anymore, it only target netcore runtime
    there's various answer to that issue depending on what you are doing
    • An app ? => change SDK to Microsoft.NET.Sdk.Web
    • A classlib only for netcoreapp 3.x or 5.x ? => make sure to target netcoreapp3.x or net5.0 + add <FrameworkReference Include="Microsoft.AspNetCore.App" />
    • A classlib for 3.x AND ALSO need backward compat for 2,x and maybe need netstandard ? => multiple TargetFramework + Condition on <ItemGroup>
    TeBeCo
    @tebeco
    (trying to find a better formatted article)
    cross target support will make it look like this :
    <Project Sdk="Microsoft.NET.Sdk">
    
      <PropertyGroup>
        <TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
      </PropertyGroup>
    
      <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
        <FrameworkReference Include="Microsoft.AspNetCore.App" />
      </ItemGroup>
    
      <ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp3.0'">
        <PackageReference Include="Microsoft.AspNetCore.Mvc.Cors" Version="2.1.3" />
        <PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.1.3" />
        <PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.1" />
      </ItemGroup>
    
    </Project>
    (from Adrew blog)
    that's what i meant for @Meai1 to be whilling to read about it :D it's a very simple choice that she/he'll have to do because we have 0 context here, but then it's VERY easy to fix
    Jesper Hansen
    @jespersh
    @tebeco aha. TIL. Thanks for explaining
    Meai1
    @Meai1
    no it's not okay at all that a library is some kind of weird "SDK" or "FrameworkReference"