如何在.NET中的localhost上测试特定时间安排的代码? [英] How to test a code which is to be scheduled on particular time on localhost in .NET?

查看:66
本文介绍了如何在.NET中的localhost上测试特定时间安排的代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Developers,



我的MVC应用程序中有一个Action方法,我希望在Arvixe上安排此方法中的代码。我已经安排了它,但是代码似乎没有工作并且有错误,我无法一次又一次地从Arvixe运行调度程序来检查响应。

所以我的问题是,我怎么能安排在localhost(IIS)上的Action方法,并且可以看到响应吗?





任何回复都会很明显。



谢谢,

Sumit



我的尝试:



我浏览了很多但找不到我要找的东西。

Hello Developers,

I have an Action Method in my MVC application, I want the code inside this method to be scheduled on Arvixe. I have scheduled it but the code seems not to be working and having bugs, I cannot run the scheduler again and again from the Arvixe to check the response.
So my question here is that , How can i scheduled that Action method on localhost(IIS) and can see the response?


Any response would be appreciable.

Thanks,
Sumit

What I have tried:

I have browsed a lot but couldn't find the thing i am looking for.

推荐答案

当你在Arvixe上安排它时我假设你遵循了这个:如何在DotNetPanel中使用Schedule Task来执行URL | Arvixe博客 [ ^ ] - 我使用相同的东西来运行几个任务,一切运行正常。



但是任务的调度是无关紧要的 - 它所做的只是导致应用程序在特定时间运行,因此它与在PC上本地运行aspx文件相同。所以只需打开VS中的ASPX文件并执行它。它将加载到您的默认浏览器中并正常运行。调试器将被附加并且它将运行。
When you scheduled it on Arvixe I assume you followed this: How to Use Schedule Task in DotNetPanel to Execute a URL | Arvixe Blog[^] - I use the same thing to run a couple of tasks and it all runs fine.

But the scheduling of the task is irrelevant - all it does is causes the app to be run at a specific time, so it's the same as running an aspx file locally on your PC. So just open the ASPX file in VS and execute it. It'll load in your default browser and run as normal. The debugger will be attached and it'll run.


这篇关于如何在.NET中的localhost上测试特定时间安排的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