Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Stefan Ossendorf
    @StefanOssendorf
    Oh in my snippet above is the await missing before the Process()
    anthalon
    @anthalon
    and to clarify, Process() would be a public async Task Process(), meaning that the catch (Exception xc) would never be triggered
    if Process() returns void instead, then the app crashes
    assuming the return type is Task, how can I know the function failed with an exception?
    Stefan Ossendorf
    @StefanOssendorf
    Why would the catch() not be triggered? Exactly for that case we execute it within a new task.
    SQL-MisterMagoo
    @SQL-MisterMagoo
    Don't start the "Process" from the API - use an api to add an entry to a queue, use a worker process to process the queue - use another api to query the progress of the item in the queue.
    Stefan Ossendorf
    @StefanOssendorf
    That would probably be even the cleaner apporach.
    anthalon
    @anthalon
    _ = Task.Run(async () => { try { Process(); } catch (Exception e) { Console.WriteLine("caught"); } } ); does not get into the catch, in the Process() I just have this:
    await Task.Delay(5000);
    throw new Exception("error");
    @SQL-MisterMagoo when you say "Process", I am assuming you are referring to an OS process? So the worker process would execute inside another OS process, and not within the api process itself?
    Joe4evr
    @Joe4evr
    yes
    SQL-MisterMagoo
    @SQL-MisterMagoo
    There are many ways to cook an egg, but preferably you don't make an omelette while you are still at the store, so yes - the api's job would be to add to the queue - nothing else.
    Stefan Ossendorf
    @StefanOssendorf
    @anthalon As I corrected myself I missed the await before the Process(). So you would need to write await Process();. That should trigger the exception.
    _ = Task.Run(async () => { try { await Process(); } catch (Exception e) { Console.WriteLine("caught"); } } );
    anthalon
    @anthalon
    oh, you are correct @StefanOssendorf
    Sanjeev M
    @zeus82
    Does anyone know how to enable mutual auth in aso core 5?
    Alok Sharma
    @aloksharma1
    Hello guys, i am having issues with razor runtime compilation with dynamic loader libraries
    An unhandled exception occurred while processing the request.
    InvalidOperationException: Cannot find compilation library location for package 'Ultra.TestLoader'
    this works fine on individual library but when i put my libs on host app it crashes with this exception
    i checked with debugger, the view inside the plugin library is called but the razor engine just doesnt stop their and pipeline goes in loop i think dont know how to fix this
    here is my mvcbuilder
     mvcBuilder.AddRazorRuntimeCompilation(options =>
                {
                    options.FileProviders.Clear();
                    options.FileProviders.Add(new PhysicalFileProvider(Directory.GetCurrentDirectory()));
                    ReflectionHelpers.GetAssemblyByInterface<ICustomViews>()?.ForEach(views =>
                    {
                        options.FileProviders.Add(new EmbeddedFileProvider(views.Assembly));
                        //options.AdditionalReferencePaths.Add(views.Assembly.Location);
                    });
                    //foreach (var dir in Directory.GetDirectories(Path.Combine(AppContext.BaseDirectory, "plugins")))
                    //{
                    //    //options.FileProviders.Add(new PhysicalFileProvider(dir));
                    //    var pluginFile = Path.Combine(dir, Path.GetFileName(dir) + ".dll");
                    //    options.AdditionalReferencePaths.Add(pluginFile);
                    //}
                    options.FileProviders.Add(new DBPageProvider(serviceCollection.BuildServiceProvider()));
                    options.FileProviders.Add(new DBCustomViewProvider(serviceCollection.BuildServiceProvider()));
                    options.FileProviders.Add(new DBViewModuleProvider(serviceCollection.BuildServiceProvider()));
                });
    Alok Sharma
    @aloksharma1
    i tried additional reference paths but nothing worked
    Sean
    @DapperDeer
    I'm running into an issue where my output contains a folder called "runtimes" but the runtimes inside of it are all Linux-based. I have a runtme specified (win10-x64) and while it does output that specific runtime, instead of being contained in the "runtimes" folder, it's just plopped in the same place as the rest of the artifacts. In fact, my output location goes from bin/net48/Release to bin/net48/Release/win10-x64 (and the runtimes folder is still inside with the Linux runtimes). Should also note that the win10 runtime being plopped in with the rest of the output doesn't even fix the real problem of the app not being able to find the win10 runtime. I have to make a win10-x64 folder inside the runtimes folder and put the dll in there for it to work
    TeBeCo
    @tebeco
    cross post on the other channel i suppose ? there's an attempted answer there
    Alok Sharma
    @aloksharma1
    hello guys, did the hosting system changed in net core, previously in mvc5 i was able to update modules by simply placing/overwriting dlls in bin folder, now howere with new version i have to do full publish and overwrite on my existing app this is killing me, the modules are ever changing and for every small change i cant just be doing full code ftp
    _
    i am using iis 10 for hosting inprocess
    Alok Sharma
    @aloksharma1
    hello, does anyone know how to implement custom view engine in net 5
    apparently razorruntimecompilation is not working for my use cases
    and all the different tutorials i found were of old mvc 4-5
    Alok Sharma
    @aloksharma1

    I'm running into an issue where my output contains a folder called "runtimes" but the runtimes inside of it are all Linux-based. I have a runtme specified (win10-x64) and while it does output that specific runtime, instead of being contained in the "runtimes" folder, it's just plopped in the same place as the rest of the artifacts. In fact, my output location goes from bin/net48/Release to bin/net48/Release/win10-x64 (and the runtimes folder is still inside with the Linux runtimes). Should also note that the win10 runtime being plopped in with the rest of the output doesn't even fix the real problem of the app not being able to find the win10 runtime. I have to make a win10-x64 folder inside the runtimes folder and put the dll in there for it to work

    i had this issue once, better create a new project and copy your publish settings from there.. apparently something messed up your publish settings, laos delete obj/bin folders before attempting with new settings

    Filip Vukovinski
    @vukovinski
    Hello! I'm having some issues deploying a React Spa app to IIS. It seems that some of the static files do not have proper relative paths. I've been searching around and found that there is limited info on the topic. Does anyone have experience with using IIS to host React Spa AspNet Core apps?
    Steen Rabol
    @rabol
    hi
    I’m about to start a new project, where we need to have a ‘service’ running on a pc, and then be able to launch an app, and when the app is running, then communicating with the app via http on a specific port, and the data received from the app should then be send to a REST web service
    how to get started ?
    TeBeCo
    @tebeco
    starting 3.1 you just have to add one line on program.ca yeah
    UseWindowsService that's all
    from the right package make sure not to mix the microsoft.aspnetcore.xxx (old from 2.x) and the microsoft.extension.xxx
    same with namespace else you'll have conflict / not working
    that will work for both
    dotnet new webapi
    dotnet new worker
    Steen Rabol
    @rabol
    @tebeco cool, thanks
    I have tried to look for tutorials or blog posts but have not been able to find any good starting point - I’m coming from a totally different world so this is a new chapter :)
    TeBeCo
    @tebeco
    the docs are the way to go in dotnet core world
    they are rejected by amazing team and community so you have concrete stuff to read learn apply
    that's not just the api doc you have both
    Steen Rabol
    @rabol
    can one start an external app in this service e.g. c:\myapp.exe ?
    TeBeCo
    @tebeco
    can you rephrase another way ?
    the sentences is confusing and there too many way to interpret it
    Filip Vukovinski
    @vukovinski
    hello @rabol
    Steen Rabol
    @rabol
    If i have .net core app running as a service,can one of the functions be to launch another app?
    Filip Vukovinski
    @vukovinski

    you can:

    dotnet new sln
    dotnet new worker -o src/project-name
    dotnet sln add src/project-name

    open in editor

    for startes

    Steen Rabol
    @rabol
    Yes that is to create the project