How To Publish ASP.NET Core Web API to IIS

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ก.ย. 2024

ความคิดเห็น • 91

  • @intcoder
    @intcoder  2 ปีที่แล้ว

    If you need to Access your Web API from inside and outside network here is the tutorial:
    th-cam.com/video/AaRc8048HB0/w-d-xo.html

  • @sathiyamoorthynatarajan6230
    @sathiyamoorthynatarajan6230 ปีที่แล้ว +2

    Wow! After going through numerous videos, none of them provided such clear and comprehensive step-by-step instructions. I'm thrilled to say that it's finally working! Thank you so much for your invaluable help!

  • @xanderdemos670
    @xanderdemos670 ปีที่แล้ว +1

    This video is PERFECT. Very easy to follow and no extra crap. Thank you - my little test API is working perfectly.

  • @davidemmanuel3001
    @davidemmanuel3001 2 ปีที่แล้ว +2

    wow, I ve been battling with this issue for 5 hours now. so all i needed to do was /WeatherForecast.
    Thanks alot boss

  • @SlickShinobiDojo
    @SlickShinobiDojo 2 ปีที่แล้ว +1

    Thanks! Haven't done a side project since DOT NET 3! Got my site working locally with Angualr and DOT NET 6! 👍🏽

  • @AjayPrakash-k6j
    @AjayPrakash-k6j ปีที่แล้ว +1

    Thank you so much for this video. I was spending more that 2 hrs and finally it helped me.

  • @kentsmith6918
    @kentsmith6918 2 ปีที่แล้ว

    The video was super easy to follow - I got my API published within minutes after watching it.
    Thanks for sharing this!

    • @intcoder
      @intcoder  2 ปีที่แล้ว

      Glad it helped!

  • @neojabin1329
    @neojabin1329 3 หลายเดือนก่อน

    I needed to figure out how to do this and my dad said it took him like 3 days to do this! I did it in about 4 hours including yesterday and today morning (and i'm only 13) thanks to this video. Thank you so much!

    • @intcoder
      @intcoder  3 หลายเดือนก่อน

      That is awesome!

  • @tomerdanel987
    @tomerdanel987 ปีที่แล้ว +2

    I get HTTP Error 500.19 - Internal Server Error when trying to launch, please someone can help me ?

    • @HaribabuPasupathy
      @HaribabuPasupathy 11 หลายเดือนก่อน +1

      same here! any solution?

    • @eddie21099
      @eddie21099 6 หลายเดือนก่อน

      ​@@HaribabuPasupathyhi, I got the same error, and I figured out the reason, that is 'couldn't connect to the connection string', so I modified the ConnectionString in appsettings.json, and in my case, I did like this:
      "DefaultConnection": "Server=xxxx;Database=xxxx;User Id=xxxx;password=xxxx;Trusted_Connection=False;TrustServerCertificate=True;Encrypt=False"
      And I edited '.NET CRL version' in Application Pool to 'No Managed Code'

  • @SaikiranNomula
    @SaikiranNomula ปีที่แล้ว

    thank you that was pretty straight forward and clear! good work keep it up.

    • @intcoder
      @intcoder  ปีที่แล้ว

      Glad I could help!

  • @nergrohombre
    @nergrohombre 11 หลายเดือนก่อน

    Thank you appreciate it, this does help. My only issue is now, I have a DB connection and I get 500's due to that, I will figure it out, I know I am hitting it because I put in a route with no DB and it works. I appreciate you doing, might I advise you make a video showing it with a more mature controller one that is hitting a DB etc, if not I will try to make that video. VERY HELPFUL

  • @dasmaffin1633
    @dasmaffin1633 ปีที่แล้ว +3

    HTTP Error 500.19 - Internal Server Error
    When I go to Weatherforecast, how do I fix this?

  • @mrrob1454
    @mrrob1454 ปีที่แล้ว +1

    You saved an already frustrated developer with that last bit on testing published site.

  • @ionutvelicu2295
    @ionutvelicu2295 2 ปีที่แล้ว +2

    How can i publish it to a webhost ?

  • @ДаринаВасилева-й4н
    @ДаринаВасилева-й4н 4 หลายเดือนก่อน

    Great video. Helped me so much! Thank you!

    • @intcoder
      @intcoder  4 หลายเดือนก่อน

      Glad it helped!

  • @SouriyanhVongsiprasom
    @SouriyanhVongsiprasom 8 หลายเดือนก่อน

    Thank you !! Video was spot on and works fine.

  • @gauravrawat8297
    @gauravrawat8297 2 ปีที่แล้ว +1

    thank you so much! it was very helpful :)

  • @AmitVerma80
    @AmitVerma80 ปีที่แล้ว +1

    Great Video. But how to get options like "User This Connection String at run time" and "Entity Framework Options" as these options are available in Publishing Local Folder

    • @intcoder
      @intcoder  ปีที่แล้ว +1

      Like production and development connection string?

    • @AmitVerma80
      @AmitVerma80 ปีที่แล้ว

      @@intcoder I m working on code first approach. During development, if I change any model then I can execute commands for add-migration and then update-database.
      But after publishing web api, I have to execute same command on production environment. With IIS deployment I am not able to find way to update production database.
      I am new in .net core. Currently using .Net6, entity framework and MySQL. I need complete steps for publishing and updating remote production server and database.

    • @intcoder
      @intcoder  ปีที่แล้ว

      @@AmitVerma80 ​ @Amit Verma you need to make sure to update your db connection
      string when updating production.

  • @TahaAhmedRadwanAlfoghi
    @TahaAhmedRadwanAlfoghi 17 วันที่ผ่านมา

    how can i solve this error
    API Error A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. Cannot get a local application data path. Most probably a user profile is not loaded. If LocalDB is executed under IIS, make sure that profile loading is enabled for the current user.
    )

  • @arma3053
    @arma3053 ปีที่แล้ว +1

    I'm able to publish the folder file, but every time I Selecta webdeploy on iis it puts up a error message saying that there is a problem inside the temp folder. More specifically the tmp88EF.tmp

    • @helgestegemoen73
      @helgestegemoen73 ปีที่แล้ว

      I got the same error, and had to modify the Web Deploy install to fix it, because the Typical install didn't install the Remote Agent Service. I fixed it by choosing Add Remove Programs->Microsoft Web Deploy 4.0->Modify and installed the Remove Agent Service.

  • @sunitachauhan3363
    @sunitachauhan3363 4 หลายเดือนก่อน

    While deploy application ,connect with sql Db is it necessary to is id and pwd..we cannot use windows authentication mode ??

    • @intcoder
      @intcoder  4 หลายเดือนก่อน

      That’s correct. You have to set sql login and password. Windows authentication only works while testing locally

  • @nagillbeats
    @nagillbeats 4 หลายเดือนก่อน

    after publishing my console is not opend i want my cosole open so that i can check logs

  • @MiikaKontio
    @MiikaKontio ปีที่แล้ว +1

    How do you make it HTTPS and publish it as public for the world to use?

    • @intcoder
      @intcoder  ปีที่แล้ว +1

      First pined comment has another link.

    • @MiikaKontio
      @MiikaKontio ปีที่แล้ว

      @@intcoder Thanks! I must be blind or something :)

  • @randomluck9802
    @randomluck9802 ปีที่แล้ว

    when i publish my website does is publish my sql server database with it?

  • @nguyenkhaihoan228
    @nguyenkhaihoan228 8 หลายเดือนก่อน +2

    i got the Error 500.19 whenever i try to launch , do u have any clue bout it

  • @joe-sydney-au
    @joe-sydney-au 2 ปีที่แล้ว +1

    It would be useful if you tell us the contents of the web.config as generated by the Wizard, I am publishing manually (no VS wizard) and it doesn't work (404 !), therefore I think I need a web.config of some sort ? but I am not sure.

    • @intcoder
      @intcoder  2 ปีที่แล้ว

      When you say that you are manually publishing. What are you doing? Are you publishing to a local folder and copying it?

    • @joe-sydney-au
      @joe-sydney-au 2 ปีที่แล้ว +1

      @@intcoder yes exactly, I figured out why it didn't work, the default folder path set by the Wizard is "bin\Release
      et5.0\publish\", and I was moving the whole Release folder into my IIS server, when I should have moved only the "publish" folder!. But after seeing your video that there was a web.config file, it made me look deeper into it, thanks!

    • @intcoder
      @intcoder  2 ปีที่แล้ว

      @@joe-sydney-au Glad i could help!

  • @ArunKhatri
    @ArunKhatri 2 ปีที่แล้ว +1

    Sir, you have shown to publish the app that doesn't have any database. Would you please share how to do it when an application has a database. By default, vs doesn't include database file for asp.net core project the way it used to save in App_Data folder in case of asp.net MVC project. Please share in which directory database file get saved after published to iis.

    • @intcoder
      @intcoder  2 ปีที่แล้ว

      Have you tried entity framework? you can query the database with it.

    • @mytrolls5866
      @mytrolls5866 2 ปีที่แล้ว

      @@intcoder yes

  • @LatinoTropico
    @LatinoTropico 2 ปีที่แล้ว +1

    Thanks for the video, but when I publish all I get is a web.config file (not using default demo weatherforecast, but EF to a SQL server database, which works fine directly of VS2022). Any ideas why none of the other DLL files were "published"?

    • @intcoder
      @intcoder  2 ปีที่แล้ว

      if you are not able to access the EF/SQL database, make sure you are including user name and password on your connection string. Do not use "Integrated Security" when deploying to IIS.

    • @LatinoTropico
      @LatinoTropico 2 ปีที่แล้ว

      @@intcoder the issue seems to be a bug in Publisher profiles. I've recreated my IIS profile and it worked from there. Thanks anyway

    • @intcoder
      @intcoder  2 ปีที่แล้ว

      @@LatinoTropico Thanks for the feedback.

  • @madhavbansal6123
    @madhavbansal6123 ปีที่แล้ว

    transfer-encoding: chunked getting this error
    pls tell how i can resolve this problem

  • @manideepreddy2255
    @manideepreddy2255 9 หลายเดือนก่อน

    Weather forecast controller is running but my controller which my project is based is not working, it is giving me page not found error. Can you tell me what to do? Thank you.

    • @FeyzaCanUguz
      @FeyzaCanUguz 9 หลายเดือนก่อน

      Did you solve your problem ? I have same problem.

  • @bhames50
    @bhames50 ปีที่แล้ว +1

    Do you have a tutorial that shows publishing an app that connects to a database?

    • @ericianino
      @ericianino ปีที่แล้ว

      What database type ?

    • @bhames50
      @bhames50 ปีที่แล้ว

      @@ericianino SQL Server 2019

    • @intcoder
      @intcoder  ปีที่แล้ว

      @@bhames50 i have a tutorial using entity framework.

    • @intcoder
      @intcoder  ปีที่แล้ว +1

      th-cam.com/video/pVwBnt3idps/w-d-xo.html

    • @bhames50
      @bhames50 ปีที่แล้ว

      @@intcoder I watched your video, but it doesn't mention publishing. I have a .Net 6 CORE Razor app which I've already reverse-engineered the classes from the tables. I have gone into the publish profile, and have added the database connection string and the entity framework migration. I'm breaking my number one rule by asking a follow on question, but your video is the only one I can find where the author seems to know what he's talking about. Any ideas?

  • @Na4Ge4
    @Na4Ge4 2 ปีที่แล้ว +1

    No need to add to system32/drivers/host file?

    • @intcoder
      @intcoder  2 ปีที่แล้ว

      All i needed to do was to install the .net Framework.

  • @ismailaras9488
    @ismailaras9488 ปีที่แล้ว

    Thanks for sharing this!

    • @intcoder
      @intcoder  ปีที่แล้ว

      My pleasure!

  • @rmsoft
    @rmsoft 2 ปีที่แล้ว +1

    Ok, but what about swagger? It would be nice to work too...

    • @intcoder
      @intcoder  2 ปีที่แล้ว +2

      Swagger is usually used for testing purpose. However, if you go to program.cs there is a configuration that only loads Swagger on development. You can turn that off.

  • @laerciopioli8176
    @laerciopioli8176 2 ปีที่แล้ว

    Hi, It works for me only if my application has no localDB data. When the published WebApp needs to access some stored data in localDB it is not working. How to fix that? I've tried a lot of solutions but all without success.

    • @intcoder
      @intcoder  2 ปีที่แล้ว

      when publishing to IIS, make sure you database user permissions is not your Active Directive account. Make sure is you create an actual database user.

  • @rickhorvath
    @rickhorvath ปีที่แล้ว

    If publishing to a domain not local host.

  • @omikukreja3412
    @omikukreja3412 6 หลายเดือนก่อน

    perfect help😁

  • @bhames50
    @bhames50 ปีที่แล้ว

    Very good tutorial! I followed your instructions to the letter, and everything seems to be setup correctly. All the files are in the correct directory, and I added my project name to the end of the URL. But, when I try to run it, either from IIS or from the browser. I get: HTTP Error 500.19 - Internal Server Error
    The requested page cannot be accessed because the related configuration data for the page is invalid. Error Code: 0x80070003 I've googled the error, and it says that it is due to a lack of permission or the web.config is missing. The web.config is there, and I am an administrator for the directory I published to. Any ideas?

    • @intcoder
      @intcoder  ปีที่แล้ว

      are you able to publish a non Core application to IIS?

    • @bhames50
      @bhames50 ปีที่แล้ว +2

      @@intcoder I found the problem. I was publishing to a folder on my server, and apparently I don't have the correct permissions to access the website. I tried it by publishing to a drive on my local computer, and it worked. Again, great tutorial!!!!

  • @ImanSarwar-u2n
    @ImanSarwar-u2n ปีที่แล้ว +1

    what if we have multiple controllers?

    • @intcoder
      @intcoder  ปีที่แล้ว

      Same process. You just use a different URL to query a different controller.

    • @ImanSarwar-u2n
      @ImanSarwar-u2n ปีที่แล้ว

      @@intcoder does not work! i am still getting 404 error

  • @rickhorvath
    @rickhorvath ปีที่แล้ว

    Should choose ‘file’ when publishing.

  • @babka_v_kedax-h1g
    @babka_v_kedax-h1g 2 ปีที่แล้ว +1

    THANK YOU!!!!!!

  • @xanmqurbanl5490
    @xanmqurbanl5490 11 หลายเดือนก่อน

    Thank u very much

  • @Tai-ip8yy
    @Tai-ip8yy ปีที่แล้ว

    thank you so much

  • @pedroalencar4108
    @pedroalencar4108 ปีที่แล้ว +1

    top

  • @nicsteinhardt
    @nicsteinhardt 7 หลายเดือนก่อน

    thx

  • @leandroarielgomez818
    @leandroarielgomez818 2 ปีที่แล้ว

    Te amo

  • @neitonman2459
    @neitonman2459 2 ปีที่แล้ว +1

    Why you lie to people, its deploing, not publishing, i look 10 videos like this, do all steps and get only local access, U must say about ports on router first, site not accesible from external before open ports

    • @intcoder
      @intcoder  2 ปีที่แล้ว

      The video teaches you to publish to IIS not to open ports, as is stated at the start of the video. One can publish it to development/staging without opening external ports.

    • @neitonman2459
      @neitonman2459 2 ปีที่แล้ว +2

      @@intcoder Why, its name publish? If it can access only I?What difference from deploy? I want run api on computer and access it, at least from phone in same wifi, to test update xamarin app from api, but look 10 videos, and get only access from computer, that i can do when run in vs 2022

    • @neitonman2459
      @neitonman2459 2 ปีที่แล้ว +1

      @@intcoder I understand that blogers think deploy and publish the same, and look other things, i found ngrok, but for free it take only random ip, for update i maybe need the same ip, for app can find it by check update, now I looking access to api in local network