我当时希望为Microsoft Visual Studio安装最新的Windows Azure工具.但是,此版本不适用于Visual Studio 2010 Beta 2.他们说最新版本的Azure Tools&SDK仅适用于VS 2008和VS 2010 RC,而对于VS 2010 Beta 2,我仍需要安装11月版本.
我知道VS 2010将于今年4月12日发布,但有谁知道VS 2010 RC何时问世?
编辑:Visual Studio 2010的完整RTM版本自2010年4月14日发布.
Moq允许开发人员模拟受保护的成员.我在Rhino.Mocks中寻找相同的功能但却找不到它.
以下是Moq快速入门页面如何模拟受保护方法的示例.
// at the top of the test fixture
using Moq.Protected()
// in the test
var mock = new Mock<CommandBase>();
mock.Protected()
.Setup<int>("Execute")
.Returns(5);
// if you need argument matching, you MUST use ItExpr rather than It
// planning on improving this for vNext
mock.Protected()
.Setup<string>("Execute",
ItExpr.IsAny<string>())
.Returns(true);
Run Code Online (Sandbox Code Playgroud)
如果我正在追逐不退出的东西,请告诉我.
贝娄是我的代码的简化版本:
public interface IControl<T>
{
T Value { get; }
}
public class BoolControl : IControl<bool>
{
public bool Value
{
get { return true; }
}
}
public class StringControl : IControl<string>
{
public string Value
{
get { return ""; }
}
}
public class ControlFactory
{
public IControl GetControl(string controlType)
{
switch (controlType)
{
case "Bool":
return new BoolControl();
case "String":
return new StringControl();
}
return null;
}
}
Run Code Online (Sandbox Code Playgroud)
问题出在ControlFactory类的GetControl方法中.因为它返回IControl而我只有IControl <T>这是一个通用接口.我不能提供T,因为在Bool情况下它会bool而在String情况下它将是字符串.
知道我需要做些什么来使它工作?
我相信大多数IoC容器允许您使用XML配置文件连接依赖项.使用配置文件与在代码中注册依赖项有什么缺点和优点?
我观看了很少关于"奥斯陆"的视频/网络直播,但我仍然没有看到它们是如何结合在一起的.
我知道奥斯陆是一个建模平台.
创建DSL的过程是什么?
它不仅仅是创建DSL的工具吗?
我知道MGramma用于创建DSL的语法.
什么是M语言?
什么是MSchema?
创建MGrammar并将其编译为.mgx后,下一步是什么?
在我的Silverlight应用程序中,我主要使用的是XmlReader,但我正在尝试用LINQ to XML替换XmlReader实现.
在Silverlight中LINQ to XML和XmlReader之间的优缺点是什么?
我正在写一个可能在某个时候删除文件的Windows服务.由于该服务正在处理常规文件IO,因此删除期间可能正在使用该文件.
目前我正在尝试删除并在发生异常时做出反应.代码看起来像这样:
try
{
File.Delete(file);
Status = ResponseStatus.Ok;
}
catch (IOException e)
{
Status = ResponseStatus.FileInUse;
}
finally
{
return Status;
}
Run Code Online (Sandbox Code Playgroud)
如何在不使用异常的情况下确定正在使用的文件?
根据CAP定理,分布式计算机系统不可能同时提供一致性,可用性和分区容限。
阅读有关RavenDB的信息后,该数据库似乎同时支持ACID事务和分片。RavenDB如何实现这一目标?
我刚刚下载并安装了Microsoft Enterprise Library 5.0.我启动了VS 2010以使用EL 5并创建了一个非常简单的控制台应用程序.但是,它不会编译.我收到以下错误:
命名空间"Microsoft.Practices.EnterpriseLibrary"中不存在类型或命名空间名称"Data"(您是否缺少程序集引用?)
我添加了Microsoft.Practices.EnterpriseLibrary.Common,Microsoft.Practices.EnterpriseLibrary.Data和Microsoft.Practices.Unity 对我的项目的引用.
这是拒绝编译的简单代码.
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Unity;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.Unity;
namespace EntLib
{
class Program
{
static void Main(string[] args)
{
IUnityContainer container = new UnityContainer();
container.AddNewExtension<EnterpriseLibraryCoreExtension>();
var defaultDatabase = container.Resolve<Database>();
}
}
}
Run Code Online (Sandbox Code Playgroud)
上面的错误抱怨第2行:
using Microsoft.Practices.EnterpriseLibrary.Data;
Run Code Online (Sandbox Code Playgroud)
有人可能会指出我犯了一个愚蠢的错误,但此刻我没有看到它.
我试图删除并再次添加Microsoft.Practices.EnterpriseLibrary.Data以重新启用,但它没有帮助.
c# ×3
.net ×1
azure ×1
cap ×1
exception ×1
file-io ×1
linq-to-xml ×1
mocking ×1
moq ×1
oop ×1
oslo ×1
ravendb ×1
rhino-mocks ×1
silverlight ×1
xmlreader ×1