问题列表 - 第11511页

在lage数据库上生成SubSonic 3.0.0.3 t4模板会耗尽连接

当针对具有1400+表的数据库运行模板时,我收到以下错误.服务器显示数百个连接.有没有人知道这是一般的模板生成问题,还是具体使用这些模板.其他较小的DB对我来说也没问题.

正在运行转换:System.InvalidOperationException:超时已过期.从池中获取连接之前经过的超时时间.这可能是因为所有池连接都在使用中并且达到了最大池大小.

在Microsoft.VisualStudio.TextTemplating8D8967BD3E8719BDA6DD9945992440F1的System.Data.SqlClient.SqlConnection.Open()处的System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)处的System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection,DbConnectionFactory connectionFactory)处. C:\ POS\POS.Win\Templates\SQLServer.ttinclude中的GeneratedTextTransformation.GetCommand(String sql):c:\ POS\POS.Win\Templates中Microsoft.VisualStudio.TextTemplating8D8967BD3E8719BDA6DD9945992440F1.GeneratedTextTransformation.LoadFKTables(String tableName)中的第13行\ SQLServer.ttinclude:第179行,Microsoft.VisualStudio.TextTemplating8D8967BD3E8719BDA6DD9945992440F1.GeneratedTextTransformation.LoadTables(),位于c:\ POS\POS.Win\Templates\SQLServer.ttinclude:第131行,位于Microsoft.VisualStudio.TextTemplating8D8967BD3E8719BDA6DD9945992440F1.GeneratedTextTransformation.TransformText()in c:\ POS\POS.Win\Templates\ActiveRecord.tt:第21行

subsonic connection-pooling subsonic3

2
推荐指数
1
解决办法
997
查看次数

.NET 4.0的F#和Excel集成(Visual Studio 2010 Beta 1)

任何人都可以提供Web链接或在此演示如何使用.NET 4.0(Visual Studio 2010 Beta 1)进行F#和Excel集成?

我知道如何在CTP版本中执行此操作,但据我所知,它应该在.NET 4.0(Visual Studio 2010 Beta 1)中更简单.

excel f#

3
推荐指数
1
解决办法
3734
查看次数

从python安装脚本中的编译标志中删除ppc

我正在尝试在Intel Mac OS X Leopard计算机上安装PIL.不幸的是,"setup.py build"认为它应该为ppc进行编译.

gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/opt/local/include/freetype2 -IlibImaging -I/sw/include -I/opt/local/include -I/Users/adam/Development/pinax-env/include -I/usr/local/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c libImaging/GifEncode.c -o build/temp.macosx-10.3-i386-2.5/libImaging/GifEncode.o
Run Code Online (Sandbox Code Playgroud)

这失败了,因为我的机器上没有可用的ppc arch文件(我也不想安装它们).我怎么能告诉setup.py只做i386?

我在/Library/Frameworks/Python.framework中查找配置文件无济于事.

python python-imaging-library

8
推荐指数
2
解决办法
1839
查看次数

为什么我使用TextMessageEncodingBindingElement获得XmlException"意外的文件结尾"?

我尝试在理论上做一些非常简单的事情:将字符串反序列化为Message,这里是代码:

[TestMethod]
public void EncoderErrorTest()
{
    var message = "<s:Envelope xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:a=\"http://www.w3.org/2005/08/addressing\"><s:Header><a:Action s:mustUnderstand=\"1\">http://tempuri.org/IHelloWorldService/SayHello</a:Action></s:Header><s:Body><SayHello xmlns=\"http://tempuri.org/\"><name>Nico</name></SayHello></s:Body></s:Envelope>";

    MemoryStream stream = new MemoryStream();
    StreamWriter writer = new StreamWriter(stream);
    writer.Write(message);
    stream.Position = 0;
    var soapMessage = new TextMessageEncodingBindingElement().CreateMessageEncoderFactory().Encoder.ReadMessage(stream, 99999);
    Assert.IsNotNull(soapMessage);
}
Run Code Online (Sandbox Code Playgroud)

但在反序列化期间,我得到一个XmlException"意外的文件结束".我的代码有问题吗?

在此先感谢您的回复.

.net wcf

2
推荐指数
1
解决办法
2587
查看次数

Django transaction.commit_on_success没有回滚事务

我想在MySQL使用Django交易使用commit_on_success装饰.根据文档,"如果该函数引发异常,Django将回滚该事务." 但是,这对我来说似乎不起作用:

