小编Luk*_*ett的帖子

Windows Phone 7 - 应用程序无法启动,没有错误,只需加载即可

在准备我的手机应用程序发布时,我想我会更改所有程序集的版本号.

我也遇到了WCF服务客户端没有自动生成代理代码的问题,我已经提出了一个已知错误,MS已经修复了vNext,但我不认为它是相关的.在任何情况下,我都对此进行了排序,我相信它与我正在准备发布的准备有关.

我的应用程序现在无法加载到模拟器或设备中.它只是在CLR引导期间轰炸而没有错误来帮助我.我很沮丧,我在MS的十年里打开了我的第一个支持电话.

这是输出窗口的内容:

'taskhost.exe' (Managed): Loaded 'mscorlib.dll'
'taskhost.exe' (Managed): Loaded 'System.Windows.RuntimeHost.dll'
'taskhost.exe' (Managed): Loaded 'System.dll'
'taskhost.exe' (Managed): Loaded 'System.Windows.dll'
'taskhost.exe' (Managed): Loaded 'System.Core.dll'
'taskhost.exe' (Managed): Loaded 'System.Xml.dll'
'taskhost.exe' (Managed): Loaded '\Applications\Install\A2C90EB3-BF72-4317-B6FB-7D05843D6E15\Install\Company.Product.Mobile.WindowsPhoneUK.dll', Symbols loaded.
'taskhost.exe' (Managed): Loaded '\Applications\Install\A2C90EB3-BF72-4317-B6FB-7D05843D6E15\Install\Company.Product.Mobile.dll', Symbols loaded.
'taskhost.exe' (Managed): Loaded 'Microsoft.Phone.dll'
'taskhost.exe' (Managed): Loaded 'Microsoft.Phone.Interop.dll'
The thread '<No Name>' (0xc7e00a2) has exited with code 0 (0x0).
The thread '<No Name>' (0xcdd0076) has exited with code 0 (0x0).
The program '[232259726] taskhost.exe: Managed' has exited with code 0 …
Run Code Online (Sandbox Code Playgroud)

silverlight visual-studio-2010 windows-phone-7

15
推荐指数
3
解决办法
3569
查看次数

IIS Express无法启动

我只是把它放在那里,因为它是一个谷歌零结果,这意味着我赢了奖?

从一个帐户重新安装后无法启动IIS Express 7.5,但我可以在我的其他域帐户下登录.

奇怪的是,它失败的帐户是我的"超级"帐户,具有本地管理员权限,也是我安装它的帐户.

该错误源于diprestr.dll无法加载...

C:\Program Files (x86)\IIS Express>iisexpress.exe /trace:error
Starting IIS Express ...
Initializing the W3 Server Started CTC = 2068729
W3 Server initializing WinSock.  CTC = 2068744
W3 Server WinSock initialized.  CTC = 2068744
W3 Server ThreadPool initialized (ipm has signalled).  CTC = 2068744
Failed to load global module C:\Program Files (x86)\IIS Express\diprestr.dll
Failed processing with hr = 8007007e
Error loading global modules.  hr = 8007007e
Terminating W3_SERVER object
Start listenerChannel http:0
Initializing the W3 Server Started …
Run Code Online (Sandbox Code Playgroud)

iis-express

15
推荐指数
4
解决办法
3万
查看次数

Swashbuckle Swagger - 如何注释内容类型?

如何对ASP.NET WebAPI操作进行注释,以便swagger元数据包含我的资源支持的内容类型?

具体来说,我希望文档显示我的一个资源可以返回'原始' application/json,application/xml但现在也返回一个新格式,application/vnd.blah+json或者+xml.

asp.net-web-api2 swagger-2.0 swashbuckle

15
推荐指数
3
解决办法
2万
查看次数

AddIdentity与AddIdentityCore

在ASP.NET的核心,您可以识别添加各种服务:AddDefaultIdentityAddIdentityAddIdentityCore

AddIdentity和之间有什么区别AddIdentityCore

.net c# asp.net-mvc asp.net-core

15
推荐指数
2
解决办法
2665
查看次数

HttpResponseException和HttpException之间有什么区别

来自http://www.asp.net/web-api/overview/web-api-routing-and-actions/exception-handling

HttpResponseException

如果Web API控制器抛出异常会发生什么?默认情况下,大多数异常都会转换为状态代码为500,内部服务器错误的HTTP响应.

HttpResponseException类型是一种特殊情况.此异常返回您在异常构造函数中指定的任何HTTP状态代码.

除了它没有.提琴手告诉我500返回.

但是,HttpException似乎就是那篇文章所说的.

文档是错误的还是我错过了什么?

UPDATE

在打字的时候,我有了一个主意.我试过两个控制器,一个ApiController和一个标准的MVC控制器.

