如何为.Net应用程序编写性能测试?nUnit或任何其他测试框架是否为此提供了框架?
编辑:我必须衡量WCF服务的性能.
我在IIS 6.0上部署Asp.Net MVC 2.0应用程序.当我请求任何页面时,我收到以下错误.
Parser Error Message:
Could not load type 'System.Web.Mvc.ViewMasterPage<dynamic>'.
Run Code Online (Sandbox Code Playgroud)
来源错误:
Line 1: <%@ Master Language="C#" Inherits=
"System.Web.Mvc.ViewMasterPage<dynamic>" %>
Line 2: <%@ Import Namespace="Combres.Mvc" %>
Line 3:
Run Code Online (Sandbox Code Playgroud)
源文件:/myApp/Views/Shared/Site.Master行:1
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.0.30319.1
Run Code Online (Sandbox Code Playgroud) 我有两个PL/SQL存储过程,每个过程处理自己的事务(如果出错,则开始/提交和回滚).来自.Net代码我将这两个SP称为如下所示.
using (TransactionScope ts = new TransactionScope())
{
CallSP1();
CallSP2().
ts.SetComplete();
}
Run Code Online (Sandbox Code Playgroud)
如果我的SP2调用失败,它将回滚CallSP1()所做的更改吗?如果它没有回滚那么这是否意味着更好地从.Net应用程序而不是在存储过程内处理事务?
我正在使用NHibernate连接到旧的rdbms系统。在高生产负载下,rdbms服务将失败。为了保持可用性,我们提供了故障转移rdbms服务。有没有一种方法可以配置NHibernate在主连接断开时使用FailOver连接字符串?
附加信息:我在NHibernate上使用Castle。如果Castle提供了故障转移连接的处理,那也将为我做这件事。
我使用的是Asp.Net 4.0,会话状态的配置如下所示.
<sessionState mode="SQLServer" cookieless="false" timeout="5"
allowCustomSqlDatabase="true"
sqlConnectionString="data source=.\SqlExpress;initial catalog=App_SessionState;user id=sa;password=xxxxxxxx"/>
Run Code Online (Sandbox Code Playgroud)
如果我在浏览器中没有活动大约10分钟,则不应删除Session对象.但是10分钟后我仍然可以访问Session变量.我在这里错过了什么吗?
编辑:
如果我在10分钟后访问一个会话变量,如下所示,我不应该得到NULL
var myObj = Session["MyKey"] as MyClass;
Run Code Online (Sandbox Code Playgroud)
10分钟后mObj不为NULL.
我正在使用NHibernate 3.0 配置二级缓存.二级缓存适用于实体和集合,但我也有一些已过滤集合的实体.
<bag name="EntityTrans" cascade="all-delete-orphan" table="EntityTrans">
<key column="entityId" not-null="true" />
<one-to-many class="MyDomain.EntityTran, MyDomain" />
<filter name="cultureFilter" condition=":cultureCode = CultureCode" />
</bag>
Run Code Online (Sandbox Code Playgroud)
NHibernate二级缓存不会缓存上面过滤的集合.我可以在NHProf中看到过滤的集合查询被发送到数据库.我的NHibernate配置文件包含以下条目.
<class-cache class="MyDomain.EntityTran, MuDomain" region="MyRegion" usage="read-only"/>
<collection-cache collection="MyDomain.Entity.EntityTrans" region="MyRegion" usage="read-only"/>
Run Code Online (Sandbox Code Playgroud)
我是否需要添加更多内容来缓存已过滤的集合?
我有一个使用Asp.net MVC2的Web应用程序.我将它升级到MVC 3,现在我发现OutputCache功能不再起作用了.我创建了一个简单的Test动作,如下所示.
[OutputCache(Duration = 1000000, VaryByParam = "none")]
public virtual ActionResult CacheTest(string name)
{
string message = string.Format("{0}: Time is {1}", name, DateTime.Now.ToLongTimeString());
ViewData.Add("Message", message);
return View();
}
Run Code Online (Sandbox Code Playgroud)
这总是给出当前时间,表明它没有被缓存.我在这里错过了什么吗?
更多信息:如果我创建一个新的Mvc3应用程序,它工作正常.它只在升级的应用程序中,我有这个问题.
更新:我也在使用Ninject.如果我停止使用Ninject OutputCache开始工作.
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}.aspx/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } …Run Code Online (Sandbox Code Playgroud) VS 代码具有很好的内置功能来区分两个文件。
是否可以使用 vs code diff作为git的diff工具?
我在.Net 4.0上的IIS 7.5上部署了一个Asp.Net MVC 2 Web应用程序.当我选择应用程序池为Asp.Net v4.0 Classic时,我收到以下错误.
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Run Code Online (Sandbox Code Playgroud)
当我选择应用程序池为Asp.Net v4.0 Integrated时,同样的应用程序工作正常.有谁知道这是什么原因?
更新:我按照以下网址中的步骤操作.
http://www.asp.net/mvc/tutorials/using-asp-net-mvc-with-different-versions-of-iis-cs
我已经添加了.mvc扩展名的地图,并修改了路由,如下所示.
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}.mvc/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"Root",
"",
new { controller = "Home", action = "Index", id = "" }
Run Code Online (Sandbox Code Playgroud)
现在以下url工作正常,我可以看到Home/Index页面. …
asp.net ×4
asp.net-mvc ×3
.net ×2
ado.net ×2
nhibernate ×2
.net-4.0 ×1
asp.net-4.0 ×1
assemblies ×1
caching ×1
clr ×1
diff ×1
failover ×1
git ×1
hibernate ×1
iis ×1
iis-6 ×1
ninject ×1
nunit ×1
oracle ×1
performance ×1
plsql ×1
session ×1
transactions ×1
wcf ×1