Is it possible to "debug" my application inside the server?

Asked

Viewed 128 times

1

I have an ASP.NET application in c#, and I do some debugs(obvious) in Visual Studio, but I always have a problem with directories, because the Godaddy directory for example is different from the localhost directory, and I need to do some tests, how to know what certain variable is returning me when I put the application in the air, like:

Debug.WriteLine(Request.Url.AbsoluteUri) get back to me http://localhost:54345/ in Visual Studio Output when I am in the IDE(localhost), but if I upo my site no longer have this control, I could even insert in an example view:

@Html.Raw(Request.Url.AbsoluteUri) and "debug" but I believe it is not the right one to ask, the question is: There is a way to do this debug FROM INSIDE THE SERVER?

  • 1

    You can do it, but you can be sure you can’t do it using a server on godaddy

  • @LINQ Because of the shared server?

  • 1

    Exactly. They keep the servers very restricted.

  • Puts, I’ve had SEVERAL problems, from creating a Trigger in MYSQL, to increasing the Session time... and by the features I’ll need to add on the site I’ll have to migrate service. The cheap is getting expensive now.

  • 1

    Exactly. You can be sure you’ll have even more problems. It’s not wanting to do negative marketing, you even know it’s problematic.

  • I understand, if there’s a downside, we have to talk. But anyway, answering the question, I could see the output on a server that has this feature, or use another type of debug?

  • 2

    I don’t know, but take a look at that link. I’ve never used it, so I can’t say for sure.

  • I’ll read it, thank you !

  • And even if it was easy, it’s not recommended.

  • @bigown because it is not recommended ?

  • Because it’s easy to screw up, it needs a debugger code in production that’s a tragedy to do, you can control the environment and produce misleading results

  • @Bigown I understand and agree with you ! The idea of debugging was more to know what the difference/return of an "Httpcontext.Current.Request.Physicalapplicationpath" is still very confusing for me the differences in localhost and production.

  • @bigown The question half answered here, how to proceed? closing the same?

  • I don’t know, if you don’t think it’ll come any better, you can close it if you want.

  • I will wait for some more answers if there is, otherwise I close, but I already have a good idea. Thanks.

  • I do remote debugging in my application but use Azure, very easy https://medium.com/balta-io/debugging%C3%A7%C3%B5es-hospedada-no-Azure-app-service-com-visual-studio-ad514dec995f

  • It is possible yes, I do it where I work because we have development, homologation and production servers. Obviously we never Depuramos of production, but we of development and homologation do this. Briefly, we install Remote Debugger, open the Worker Processes list of the IIS server in question, find the Applicationpool process ID where the Site/Application is running, and make a Visual Studio Attach (there are a few more things to check out, but I only said the main points). But this requires server access, which doesn’t seem to be your case.

  • It’s personal, I won’t be able to do it ! Godaddy is VERY LIMITED, some use Zure, others have access to the server, everything I unfortunately don’t have for Godaddy... But thanks for the answers.

Show 13 more comments

1 answer

0


To solve this problem I simply use the Log4net, is a library that once configured, can write log files wherever and however you want.

[Developing example]

Browser other questions tagged

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