English 中文(简体)
文件 I/ O 文件 I/ O 在 ASP. Net C# 工人线索中无法运行
原标题:File I/O Not functioning in ASP .Net C# Worker Threads

我觉得很蠢,原因如下:

我利用我两年前写的一些图书馆功能。我深埋了几层,我利用这些功能帮助建立我想要的道路:

System.Web.HttpContext.Current.Request.ApplicationPath System.Web.HttpContext.Current.Server.MapPath

而不是使用此:

HttpRuntime. AppDomainApppath 专栏

系统. Web. HttpContext. 目前肯定无效, 因为没有 http 上下文 。 当然, 也没有例外被丢弃, 因为我在捕捉和忽略它们 。

你不知道我盯着我的项目 看了多少小时 想知道到底出了什么问题!

请原谅我浪费每一分钟的时间,这真令人难堪!

最佳回答

无法在 ASP. NET 应用程序中生成线索 。 我知道技术上可以完成, 但有很多错误需要你解释 。 建议的最佳做法是创建窗口服务来运行您的背景任务 。 然后您的 ASP. NET 应用程序可以向该服务发出请求, 后者在背景中处理这些请求 。

<强度 > 更新参考

https://stackoverflow.com/ questions/1029668/multi-threading-on-asp-net#comment13245710_10293768”上多条线,

警告使用 ASP. NET 网站的背景处理。 IIS 可以在任何特定时刻对应用程序进行再循环, 并在此操作时会杀死任何运行的背景线索。 因此无法保证您的线条会顺利运行。 如果存在问题, 最好使用 Windows 服务来进行背景处理 。

此外,SO用户“https://stackoverflow.com/uss/263681/mr-disapintmentment>> >Disappointment 先生详细介绍

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!