Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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
    Filip Vukovinski
    @vukovinski
    on .Net Core general system security is much improved
    so emiting code and saving to dll won't work, ever
    StartProcessInfo is a good entry point to validate your prototype
    Steen Rabol
    @rabol
    Okay thanks
    Filip Vukovinski
    @vukovinski
    probably by using the registry (if running on Windows) to discover other apps
    no problem
    Steen Rabol
    @rabol
    I know exactly which app i need to start
    Filip Vukovinski
    @vukovinski
    then you're all sorted. One more tip, to avoid some common production issues, beware that when run as a service the current directory of the app is C:\Windows\System32
    Steen Rabol
    @rabol
    I need a service that i can call from a remote web app, and then the service should start a specific app, then go into a “wait for messages on port xxx from the app” mode and then send each message back to the main web app
    Filip Vukovinski
    @vukovinski
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\my-service-name will tell you where the app is installed
    TeBeCo
    @tebeco
    i think since 3.0 the system32 issue is fixed
    that's was an issue before
    Filip Vukovinski
    @vukovinski
    no, it's waiting 6.0
    Ivan Milosavljevic
    @Vertygo

    Is it possible to implement custom model validation that would return custom model state (or has anyone implemented such a thing)?
    In the current implementation, the validation error item contains only the field name and error message (or code if you want to put it in the error message).
    My requirement is to return the error code alongside field name and error message. I would like to use asp.net core pipeline and avoid situation where I'm calling some custom validator in the controller method that returns BadRequest with custom validation error object.

    Found two related and old issues on github
    dotnet/aspnetcore#6661
    dotnet/aspnetcore#4840

    Filip Vukovinski
    @vukovinski
    sure you can plug into the aspnet core pipeline with some class
    the complexity of your model validator depends on the complexity of your object model
    the pipeline ends if a piece of middleware writes to the body
    and you can pass state between different middleware
    i'm not sure if there is any specific aspnet core validation class or interface to implement
    Ivan Milosavljevic
    @Vertygo
    @vukovinski that is true but I would prefer to tap into existing Model Validation inside of aspnet core pipeline than having to write middleware
    William Roseberry
    @RoseberryPi

    Haven't worked with Razor Pages apps before and I'm having trouble getting a form inside of a partial view to work. Submitting the form is not calling the OnPost method at all. Not sure what I'm doing wrong. Or how it's supposed to be done.

    Anyone have a link for creating forms specifically in a partial view?>

    William Roseberry
    @RoseberryPi
    Nevermind. I didn't realize that the partial view is not connected to its viewmodel but of the page's view model... Blazor has spoiled me much
    Alberto Passalacqua
    @AlbertoPa
    hint: View Components are also an option if applicable, and can doa bit more than partial views