ASP.NET开发服务器或Localhost IIS?

时间:2022-12-30 02:02:10

Currently our dev team set up all the websites they're working on in IIS on their local machine. We're thinking of switching to using the built in ASP.NET development server instead.

目前,我们的开发团队在他们的本地计算机上设置了他们在IIS中工作的所有网站。我们正在考虑转而使用内置的ASP.NET开发服务器。

Is this a good idea? What are the pros / cons of using the ASP.NET dev Server? Are there any gotchas we should be aware of?

这是一个好主意吗?使用ASP.NET dev服务器的优缺点是什么?我们应该注意哪些问题?

Thanks.

谢谢。

NB: Running on Win XP / IIS 5 / VS2005

注意:在Win XP / IIS 5 / VS2005上运行

Edit:

编辑:

Didn't realise it was called Cassini.. More answers for Cassini v IIS here.

没有意识到它被称为卡西尼。更多的答案Cassini v IIS在这里。

11 个解决方案

#1


32  

There is nothing that the ASP.NET Dev WebService can do that IIS can't (You can set breakpoints etc, just attach the VS debugger to the ASP.NET runtime).

ASP.NET DevService没有任何内容可以执行IIS无法做到的事情(您可以设置断点等,只需将VS调试器附加到ASP.NET运行时)。

However, the ASP.NET Dev WebService does not represent a true production environment, and as such you can get caught by gotchas that you wouldn't expect when you deploy to production.

但是,ASP.NET Dev WebService并不代表真正的生产环境,因此您可能会遇到在部署到生产时不会发现的陷阱。

Because of that, I mandate that all development is done using IIS on a local machine. It doesn't take much work to configure a site in IIS.

因此,我要求在本地计算机上使用IIS完成所有开发。在IIS中配置站点并不需要太多工作。

#2


24  

It's a very good idea. Here are some reasons for:

这是一个非常好的主意。以下是一些原因:

  • You no longer need admin access to your machine for web development (it can still be helpful).
  • 您不再需要管理员访问您的计算机进行Web开发(它仍然有用)。
  • It's much easier to test a quick change and continue work, and faster iteration cycles are good.
  • 测试快速更改并继续工作要容易得多,并且更快的迭代周期也很好。
  • It can simplify setup and deployment of your development environments.
  • 它可以简化开发环境的设置和部署。
  • The XP version of IIS has limitation that are not present in the Server version that Cassini side-steps.
  • XP版本的IIS具有Cassini支持的服务器版本中不存在的限制。

The only argument I know against is that there are a couple very rare edge cases where the Cassini built-in server doesn't exactly mimic IIS because you're using odd port numbers. I doubt you'll ever run into them, and using Cassini as the primary dev environment does not preclude developers from also having access to IIS on the machine. In fact, my preferred setup is Cassini first for most small work, then deploy to my local IIS for more in-depth testing before moving code back to the shared source repository.

我所知道的唯一一个论点是,有一些非常罕见的边缘情况,Cassini内置服务器并不完全模仿IIS,因为你使用的是奇数端口号。我怀疑你会遇到它们,并且使用Cassini作为主要开发环境并不妨碍开发人员也可以访问机器上的IIS。事实上,我首选的设置是Cassini首先用于大多数小型工作,然后在将代码移回共享源存储库之前部署到我的本地IIS以进行更深入的测试。