>>> @transaction.commit_on_success
... def fails():
...     Site.objects.create(name="New Site", ip_address="127.0.0.1")
...     raise ValueError("oh noes!")
... 
>>> Site.objects.count()   
2
>>> fails()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.6/site-packages/django/db/transaction.py", line 240, in _commit_on_success
    res = func(*args, **kw)
  File "<stdin>", line 4, in fails
ValueError: oh noes!
>>> Site.objects.count()
3
>>>
Run Code Online (Sandbox Code Playgroud)

我很确定MySQL支持交易; 我需要使用不同的表格类型吗?

python mysql django transactions

2
推荐指数
1
解决办法
3442
查看次数

如何在为Visual Studio项目生成XML文档时忽略类?

我有一个Visual Studio(C#)项目,其中启用了"XML文档文件"属性.它还将"将警告视为错误"设置为"全部".

有一个特定的类没有XML注释,它们不会被添加到它中.由于启用了XML文档和警告作为错误,因此这会导致构建失败.

在XML文档方面,有没有办法忽略这个特定的类?

c# documentation-generation visual-studio

10
推荐指数
1
解决办法
3632
查看次数

多个周期性定时器

是否有任何标准的python模块用于创建多个定期计时器.我想设计一个系统,它支持在一个线程中创建不同周期的多个周期性定时器.系统应该能够在任何时间取消特定的计时器.

提前感谢任何输入!

python

3
推荐指数
1
解决办法
3490
查看次数

Children.Add(item)值不在预期范围内

我正在开发一个Silverlight 3应用程序,当我尝试将一个对象添加到Canvas时,会出现这个非常奇怪的错误.我的代码如下:

for (int i = 0; i < person.Children.Count; i++)
{
    //Add children in same position as parent
    Person child = person.Children[i];
    child.x_PositionTransform.X = person.x_PositionTransform.X;
    child.x_PositionTransform.Y = person.x_PositionTransform.Y;
    child.Click += new RoutedEventHandler(person_Click);
    x_LayoutRoot.Children.Add(child);
}
Run Code Online (Sandbox Code Playgroud)

我第一次使用它,它按预期工作.但是,当我在单击使用此代码创建的Person对象后点击x_LayoutRoot.Children.Add(child)时,我收到一个ArgumentException,告诉我"Value不在预期范围内".

但是,当我在将child添加到x_LayoutRoot.Children之前添加以下代码时,问题就会消失.

child.SetValue(Canvas.NameProperty, "child" + objCount++);
Run Code Online (Sandbox Code Playgroud)

为什么会这样?这是一个Silverlight错误,还是(更有可能)我错过了什么?

.net c# silverlight

11
推荐指数
1
解决办法
2万
查看次数

Moq:单元测试依赖于HttpContext的方法

考虑.NET程序集中的方法:

public static string GetSecurityContextUserName()
{             
 //extract the username from request              
 string sUser = HttpContext.Current.User.Identity.Name;
 //everything after the domain     
 sUser = sUser.Substring(sUser.IndexOf("\\") + 1).ToLower();

 return sUser;      
}
Run Code Online (Sandbox Code Playgroud)

我想使用Moq框架从单元测试中调用此方法.该程序集是webforms解决方案的一部分.单元测试看起来像这样,但我错过了Moq代码.

//arrange 
 string ADAccount = "BUGSBUNNY";
 string fullADName = "LOONEYTUNES\BUGSBUNNY"; 

 //act    
 //need to mock up the HttpContext here somehow -- using Moq.
 string foundUserName = MyIdentityBL.GetSecurityContextUserName();

 //assert
 Assert.AreEqual(foundUserName, ADAccount, true, "Should have been the same User Identity.");
Run Code Online (Sandbox Code Playgroud)

问题:

  • 我如何使用Moq来安排假的HttpContext对象,其值如'MyDomain\MyUser'?
  • 如何将我的调用与我的调用关联到静态方法中MyIdentityBL.GetSecurityContextUserName()
  • 您对如何改进此代码/架构有任何建议吗?

c# unit-testing moq mocking

38
推荐指数
1
解决办法
3万
查看次数

有大量用例的单元测试

我正在研究一个有很多用例的java应用程序.对应用程序的输入是在不同时间发生的不同类型的事件.这种输入引发了数百个测试用例.有人遇到过这种情况吗?在向QA团队发布之前,您是否确保涵盖所有测试用例?所以我的问题是:测试具有大量测试用例的程序的最佳方法是什么?

unit-testing

7
推荐指数
2
解决办法
2454
查看次数