0

I have a WebApp that has some WebApi 2 in it, the WebApp is published on a server running with IIS.

When i add something new to the WebApp the update works fine and all the content is provided correctly, but now i've just made an update to an existing API and that API just doesn't return any content as the API still require the old parameters..

I've yet tryed to delete the cache files in /Microsoft.NET/Framework & Framework64 Temporary files folder for the following website but it hasn't had any effect..

So how can i force IIS to update my WebApp?

The API method i've changed is the following:

<HttpPost()> <Route("rc")> Public Function RepartiCassa(<FromBody()> ByVal where As ModelConfig.Config) As IEnumerable(Of Reparti) Dim re = Request Dim headers = re.Headers Dim piva As String = "" If headers.Contains("authToken") Then Dim token As String = headers.GetValues("authToken").First() Dim data = TokenManager.Principals(TokenManager.GetPrincipal(token)) If data Is Nothing Then Return New HttpResponseMessage(HttpStatusCode.Unauthorized) piva = data.piva End If Dim modelConfig As ModelConfig = New ModelConfig Dim rep As Reparti = New Reparti Return rep.TotaliRepCassa(where.data.inizio, where.data.fine, modelConfig.QueryParametri(where.config, "TRC", False), piva) End Function 

While in the older version is looked as the following

<HttpPost()> <Route("rc")> Public Function RepartiCassa(<FromBody()> ByVal where As ModelConfig.Config) As IEnumerable(Of RepCassa) Dim re = Request Dim headers = re.Headers Dim piva As String = "" If headers.Contains("authToken") Then Dim token As String = headers.GetValues("authToken").First() Dim data = TokenManager.Principals(TokenManager.GetPrincipal(token)) If data Is Nothing Then Return New HttpResponseMessage(HttpStatusCode.Unauthorized) piva = data.piva End If Dim modelConfig As ModelConfig = New ModelConfig Dim repCassa As RepCassa = New RepCassa Return repCassa.TotaliRepCassa(where.data.inizio, where.data.fine, modelConfig.QueryParametri(where.config, "TRC", False), piva) End Function 

All is changed is the model is of RepCassa become Reparti

4
  • Have you ever tried to restart app pool? Because depploy IIS won't refresh application and you also need to recycle app pool to refresh the complication. Commented Apr 28, 2020 at 9:13
  • @JokiesDing how could i restart the app pool? (ps: actually after some hours it updated all automatically, but anyway it will be cool to be able to refresh it manually) Commented Apr 28, 2020 at 9:17
  • 1
    blogs.iis.net/msdeploy/… This is a document about how to deploy and recycle app pool. Commented Apr 28, 2020 at 9:30
  • @JokiesDing yea actually that was it, it is even possible to just right click the app pool and press recycle in IIS, make an answer so i could accept it Commented Apr 28, 2020 at 16:32

3 Answers 3

1

update project in IIS won't update app pool setting so it won't trigger application pool recycling.

Please try to recycle application pool manually or recycle app pool when you update project web deploy.

https://blogs.iis.net/msdeploy/operations-on-application-pools-as-admin-and-non-admin

Sign up to request clarification or add additional context in comments.

Comments

0

If you see your changes when you add features, then this is most likely a problem with your code instead of IIS. My guess is your routing configuration needs to be updated.

1 Comment

actually if i run the webapp in debug on my PC the updated API provide all the content it should..
0

For anyone who has tried the suggested solutions but still can't get your API to respond properly - consider that maybe the browser is caching the responses from your API endpoint. Try accessing your API Endpoint from another browser. That was the issue for me.

Stop Chrome From Caching

Disable Web API Caching

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.