[Edit]
Forgot about url re-writing. You do need IIS for that. And an example of a limitation of the built-in XP IIS is that you are limited to one site in XP (can have multiple applications, but that's a different thing).

[编辑]忘了重写网址。你确实需要IIS。内置XP IIS限制的一个例子是你只限于XP中的一个站点(可以有多个应用程序,但这是另一回事)。

#3


5  

I had to switch (back) to IIS for one project, because I needed to set some virtual directories which is not possible on the ASP.NET Development Web Server.

我不得不为一个项目切换(返回)到IIS,因为我需要设置一些在ASP.NET Development Web Server上无法实现的虚拟目录。

#4


5  

As I stated here: https://*.com/questions/103785/what-are-the-disadvantages-of-using-cassini-instead-of-iis your developers need to be aware that Cassini runs as the local user, which is typically an admin account for developers. The development will be able to access any file or resource that their account can, which is quite different from what they will see on an IIS 6 server.

正如我在此处所述:https://*.com/questions/103785/what-are-the-disadvantages-of-using-cassini-instead-of-iis您的开发人员需要知道Cassini以本地用户身份运行,这通常是开发人员的管理员帐户。开发将能够访问其帐户可以访问的任何文件或资源,这与他们在IIS 6服务器上看到的完全不同。

The other thing that's a pretty big gotcha is debugging web services is much easier using IIS and vdirs rather than separate Cassini instances.

另一件非常重要的事情是使用IIS和vdirs而不是单独的Cassini实例,调试Web服务要容易得多。

#5


2  

I've used both methods and I prefer having IIS locally vs. using the built-in server. At very least you're more consistent with the final deployment setup.

我已经使用了这两种方法,我更喜欢在本地使用IIS而不是使用内置服务器。至少,您与最终部署设置更加一致。

#6


1  

I know at one point I had an issue with Authentication not working as expected on Cassini (built in development server)

我知道有一点我的身份验证在Cassini上没有按预期工作(内置在开发服务器中)

Also, if you need to test things like ISAPI plugins (a re-writer for example) I'm not sure how that's done on Cassini.

此外,如果您需要测试ISAPI插件(例如重写器)之类的东西,我不确定它是如何在Cassini上完成的。

The constantly changing port is also rather disconcerting to me. Also, for each web project in your solution it fires up another instance of a Casini server, and each one takes anywhere from 20 to 50 MB of memory.

不断变化的港口对我来说也很令人不安。此外,对于解决方案中的每个Web项目,它会激活Casini服务器的另一个实例,每个实例需要20到50 MB的内存。

I use IIS all the time, it's pretty easy to setup, and you guys are already doing that...

我一直使用IIS,它很容易设置,而你们已经在做那个......

#7


1  

Also, when using IIS 5.1, be sure to get JetStat IIS Admin, it adds functionality that is disabled out of the box on IIS 5, such as being able to setup multiple sites.

此外,在使用IIS 5.1时,请务必使用JetStat IIS Admin,它会添加在IIS 5上禁用的功能,例如可以设置多个站点。

#8


1  

I have run into the following limitations with the asp.net dev server:

我在asp.net dev服务器上遇到了以下限制:

  1. does not support virtual dirs. If you need them in your app, IIS seems to be your only choice

    不支持虚拟目录。如果您在应用程序中需要它们,IIS似乎是您唯一的选择

  2. Classic asp pages dont run in dev server. So if you have a mixed web app (like I have at my client right now), IIS seems to be the solution

    经典的asp页面不能在dev服务器上运行。因此,如果您有一个混合Web应用程序(就像我现在在我的客户端),IIS似乎是解决方案

  3. If you need an admin UI to configure settings, IIS works better

    如果您需要管理UI来配置设置,IIS可以更好地工作

Of course IIS requires that you be a local admin.

当然,IIS要求您是本地管理员。

#9


1  

Another distinction I noticed is that Cassini runs as a 32-bit process and you have no control over it, whereas you can control the application pool of your IIS app to disallow 32-bit (assuming your IIS is running on a 64-bit server). This becomes especially important if your web application is going to call APIs in 64-bit processes such as SharePoint Foundation/Server 2010. When you debug your web app with Cassini as your debug server, you'll get "The Web application at url could not be found. Verify that you have typed the URL correctly" type errors when instantiating objects. If you debug using IIS with the app running in an app pool that runs as 64-bit with an identity that allows access to sharepoint database then you'll be able to debug properly.

我注意到的另一个区别是Cassini以32位进程运行而您无法控制它,而您可以控制IIS应用程序的应用程序池以禁止32位(假设您的IIS在64位服务器上运行) )。如果您的Web应用程序要在64位进程(如SharePoint Foundation / Server 2010)中调用API,这一点就变得尤为重要。当您使用Cassini作为调试服务器调试Web应用程序时,您将获得“url上的Web应用程序”找不到。确认您已正确键入URL“在实例化对象时键入错误。如果您使用运行在64位运行的应用程序池中的应用程序进行调试,该应用程序池具有允许访问sharepoint数据库的标识,那么您将能够正确调试。

#10


1  

In VS12 the development server is way slow, takes a few seconds to download a 2kbyte file. This did not happen in vs10. When you have a bunch of jquery files and css this is a real problem. Also every page requeries all the css/js files. Very very slow regression testing.

