Server changes no effect

Asked

Viewed 133 times

2

I have an application running c# with . net 4.5 on IIS 8. I’m editing a Controller (which is a .Cs file). However, I edited some things in this Controller and saw that these changes were not spreading.

I tried to edit the Action of this Controller, I tried to edit the parameters that this Controller passes to View by a variable "Viewbag".

None of the changes made effect, then I simply deleted everything I had in the Controller and still managed to access his actions.

So, is this some cache? Or what I found looking for in Google it "Compiles" my code.

How do I get him to compile again? Or how I make him compile with each change or compile alone with each access to the Controller?

Note: The application is running on an online server, not local. There I have access to IIS manager remotely.

  • You’re giving deploy every change in your project to IIS on the "online server"?

  • First you should detail how your Deploy process is done on this "online server".

  • 1

    The server has a "Web Deploy", so every time I make any changes I must deploy this?

  • @Stiveknx, if you have not created any automated deployment mechanism, you should explicitly repeat the deployment process of your project to each new version you wish to send to "production" (online server)otherwise the effects of the change will remain only on your local project. (There is no magic. Hehe)

  • Using IIS Express is no longer easy?

2 answers

1

You must Publish the project by visual studio. This option is available by right-clicking the project and the Publish option. You can give a Publish directly on the server if you have access. Otherwise you can use the Web Deploy Package mode, which will generate one. zip that you will deploy on your IIS server on the corresponding website.

See these 2 links:

Import a Web Deploy Package on IIS

Generate a Web Deploy Package in Visual Studio

  • I did these steps, but the changes continue to have no effect ... Any changes made to the controller have no effect. I can even delete everything inside of it and it keeps working

0

Really as commented, check your deployment process.

In no way should you submit your file changes. Cs (from Controller) to the server, for this to happen what you should send to the server are the . dll files generated by build.

I comment this because I’ve seen people who came from php and Asp sending the Cs file to the server.

Another thing that can give similar problems, is if your server is in Load Balance. Depending on the configuration, you need to update the dll in each cluster node. I’ve seen cases where they only updated one of the servers and the application was then updated for some users and others not. This is because part of the users because of the balance accessed the server with the updated application and another part with the outdated application, which generated great confusion.

Always prefer an automated deploy. I hope it helps you.

  • So this is my case (coming from php and having to work on a project in c#). I didn’t know that I should run this deploy after every change .. Yeah, and to make this deploy, only with visual studio?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.