0
我正在.NET4.5 WPF應用程序中工作。我收到了App.xml
行<desktop1:ReactiveBootstrapper x:Key="bootstrapper" />
中顯示的特殊異常,我認爲這與添加新的Web服務方法有關。序列不包含任何元素,Castle.Facilities.WcfIntegration.WcfClientExtension.ObtainServiceContract
app.xml的
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<desktop1:ReactiveBootstrapper x:Key="bootstrapper" />
</ResourceDictionary>
<ResourceDictionary Source="Utilities/Styles/DefaultStyle.xaml" />
<ResourceDictionary Source="Utilities/Styles/DataGridStyle.xaml" />
<!--<ResourceDictionary Source="Utilities/Styles/ScrollViewerStyle.xaml"/>-->
<ResourceDictionary Source="Utilities/Styles/RoundedButtonStyle.xaml" />
<ResourceDictionary Source="Utilities/Styles/ExpanderStyle.xaml" />
<ResourceDictionary Source="Utilities/Styles/RadioButtonStyle.xaml" />
<!--<ResourceDictionary Source="Utilities/Styles/DropDownStyle.xaml"/>-->
</ResourceDictionary.MergedDictionaries>
<BooleanToVisibilityConverter x:Key="boolToVis" />
<iValueConverters:BooleanToVisibilityConverter x:Key="negatedBoolToVis" True="Collapsed" False="Visible" />
<iValueConverters:NullToVisibilityConverter x:Key="nullToVis" VisibleWhenNull="True" />
<valueConverters1:NotNullToVisibilityConverter x:Key="notNullToVis" VisibleWhenNotNull="True" />
<valueConverters1:NotNullToCollapsedVisibilityConverter x:Key="notNullToCollapsedVis"
VisibleWhenNotNull="True" />
<valueConverters1:EnvironmentToBooleanConverter x:Key="EnvironmentToBooleanConverter" />
</ResourceDictionary>
</Application.Resources>
堆棧跟蹤:
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at Corp.Desktop.App.InitializeComponent() in c:\dev\CCTech Main\Corp-Wills\Corp.Conveyancing.Desktop\App.xaml:line 1
at Corp.Desktop.App.Main() in c:\dev\CCTech Main\Corp-Wills\Corp.Conveyancing.Desktop\obj\x86\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
內堆棧跟蹤:
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
at Castle.Facilities.WcfIntegration.WcfClientExtension.ObtainServiceContract(ComponentModel model, IWcfClientModel clientModel) in d:\work\8dfeb153df23a288\src\Castle.Facilities.WcfIntegration\Client\WcfClientExtension.cs:line 239
at Castle.Facilities.WcfIntegration.WcfClientExtension.ResolveClientModel(ComponentModel model) in d:\work\8dfeb153df23a288\src\Castle.Facilities.WcfIntegration\Client\WcfClientExtension.cs:line 231
at Castle.Facilities.WcfIntegration.WcfClientExtension.Kernel_ComponentModelCreated(ComponentModel model) in d:\work\8dfeb153df23a288\src\Castle.Facilities.WcfIntegration\Client\WcfClientExtension.cs:line 189
at Castle.MicroKernel.ComponentModelDelegate.Invoke(ComponentModel model)
at Castle.MicroKernel.DefaultKernel.RaiseComponentModelCreated(ComponentModel model) in d:\work\8dfeb153df23a288\src\Castle.Windsor\MicroKernel\DefaultKernel_Events.cs:line 72
at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.CreateHandler(ComponentModel model) in d:\work\8dfeb153df23a288\src\Castle.Windsor\MicroKernel\DefaultKernel.cs:line 273
at Castle.MicroKernel.DefaultKernel.AddCustomComponent(ComponentModel model) in d:\work\8dfeb153df23a288\src\Castle.Windsor\MicroKernel\DefaultKernel.cs:line 260
at Castle.MicroKernel.Registration.ComponentRegistration`1.Castle.MicroKernel.Registration.IRegistration.Register(IKernelInternal kernel) in d:\work\8dfeb153df23a288\src\Castle.Windsor\MicroKernel\Registration\ComponentRegistration.cs:line 1122
at Castle.MicroKernel.DefaultKernel.Register(IRegistration[] registrations) in d:\work\8dfeb153df23a288\src\Castle.Windsor\MicroKernel\DefaultKernel.cs:line 501
at Castle.MicroKernel.Registration.BasedOnDescriptor.TryRegister(Type type, IKernel kernel) in d:\work\8dfeb153df23a288\src\Castle.Windsor\MicroKernel\Registration\BasedOnDescriptor.cs:line 512
at Castle.MicroKernel.Registration.FromDescriptor.Castle.MicroKernel.Registration.IRegistration.Register(IKernelInternal kernel) in d:\work\8dfeb153df23a288\src\Castle.Windsor\MicroKernel\Registration\FromDescriptor.cs:line 184
at Castle.MicroKernel.Registration.BasedOnDescriptor.Castle.MicroKernel.Registration.IRegistration.Register(IKernelInternal kernel) in d:\work\8dfeb153df23a288\src\Castle.Windsor\MicroKernel\Registration\BasedOnDescriptor.cs:line 558
at Castle.MicroKernel.DefaultKernel.Register(IRegistration[] registrations) in d:\work\8dfeb153df23a288\src\Castle.Windsor\MicroKernel\DefaultKernel.cs:line 501
at Castle.Windsor.WindsorContainer.Register(IRegistration[] registrations) in d:\work\8dfeb153df23a288\src\Castle.Windsor\Windsor\WindsorContainer.cs:line 483
at Corp.Desktop.ReactiveBootstrapper.RegisterWcfServices() in c:\dev\CCTech Main\Corp-Wills\Corp.Conveyancing.Desktop\ReactiveBootstrapper.cs:line 101
at Corp.Desktop.ReactiveBootstrapper.Configure() in c:\dev\CCTech Main\Corp-Wills\Corp.Conveyancing.Desktop\ReactiveBootstrapper.cs:line 146
at Caliburn.Micro.BootstrapperBase.StartRuntime() in c:\Projects\caliburnmicro\src\Caliburn.Micro.Silverlight\Bootstrapper.cs:line 98
at Caliburn.Micro.BootstrapperBase.Start() in c:\Projects\caliburnmicro\src\Caliburn.Micro.Silverlight\Bootstrapper.cs:line 49
at Corp.Desktop.ReactiveBootstrapper..ctor() in c:\dev\CCTech Main\Corp-Wills\Corp.Conveyancing.Desktop\ReactiveBootstrapper.cs:line 66
它吹ü在this.Start();
上的Reactive bootstrapper構造函數中,我無法進一步介紹。
public class ReactiveBootstrapper : BootstrapperBase {
public ReactiveBootstrapper()
{
this.Log.Info("Starting bootstrapper");
this.Start();
}
}
BootstrapperBase
爲Caliburn.Micro
我假設的東西炸燬了依賴注入。
有沒有人遇到過這個錯誤,並知道這裏發生了什麼?或者有想法如何進一步調試?,我相信異常開始出現後向Web服務添加額外的方法,但我不是100%確定。如果你需要更多的信息,只需要問。
*序列不包含任何元素*這意味着某些IEnumerable/collection是空的,但它不應該如此。當您在空IEnumerable上使用First()時,也會引發這種異常。雖然我不熟悉其他涉及的代碼。 – 2014-10-09 16:15:24
@KingKing在這種情況下,它是'Single()',因爲您可以從內部StarckTrace頂部的堆棧跟蹤中看到,無論如何。我在這裏有點絕望,所以任何形式的幫助都非常感謝。 – 2014-10-09 16:45:45