在VS12中,开发服务器速度很慢,需要几秒钟才能下载2kbyte文件。这在vs10中没有发生。当你有一堆jquery文件和css这是一个真正的问题。此外,每个页面都会重新查询所有css / js文件。非常慢的回归测试。

#11


0  

The main issue I've run into with the dev server is SerializationExceptions with custom security principals stored on the thread context. Details here.

我与dev服务器遇到的主要问题是SerializationExceptions,其中包含存储在线程上下文中的自定义安全主体。细节在这里。

#1


32  

There is nothing that the ASP.NET Dev WebService can do that IIS can't (You can set breakpoints etc, just attach the VS debugger to the ASP.NET runtime).

ASP.NET DevService没有任何内容可以执行IIS无法做到的事情(您可以设置断点等,只需将VS调试器附加到ASP.NET运行时)。

However, the ASP.NET Dev WebService does not represent a true production environment, and as such you can get caught by gotchas that you wouldn't expect when you deploy to production.

但是,ASP.NET Dev WebService并不代表真正的生产环境,因此您可能会遇到在部署到生产时不会发现的陷阱。

Because of that, I mandate that all development is done using IIS on a local machine. It doesn't take much work to configure a site in IIS.

因此,我要求在本地计算机上使用IIS完成所有开发。在IIS中配置站点并不需要太多工作。

#2


24  

It's a very good idea. Here are some reasons for:

这是一个非常好的主意。以下是一些原因:

  • You no longer need admin access to your machine for web development (it can still be helpful).
  • 您不再需要管理员访问您的计算机进行Web开发(它仍然有用)。
  • It's much easier to test a quick change and continue work, and faster iteration cycles are good.
  • 测试快速更改并继续工作要容易得多,并且更快的迭代周期也很好。
  • It can simplify setup and deployment of your development environments.
  • 它可以简化开发环境的设置和部署。
  • The XP version of IIS has limitation that are not present in the Server version that Cassini side-steps.
  • XP版本的IIS具有Cassini支持的服务器版本中不存在的限制。

The only argument I know against is that there are a couple very rare edge cases where the Cassini built-in server doesn't exactly mimic IIS because you're using odd port numbers. I doubt you'll ever run into them, and using Cassini as the primary dev environment does not preclude developers from also having access to IIS on the machine. In fact, my preferred setup is Cassini first for most small work, then deploy to my local IIS for more in-depth testing before moving code back to the shared source repository.

我所知道的唯一一个论点是,有一些非常罕见的边缘情况,Cassini内置服务器并不完全模仿IIS,因为你使用的是奇数端口号。我怀疑你会遇到它们,并且使用Cassini作为主要开发环境并不妨碍开发人员也可以访问机器上的IIS。事实上,我首选的设置是Cassini首先用于大多数小型工作,然后在将代码移回共享源存储库之前部署到我的本地IIS以进行更深入的测试。

