Git Product home page Git Product logo

Comments (11)

proudmonkey avatar proudmonkey commented on July 26, 2024 1

Thank you for trying out the template. I can see that the error you are getting is related to your application configuration. What version of .NET core you are using? Note that the latest version of the template uses .NET Core 3.1.

I would recommend you to post your issue at tech forums such as stackoverflow or forums.asp.net as well.

from apiboilerplate.

proudmonkey avatar proudmonkey commented on July 26, 2024 1

What happen if you run using Kestrel and not IIS Express? Also how do you connect to your database? have you tried creating a database using localdb? Can you show your appsettings.json file?

from apiboilerplate.

Alishan-1 avatar Alishan-1 commented on July 26, 2024

I am using netcoreapp3.1,
I was able to run the template successfully by following these instructions.

from apiboilerplate.

Alishan-1 avatar Alishan-1 commented on July 26, 2024

But i think that the Web.config file should preexist in the template so that any one else should not have to face this problem.

from apiboilerplate.

proudmonkey avatar proudmonkey commented on July 26, 2024

the template should work fine without that configuration. I have tested it. I'm assuming it has something to do with IIS config. Check this out: https://stackoverflow.com/questions/54727477/http-error-500-24-internal-server-error-system-web-identityimpersonate-is-s/60340688#60340688

Also have you also tried running it in Kestrel instead of IIS Express?

from apiboilerplate.

Alishan-1 avatar Alishan-1 commented on July 26, 2024

I did not published the website. i only created the project and than clicked run (hit F5) and the above error popped up. (I did have installed the iis on my laptop but i think that it has nothing to do with the visual studio and iis express )

from apiboilerplate.

Alishan-1 avatar Alishan-1 commented on July 26, 2024

I tried the steps in this post but they did not helped me.

from apiboilerplate.

Alishan-1 avatar Alishan-1 commented on July 26, 2024

I have not changed the default settings for server and by default it is iis express(i guess).

I have not tried the localdb

I have installed sql server and i updated the appsettings.json file by changing the connection string.
following is my appsettings.json file ( I only changed the SQLDBConnectionString )

{
  "ConnectionStrings": {
    "SQLDBConnectionString": "Data Source=.;Initial Catalog=tmp;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    "PostgreSQLConnectionString": ""
  },
  "AllowedHosts": "*",
  "Self": {
    "Id": "api.boilerplate.core",
    "Secret": "0a2e472b-f263-43fd-8372-3b13f5acf222"
  },
  "ApiResourceBaseUrls": {
    "AuthServer": "https://localhost:5000",
    "SampleApi": "https://localhost:4500"
  },
  "HttpClientPolicies": {
    "RetryCount": 3,
    "RetryDelayInMs": 500,
    "RetryTimeoutInSeconds": 5,
    "BreakDurationInSeconds": 30,
    "MaxAttemptBeforeBreak": 3,
    "HandlerTimeoutInMinutes": 5
  },
  "IpRateLimiting": {
    "EnableEndpointRateLimiting": true,
    "StackBlockedRequests": false,
    "RealIpHeader": "X-Real-IP",
    "ClientIdHeader": "X-ClientId",
    "HttpStatusCode": 429,
    "GeneralRules": [
      {
        "Endpoint": "*:/api/*",
        "Period": "1s",
        "Limit": 2
      }
    ]
  },
  "HealthChecksUI": {
    "HealthChecks": [
      {
        "Name": "HTTP-Api-Basic",
        "Uri": "https://localhost:5001/selfcheck"
      }
    ],
    "Webhooks": [
      {
        "Name": "",
        "Uri": "",
        "Payload": "",
        "RestoredPayload": ""
      }
    ],
    "EvaluationTimeInSeconds": 10,
    "MinimumSecondsBetweenFailureNotifications": 60,
    "HealthCheckDatabaseConnectionString": "Data Source=Infrastructure\\HealthChecks\\Db\\healthchecksdb"
  }
}

from apiboilerplate.

proudmonkey avatar proudmonkey commented on July 26, 2024

It really doesn't make sense to me to use web.config for .NET Core apps. Can you try the following connectionString?

"ConnectionStrings": {
   "SQLDBConnectionString": "Server=<YOUR SQL SERVER NAME>;Database=<YOUR DATABASE NAME>;Trusted_Connection=True;"  
}

Also, I don't think the issue is directly related to this template. Have you tried creating a new ASP.NET Core API project without using this template and connect to your SQL Server instance? Try that and see if you can connect outside localdb.

from apiboilerplate.

Alishan-1 avatar Alishan-1 commented on July 26, 2024

i am using appsettings.json file shared above for connection string.

"ConnectionStrings": {
    "SQLDBConnectionString": "Data Source=.;Initial Catalog=tmp;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
    "PostgreSQLConnectionString": ""
  },

I am not using web.config for connection string.

from apiboilerplate.

proudmonkey avatar proudmonkey commented on July 26, 2024

Yes and you are getting error with that right? The example connectionstring from the template uses localdb and you are not. The web.config settings that fixed your error is what I'm referring to and I'm not suggesting to use web.config for connectionString.

from apiboilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.