这两个异常相互反向,具体取决于它们抛出的控制器类型.

  • 使用HttpResponseException从API控制器返回正确的HTTP代码.
  • 使用HttpException从MVC控制器返回正确的HTTP代码.

asp.net-mvc

14
推荐指数
1
解决办法
3191
查看次数

为什么.NET应用程序中使用的接口如此丰富?

最近,我开始研究一个大型的主流项目,为一个我无法透露的客户提供面向公众的电子商务平台.

我和经验丰富的开发人员合作,他们在伦敦金融城的许多项目中拥有多年的经验.

似乎每个人都在很大程度上进入接口.这是压倒性的,我现在怀疑我以前做过的所有事情,即使用抽象基类.

.NET不是COM,它不是基于接口的编程平台.我是否遗漏了某些东西,或者这只是一种群体心态 - 多年的编程已经成为.NET领域公认的规范?

谢谢

卢克

.net architecture coding-style

13
推荐指数
2
解决办法
4459
查看次数

ParameterArgumentTransformationError

我有一个脚本,见下文,它在sys驱动器上搜索最新的MSDeploy可执行文件.

但是,Compare-FileVersion由于以下错误,我的函数未被调用:

Compare-FileVersions : Cannot process argument transformation on parameter 'file1'. Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.IO.FileInfo". At C:\DATA\Git\PowerShell\Test-Command.ps1:32 char:39
+         $winner = Compare-FileVersions($incumbent, $challenger);
+                                       ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Compare-FileVersions], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Compare-FileVersions
Run Code Online (Sandbox Code Playgroud)

这是脚本:

function Find-Executable()
{
    # Find all MS Deploy executables and then make a table of path and version. Reverse sort and pick top one.

    pushd;

    # Workaround for bug in PS where ErrorAction spec'ed …
Run Code Online (Sandbox Code Playgroud)

powershell powershell-3.0

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

MSTest - 如何为UnitTest项目初始化log4net?

我有一个用于测试ASP.NET MVC项目的Visual Studio单元测试项目.

将程序集级别log4net.Config.XmlConfigurator属性添加到AssemblyInfo.cs不起作用,SO上的其他人发现他们必须使用直接调用log4net.Config.XmlConfigurator.Configure();

问题是,如何才能对单元测试进行此操作?Microsoft.VisualStudio.TestTools.UnitTesting.AssemblyInitialize在类方法上使用属性的答案不起作用.

对我来说,这段代码导致InvalidOperationException输出窗口登录,测试会话提前爆炸.

[TestClass]
public sealed class Startup
{
    [AssemblyInitialize]
    public void Configure()
    {
        System.Diagnostics.Debug.Write("Microsoft.VisualStudio.TestTools.UnitTesting.AssemblyInitialize");
    }
}
Run Code Online (Sandbox Code Playgroud)

阅读文档,MSDN表示不要AssemblyInitialize在ASP.NET的测试项目中使用,因为它们可能不止一次被调用.

那么如何才能在运行任何测试之前配置log4net?

c# asp.net-mvc unit-testing log4net-configuration visual-studio-2012

13
推荐指数
1
解决办法
8363
查看次数

Bower,Grunt和Yeoman如何融入Visual Studio .NET工作流程?

Bower,Grunt和Yeoman等工具最近大受欢迎.

每当我读到它们或在文章中看到它们时,我都将它们视为用于基于Mac的前端开发或基于PC的工具,而不是微软堆栈上的工具 - Sublime Text等.

Visual Studio有NuGet,项目模板,MSBuild,MSDeploy,TeamCity/TFS Azure等.我一般认为VS是一个非常高度自动化的生态系统(有人说它以牺牲理解为代价使我们高效).

ASP.NET开发人员如何在VS上使用这些工具?

注意:这不是一个基于意见的问题,我正在寻找有关如何使用这些工具的真实示例.

asp.net-mvc web-deployment gruntjs yeoman bower

13
推荐指数
1
解决办法
5101
查看次数

如何使用`System.Diags ... Trace`登录详细级别

好的,不要笑.在2005年,我读到了使用System.Diagnostics命名空间的跟踪,它很复杂,我从那时起就使用了log4net和NLog(其他人都是如此).

今天,我的应用程序将托管在Windows Azure网站上,并使用我们的老朋友Trace.

http://azure.microsoft.com/en-gb/documentation/articles/web-sites-enable-diagnostic-log/

沾沾自喜,我总是使用抽象,IoC,所以我只是写一个新的小垫片来写,Trace但它只有TraceInformation,TraceWarningTraceError.

有一些Write*方法,但我不知道他们最终会在什么情况下结束.可怕的API.[噱头]

哪种方法适用于详细/调试级别?

编辑:从标题中删除"Easy one".显然不是.

.net c# instrumentation trace

13
推荐指数
1
解决办法
8156
查看次数