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
    and that it does not exists
    meaning you have a syntax error
    meaning it detected an , between first and second while it should have stopped there
    so missing )
    sake402
    @sake402

    Hi. Having trouble downloading from https://download.visualstudio.microsoft.com/

    Can someone confirm if it the same behaviour from their end?
    All SDK downloads wont start

    sake402
    @sake402

    Can anyone point me in a direction to why this gives the error "no overload for method 'SingleOrDefault' takes two arguments)"? (The db is of ApplicationDbContext)
    public async Task<User> FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken)
    {
    return await db.Users
    .AsAsyncEnumerable()
    .SingleOrDefault(p => p.UserName.Equals(normalizedUserName, StringComparison.OrdinalIgnoreCase), cancellationToken);
    }

    Remove cancellationToken.

    return await db.Users
                   .AsAsyncEnumerable()
                    .SingleOrDefault(p => p.UserName.Equals(normalizedUserName, StringComparison.OrdinalIgnoreCase));
    Junior
    @Muhammad-Waleed-Hafeez

    i need some info about a software.

    this is the link below:
    https://www.youtube.com/watch?v=i1mDOUxaPc8

    i want to know is it possible to make this kind of software using c# .Net.
    if it's possible then can you guide me how should i approach to built this software.

    i'm very interested to build this application as from this software experience i'm sure that i'm going to learn a whole new things and experience.
    So, please guide me if you could.

    Requirements:
    i need two main features in my application:
    1- get all teeth size data of upper and lower jaw by scanning. this is the camera i'll use ==> https://www.ximea.com/usb3-vision-camera
    2- generate 3d model of upper and lower jaw teeth depending on step-1 data.

    Note: if any tooth is missing then software will be able to reconstruct it during the 3d model.

    that's all.

    Queries:
    i want to know which tools, languages other than .net,and technologies or SDKs will be needed in this project.
    i've heard python will be good for getting data by scanning but after that what should i do in next step.
    there are so many info i've searched on internet but those infos making me more confused because i don't know what exactly i need to do in this application. there are CAD/CAM SDKs option but don't know which one is right for me and compatible with .net.

    I would really appreciate the help.

    Juan Ramos
    @ptjuanramos
    Hi guys can I use a custom tag helper for each element that "asp-src-include" renders? It seems that its not working
    Martijn
    @martijnhoekstra:matrix.org
    [m]
    I'm trying to keep a connection alive and periodically send content through the connection with context.writeAsync to implement SSE. I could have sworn this worked before, but returning to it, as soon as I want to write more, writeAsync throws an exception: IFeatureCollection has been disposed. Object name: 'Collection'.
    What has been prematurely disposed here, and how can I avoid that?
    Martijn
    @martijnhoekstra:matrix.org
    [m]
    the part of the stacktrace where it apparently goes south is
       at Microsoft.AspNetCore.Http.Features.FeatureReferences`1.Fetch[TFeature](TFeature& cached, Func`2 factory)
       at Microsoft.AspNetCore.Http.DefaultHttpResponse.get_HasStarted()
       at Microsoft.AspNetCore.Http.HttpResponseWritingExtensions.WriteAsync(HttpResponse response, String text, Encoding encoding, CancellationToken cancellationToken)
    dasco144
    @dasco144

    Hi.
    I'm trying to deploy a site using MSDeploy, but I'm having an issue when the files/folders are being added

    Info: Adding file (DashboardTesting\Client\assets\).
    Error: (2021/07/07 09:33:26) An error occurred when the request was processed on the remote computer.
    Error: An error was encountered when processing operation 'Create File' on 'C:\inetpub\wwwroot\DashboardTesting\Client\assets\'.
    Error: The error code was 0x8007007B.
    Error: The path 'C:\inetpub\wwwroot\DashboardTesting\Client\assets\' is not valid.
       at Microsoft.Web.Deployment.NativeMethods.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath)
       at Microsoft.Web.Deployment.FileStreamEx.CreateInstance(String path, FileMode fileMode, FileAccess fileAccess, FileShare fileShare, Nullable`1 fileLength)
       at Microsoft.Web.Deployment.FilePathProviderBase.Add(DeploymentObject source, Boolean whatIf)
    Error count: 1.

    I'm not sure why it's specifying that the asset folder is a file, but it should create it as a directory.
    Does anyone know where I can start looking?

    dasco144
    @dasco144
    These are the arguments being provided to MSDeploy:
    -allowUntrusted -dest:contentPath='DashboardTesting',authtype=basic,userName=username,Password=password,computerName=https://SERVERURL.COM:8172/msdeploy.axd?site=DashboardTesting -source:package='deploy.zip' -verb:sync -retryInterval:100
    nyash
    @nyash

    Hi,

    Under NET6 preview 5:

    In startup, I register a singleton service:

    services.AddSingleton(c => new MyService());

    I have a line that injects this service in a razor file:

    @inject MyService service;

    When I run the project under VS (debug) all is good.

    But when I run the same project as dotnet watch run, the IOC container complains that it cannot resolve the service inside the razor file:

    InvalidOperationException: No service for type 'Project.MyService' has been registered

    What could cause this difference and error in the first place under dotnet watch run ?

    nyash
    @nyash
    Hm... nailed it down to this call:
    if (Environment.IsDevelopment()) { builder.AddRazorRuntimeCompilation(); }
    TeBeCo
    @tebeco
    did you toyed auth your launchsettings files ?
    because if you messed with it and it does not set ASPNZTCORE_ENVIRONMENT from the profile inside that's why
    check dotnet run -h for launch profile
    nyash
    @nyash

    @tebeco Thanks, Indeed previously (net 5) I would run just dotnet watch run, but now that I have added from your suggestion dotnet watch run --launch-profile ProjectProfile it works fine without any odd exceptions.

    In the file I have just two profiles: "IIS Express" and "ProjectProfile". Looking at the template of MVC from NET6 it is identical.

    TeBeCo
    @tebeco
    iis express was default profile (because first)
    almost nobody ever want to use that ... because it's iis / express
    new template inverted that order
    that said they both should de development on dotnet run or watch
    unless i'm missing something it does not look normal
    can you try on a blank new project create WITH sdk 6 preview 5 and see if that still happen ?
    nyash
    @nyash

    @tebeco Now that you mentioned, it, the launchSettings file had identical content to the one from the template, BUT, the profile order was different (in my own, IIS Express was first).

    I made my ProjectProfile come before IIS Express. dotnet watch rundoes start, but it soon fails whenever I reach some non trivial code, e.g. getting an exception from hibernate: 'NotSupportedException: A non-collectible assembly may not reference a collectible assembly'

    Funnily, if I launch it this way: dotnet watch run --launch-profile ProjectProfile no such thing happens.

    Regarding the NET6 template, it does launch with dotnet watch run, but I can make it crash with a few lines, like by adding:

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddSingleton(x => new MyService()); 
            services.AddRazorPages().AddRazorRuntimeCompilation(); 
        }

    and injecting the service in Index.cshtml HTML:
    @inject MyService service;

    Again, if I launch this within Visual Studio it works.
    or by explicitly stating the launch profile. dotnet watch run --launch-profile WebApplication1

    TeBeCo
    @tebeco
    open an issue on sdk repo
    Michael W Powell
    @mwpowellhtx
    hello, I am looking for a halfway decent primer on identity framework. I do not care about the EF or SQL Server scaffold, in fact, I will drop all that in favor of custom stores. what I need to know are some essentials, what do we store with respect to the framework, identity user? Not the claims identity, correct? Also any built in or custom defined claims. Also allowing for user registration, external identity sources.
    Alberto Passalacqua
    @AlbertoPa
    that's all Identity does, so I'd suggest that info in asp.net core the doc as a starting point
    it is quite informative to take a peek at the table structure
    Michael W Powell
    @mwpowellhtx
    thanks I appreciate that. I'm not sure I care about table structure as I would like to adapt it for use in a document store.
    Alberto Passalacqua
    @AlbertoPa
    I meant the Identity table structure would show you how to store the stuff you asked about (roles, claims, etc)
    and the guide also shows how to deal with custom user data and, if needed, privacy rules (annotating them as [PersonalData], so when the user wants to remove the account they go)
    Michael W Powell
    @mwpowellhtx
    ah I see :eyes: thanks, appreciate the hints
    Alok Sharma
    @aloksharma1
    Hello all, i am having a weird issue with net core identity social login
    my app works fine in localhost but on live production enviornment it gets stucks at
    ttps://mylivesite.com/signin-facebook?code=AQAuapy0T288bv3BUrV8MGqWDmGews16A-XslywLpyrQQHMZgCkDGZU3Ny07c1TBHh01OGUHjbkRYMBy-C0TqRCCm83q5Zgb90hs8aiRpKEQFODSyjI258-ZADyyhSt2xQ7oWssQUrPbX5DD0o1DwvBjqGUf2oj_eDSaIPCOxjt-_OQvqrgVTXiZccqPYggd5JE-9UD5ZUtAWxwNNnr4-pRQfRRi07GmRVlSB9kF3BnhgbhNmn4xtxso-MI61fkJKyVqEY20nMWfw8SVsMfYTMNn5so_PKq6gol_TurdarBBf3lmiHMwIMUDUPKy6dnxhRI&state=CfDJ8L3eiVfkokNJrxwL3HAjpvUAx_8EBSomWq69r3OBAIFGIQEpMnHPHLLcya2U0dUhXc9NnLFC6lvvWXUoI3FX756qkjiWpoiDXoyUzmnmsdHnRNa8KHfVxPZcmk-owvnYjAmXMYOI1XwjmwgMQ4QJrSMcHxMUbKY58EZ-tpSJcZ-k53paimcinpJJtC7ozZrinXTODvpfSl9brHWxK3Ffv81__crxcLrgrfryhFWLzP-7HuvHVR1M2UdwJRpk-IYlmWG6GAQ4C024oVM09lXpQLE
    so basically after this my request just wait indefinitely
    while on local its moving immediately to next method
    both are producing correct oauth response and this is where the problem persists
    i dont know what to do anymore
    tried everything from cookie policy relaxations to disabling anti forgery etc
    alealpha2000
    @alealpha2000
    hello, i need help with something. i want to make a custom JwtSecurityTokenHandler that gets a blacklist of access tokens from a Redis cache. in order to do that that JwtSecurityTokenHandler must get the cache from DI. however AddJwtBearer doesn't pass a IServiceProvider to the callback. how can I get the token handler to get the cache from DI without calling BuildServiceProvider?
    services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
        .AddJwtBearer(opt =>
        {
            opt.SecurityTokenValidators.Clear();
            opt.SecurityTokenValidators.Add(new RevokableJwtSecurityTokenHandler(services.BuildServiceProvider()));
        });
    alealpha2000
    @alealpha2000
    i ended up using a middleware to implement the access token blacklist. the only nasty part was getting the bearer token from the authentication header
    Arnas Kučinskas
    @Arnas-Kucinskas
    ASP.NET MVC by default is protected against XSS? Can you actually screw this part up somehow?
    nyash
    @nyash

    Hi,
    Does anyone know how to log sql statements to stdout for SqlServer: System.Data.SqlClient? For Npgsql/Mysql it is easy:

     NpgsqlLogManager.Provider = new ConsoleLoggingProvider(NpgsqlLogLevel.Debug, true, true); /*postgresql*/
     MySqlConnectorLogManager.Provider = new ConsoleLoggerProvider(MySqlConnectorLogLevel.Debug); /* mysql */

    I can't seem to find an equivalent for System.Data.SqlClient

    Kilian
    @Schtailian

    Hi, i would need some help to find an error.

    I have a windows service which fetches data from a PLC, writes it in a local buffer and then writes it in the main DataBase.

    My task is to make this service as resistent to problems as possible. power outages, broken plc, broken network etc...
    My issues so far were mostly that i could to reestablish the connection to the PLC. Those things i assume to have fixed.

    Now comes the new issue. A power outage occurred the PC was restarted and then the Service threw a System.BadImageFormatException

    How can that be? The application runs fine so it should not be a 32bit/64bit issue.

    Could it be that the dlls are corrupted? Could it be an issue that my service is self contained but there is also another runtime installed on the PC? I have no idea were to start looking, maybe someone had a similar problem.

    In this example it is the Npgsql Assembly, but it does also happen with others.

    Application: Np300.Service.exe
    CoreCLR Version: 5.0.821.31504
    .NET Version: 5.0.8
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.BadImageFormatException: Could not load file or assembly 'Npgsql, Version=5.0.7.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'. Format of the executable (.exe) or library (.dll) is invalid.
    File name: 'Npgsql, Version=5.0.7.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'
       at BasePlcService.Utilities.ConnectionStringGenerator.GenerateDBConnectionString(IConfiguration configuration)
       at Np300.Service.Program.<>c__DisplayClass2_0.<ConfigureServices>b__1(DbContextOptionsBuilder options) in /builds/rubnergroup/np/machineservices/np300/Np300.Service/Program.cs:line 36
       at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.<>c__DisplayClass1_0`2.<AddDbContext>b__0(IServiceProvider p, DbContextOptionsBuilder b)
       at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.CreateDbContextOptions[TContext](IServiceProvider applicationServiceProvider, Action`2 optionsAction)
       at Microsoft.Extensions.DependencyInjection.EntityFrameworkServiceCollectionExtensions.<>c__DisplayClass17_0`1.<AddCoreServices>b__0(IServiceProvider p)
       at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
       at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
       at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
       at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSite
    ...
    TeBeCo
    @tebeco
    @nyash you probably should drop System.xxxx for Microsoft.xxxx if you don’t hit current limitation
    @Schtailian it could be 32/64 but it’s not because the process start that the dll is loaded but rather when it’s gonna be detected as needed
    example, if npgsql is only 64bit and you hablebdefault platform with is AnyCPU it’s gonna do that
    because AnyCPU will not “transform the code to run either 64/32bits”
    it will spit code that is supposed to run on anycpu
    which is mostly 32bits then because 32 run on 64 with WoW