使用ASP.net创建“web服务”——DLL中的内容是什么?

时间:2022-09-01 15:40:57

All,

所有人,

Sorry in advance - I'm a total novice when it comes to ASP.net.

预先说声抱歉——我对ASP.net完全是新手。

I'm working on a project that's fairly simple. I have single HTML page that collects input from the user. When the input is complete - the html page uses AJAX to post the data to a web service. That service receives the data, does some processing on it, then sends back a response.

我正在做一个相当简单的项目。我有一个收集用户输入的HTML页面。当输入完成时——html页面使用AJAX将数据发布到web服务。该服务接收数据,对其进行一些处理,然后返回一个响应。

The "client" part of this app is pure HTML/Javascript (not ASP.net), and is complete and works perfectly.

这个应用程序的“客户端”部分是纯HTML/Javascript(不是ASP.net),并且是完整的,并且工作非常完美。

The "service" part of this app (MyHandler.ashx) is built using ASP.net. Technically - what it does is receive data from the AJAX post. It then uses Microsoft.Office.Interop.Excel to open an Excel spreadsheet, pass the users' inputs into that spreadsheet, then retrieve several calculated values from the spreadsheet, and returns those values in the response to the AJAX post.

这个应用的“服务”部分(MyHandler.ashx)是使用ASP.net构建的。从技术上讲,它所做的是接收来自AJAX post的数据。然后,它使用Microsoft.Office.Interop。Excel打开Excel电子表格,将用户的输入传递到电子表格中,然后从电子表格中检索几个计算值,并在AJAX post的响应中返回这些值。

Using Visual Studio VS I've got this whole process running locally on my PC.

使用Visual Studio VS,我已经让整个过程在我的PC上本地运行。

When I "publish" the project - VS creates a ton of files. I sent those files to the team that manages the server; they deployed them, and voilà - it works. (The necessary Office interop libraries are installed on the server).

当我“发布”项目时,VS创建了大量的文件。我将这些文件发送给管理服务器的团队;他们部署了他们,瞧,它起作用了。(必要的Office互操作库安装在服务器上)。

So - my question - as I make a few modest changes (e.g., validation, error handling) to the handler - MyHandler.ashx - which of those published files actually change? If i want to reploy - do I simply need to resend an updated version of MyHandler.ashx? Or, do simple coding changes to that file require changes to the DLL?

因此,我的问题是,当我对处理程序- MyHandler进行一些适当的更改(例如,验证、错误处理)时。ashx -哪些已发布的文件实际上发生了变化?如果我想要回复-我是否只需要重新发送更新后的MyHandler.ashx版本?或者,对该文件的简单编码更改是否需要对DLL进行更改?

I guess my question is, generally - what's in the DLL? (E.g., is it a compiled version of MyHandler.ashx?)

我想我的问题是,一般来说,DLL中的是什么?(例如,它是handmyler .ashx的编译版本吗?)

More specifically - publishing my project creates the following files that I don't really understand:

更具体地说,发布我的项目会创建以下我并不真正理解的文件:

  • Web.config
  • . config
  • Global.asax (in my project, there's not much in here)
  • 全球。asax(在我的项目中,这里没有什么)
  • bin/MyProject.dll
  • bin / MyProject.dll

So, if I make changes to MyHandler.ashx - can I simply reploy THAT file? Or, do I need to "publish", then "redeploy" thd dll? (By changes - I mean simple code changes, not decisions to include/exclude other external dependencies).

如果我对MyHandler做些改变。ashx -我可以简单地重新安装那个文件吗?或者,我是否需要“发布”,然后“重新部署”thd dll?(所谓更改——我指的是简单的代码更改,而不是包含/排除其他外部依赖项的决策)。

Sorry - this question must seem like nonsense to knowledgeable ASP.net developers. But, with other technologies I've used, things were clear:

对不起——这个问题对有知识的ASP.net开发人员来说一定是毫无意义的。但是,在我使用的其他技术中,事情很清楚:

  • If you're developing a Flash project, you write source code in .FLA files, then compile, then deploy the resulting .SWF files.
  • 如果正在开发一个Flash项目,可以在. fla文件中编写源代码,然后编译,然后部署生成的. swf文件。
  • If you're developing an HTML/JavaScript/PHP project, you write those files, then deploy those same files
  • 如果您正在开发一个HTML/JavaScript/PHP项目,您将编写这些文件,然后部署相同的文件

I'd trying to get a better understanding of what's what with ASP.net.

我想要更好地理解ASP.net的内容。

Thanks again.

再次感谢。

1 个解决方案

#1


2  

The DLL contains the compiled code behind the ASHX file. The ASHX is just a service definition for an HTTP handler. When you make changes to the service (e.g. the code), simply issue another Publish like you did before and send the entire package.

DLL包含ASHX文件后面的编译代码。ASHX只是HTTP处理程序的服务定义。当您对服务(例如代码)进行更改时,只需像以前那样发出另一个发布并发送整个包。

But in short, when you change the code, the DLL is what's changing.

但简而言之,当你改变代码时,DLL就是改变的东西。

#1


2  

The DLL contains the compiled code behind the ASHX file. The ASHX is just a service definition for an HTTP handler. When you make changes to the service (e.g. the code), simply issue another Publish like you did before and send the entire package.

DLL包含ASHX文件后面的编译代码。ASHX只是HTTP处理程序的服务定义。当您对服务(例如代码)进行更改时,只需像以前那样发出另一个发布并发送整个包。

But in short, when you change the code, the DLL is what's changing.

但简而言之,当你改变代码时,DLL就是改变的东西。