[Edit]
Forgot about url re-writing. You do need IIS for that. And an example of a limitation of the built-in XP IIS is that you are limited to one site in XP (can have multiple applications, but that's a different thing).

[编辑]忘了重写网址。你确实需要IIS。内置XP IIS限制的一个例子是你只限于XP中的一个站点(可以有多个应用程序,但这是另一回事)。

#3


5  

I had to switch (back) to IIS for one project, because I needed to set some virtual directories which is not possible on the ASP.NET Development Web Server.

我不得不为一个项目切换(返回)到IIS,因为我需要设置一些在ASP.NET Development Web Server上无法实现的虚拟目录。

#4


5  

As I stated here: https://*.com/questions/103785/what-are-the-disadvantages-of-using-cassini-instead-of-iis your developers need to be aware that Cassini runs as the local user, which is typically an admin account for developers. The development will be able to access any file or resource that their account can, which is quite different from what they will see on an IIS 6 server.

正如我在此处所述:https://*.com/questions/103785/what-are-the-disadvantages-of-using-cassini-instead-of-iis您的开发人员需要知道Cassini以本地用户身份运行,这通常是开发人员的管理员帐户。开发将能够访问其帐户可以访问的任何文件或资源,这与他们在IIS 6服务器上看到的完全不同。

The other thing that's a pretty big gotcha is debugging web services is much easier using IIS and vdirs rather than separate Cassini instances.

另一件非常重要的事情是使用IIS和vdirs而不是单独的Cassini实例,调试Web服务要容易得多。

#5


2  

I've used both methods and I prefer having IIS locally vs. using the built-in server. At very least you're more consistent with the final deployment setup.

我已经使用了这两种方法,我更喜欢在本地使用IIS而不是使用内置服务器。至少,您与最终部署设置更加一致。

#6


1  

I know at one point I had an issue with Authentication not working as expected on Cassini (built in development server)

我知道有一点我的身份验证在Cassini上没有按预期工作(内置在开发服务器中)

Also, if you need to test things like ISAPI plugins (a re-writer for example) I'm not sure how that's done on Cassini.

此外,如果您需要测试ISAPI插件(例如重写器)之类的东西,我不确定它是如何在Cassini上完成的。

The constantly changing port is also rather disconcerting to me. Also, for each web project in your solution it fires up another instance of a Casini server, and each one takes anywhere from 20 to 50 MB of memory.

不断变化的港口对我来说也很令人不安。此外,对于解决方案中的每个Web项目,它会激活Casini服务器的另一个实例,每个实例需要20到50 MB的内存。

I use IIS all the time, it's pretty easy to setup, and you guys are already doing that...

我一直使用IIS,它很容易设置,而你们已经在做那个......

#7


1  

Also, when using IIS 5.1, be sure to get JetStat IIS Admin, it adds functionality that is disabled out of the box on IIS 5, such as being able to setup multiple sites.

此外,在使用IIS 5.1时,请务必使用JetStat IIS Admin,它会添加在IIS 5上禁用的功能,例如可以设置多个站点。

#8


1  

I have run into the following limitations with the asp.net dev server:

我在asp.net dev服务器上遇到了以下限制:

  1. does not support virtual dirs. If you need them in your app, IIS seems to be your only choice

    不支持虚拟目录。如果您在应用程序中需要它们,IIS似乎是您唯一的选择

  2. Classic asp pages dont run in dev server. So if you have a mixed web app (like I have at my client right now), IIS seems to be the solution

    经典的asp页面不能在dev服务器上运行。因此,如果您有一个混合Web应用程序(就像我现在在我的客户端),IIS似乎是解决方案

  3. If you need an admin UI to configure settings, IIS works better

    如果您需要管理UI来配置设置,IIS可以更好地工作

Of course IIS requires that you be a local admin.

当然,IIS要求您是本地管理员。

#9


1  

Another distinction I noticed is that Cassini runs as a 32-bit process and you have no control over it, whereas you can control the application pool of your IIS app to disallow 32-bit (assuming your IIS is running on a 64-bit server). This becomes especially important if your web application is going to call APIs in 64-bit processes such as SharePoint Foundation/Server 2010. When you debug your web app with Cassini as your debug server, you'll get "The Web application at url could not be found. Verify that you have typed the URL correctly" type errors when instantiating objects. If you debug using IIS with the app running in an app pool that runs as 64-bit with an identity that allows access to sharepoint database then you'll be able to debug properly.

我注意到的另一个区别是Cassini以32位进程运行而您无法控制它,而您可以控制IIS应用程序的应用程序池以禁止32位(假设您的IIS在64位服务器上运行) )。如果您的Web应用程序要在64位进程(如SharePoint Foundation / Server 2010)中调用API,这一点就变得尤为重要。当您使用Cassini作为调试服务器调试Web应用程序时,您将获得“url上的Web应用程序”找不到。确认您已正确键入URL“在实例化对象时键入错误。如果您使用运行在64位运行的应用程序池中的应用程序进行调试,该应用程序池具有允许访问sharepoint数据库的标识,那么您将能够正确调试。

#10


1  

In VS12 the development server is way slow, takes a few seconds to download a 2kbyte file. This did not happen in vs10. When you have a bunch of jquery files and css this is a real problem. Also every page requeries all the css/js files. Very very slow regression testing.

在VS12中,开发服务器速度很慢,需要几秒钟才能下载2kbyte文件。这在vs10中没有发生。当你有一堆jquery文件和css这是一个真正的问题。此外,每个页面都会重新查询所有css / js文件。非常慢的回归测试。

#11


0  

The main issue I've run into with the dev server is SerializationExceptions with custom security principals stored on the thread context. Details here.

我与dev服务器遇到的主要问题是SerializationExceptions,其中包含存储在线程上下文中的自定义安全主体。细节在这里。