I've published my project on my VPS server (MVC 3 project). Now, is it somehow possible to debug the code during the project is being runned on the server ? The same way when it's running on the localhost.
There might be but I believe the fact that you're trying to is a bad sign. By the time you deploy your app you should have proper logging and error handling which should allow you to track down any bugs that occur and reproduce them in your development environment.
Related
Our cloud-deployed app is composed of (simplified):
A web front-end
Some back-end services
A database
When developing the front-end, I can easily debug by running the front-end locally, and redirecting its back-end calls to the actual services, since their endpoint routes are public.
However, I also want to debug back-end service code, together with the front-end. I can run back-end services locally, but they can't access the database, since the database doesn't have any publicly-accessible endpoint.
Question: How can I conveniently develop the service code? I can think of these options:
Expose the database publicly, maybe just the dev env's database. This doesn't sound like a good practice security-wise, and I haven't found a way to do it in my cloud platform (CloudFoundry).
Test everything using local unit- and component- tests. We do this, but can't cover everything, and certainly not the integration with the front-end.
Deploy my code changes to a dev environment, and test that way. This is what we do now, but:
It's a much slower development turn-around that running locally
I can't connect a debugger to the deployed app, so I must debug using logs, which again is slow
We have a limited number of dev environments, and this creates contention for them.
Somehow deploy a replica of the database locally as well, using some kind of test data.
Tech details: For cloud we use CloudFoundry over AWS. My back-end services are written in C# + .NET core 5. Locally, we develop them using Visual Studio 2019 on Windows.
For now, I managed to expose my database locally using an SSH tunnel. Specifically, by running cf ssh [AppName] -L [local_port]:[db_hostname]:[port], with [db_hostname]:[port] taken from the app's configuration, taken by running cf env [AppName].
Good Day everyone
We created a Blazor Server application and deployed in on our web server (windows 2019) with IIS as our host, now the site is okay when deployed but, sometimes if there are too many users accessing the site of if few members are requesting too much,the site does not working properly,or it does not,the fix we are doing for this is to stop and start the app on the IIS, and this is not a best practice as we have to this again everytime the app is not working,we check the event log, but we did not see any errors, this scenario always happen on both of our staging and production, what do you think is the cause of this problem?? And how to fix it?
Edit: I have to clarify, according to our team they are only 10 people who is using the app, both prod and staging is encountering the issue, and I'm on dead end
we put an Idisposable on our application, to dispose of resourcers, and we are currently checking if the application will still experience unresponsiveness after a number of people accessing the application, we also fix the javascript errors, that might be the cause of unresponsiveness
thank you for your comments and suggestions
I have a java script code in git hub and I was deploying it many many times on heroku during the last month and I had no problem.Today, when I wanted to deploy the exact same code on heroku, I've got the following error:
The requested API endpoint was not found. Are you using the right HTTP verb (i.e. `GET` vs. `POST`), and did you specify your intended version with the `Accept` header?
Does anybody know why I encountered this error and what should I do to solve it?
I'm having the exact same error since today, even though I've been able to deploy my java app before.
There might be something wrong on heroku's end.
I made a ticket and I'll try to update you on the answer.
I had the same problem and when I was looking for to create a ticket I found this support notification about this issue now, it's an internal error in Heroku.
Check this link
We are investigating reports of increased API errors. This affects a number of actions on the platform, including deploys, for users without a credit card associated with their account. We will update here shortly.
I have some Web API applications that uses OWIN for authentication. Currently they are hooked up to Google and Facebook. I have them installed in multiple environments (local, dev, test, etc). Recently ALL of my applications in my development environment started failing. When trying to authenticate I would get a response back "access_denied". The URL would look like this:
https://{mydevserver}/{mywebapiapp}/#error=access_denied
The same code base works locally as well as in my test environment.
I tried using the same project (just adding redirect uris and orgins) as well as creating a new project.
I also updated my test environment to use the dev project (id and secret).
Nothing seems to have changed on the server recently. But it seems to be environment specific (because multiple applications are affected as well as multiple providers).
Are there any logging techniques I can use to drill down to a more detailed error message? Any tips or hints for what to try next?
The fix was a bit of an odd one. I had to log into my server, open up a browser and connect to a web page (any page). After doing so it started working again.
I am suffering from very slow speed on initial loading of my MVC3 .NET4.5 application on Cloud Services, then of course when the pool recycles every 20 mins.
Now I could extend the recycling, but to my mind it would be a far better solution to simply precompile everything locally, then package it up and publish to Cloud Services.
How can I precompile locally, and then package up the precompiled code for publish?
Thanks
The problem is that the default MSBuild scripts that ship with Azure SDK do not include the precompilation results into the service package. So it's not a problem to precompile the application but it's a problem to have the precompilation results packaged. One possible solution is to precompile the application in-place as described here.
The 20 minutes idle timeout makes little sense for web roles so it's worth simply disabling it. The next thing you'll face is that starting the web application when the first request arrives still takes some time because a lot of code has to be loaded from disk and JIT-compiled and the workaround is to either use "warmup" features of IIS or simply send a request to "localhost" from inside role OnStart().