Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Blend不调用DesignTimeBootstrapper_C#_Wpf_Visual Studio 2010_Expression Blend - Fatal编程技术网

C# Blend不调用DesignTimeBootstrapper

C# Blend不调用DesignTimeBootstrapper,c#,wpf,visual-studio-2010,expression-blend,C#,Wpf,Visual Studio 2010,Expression Blend,我需要Blend 4调用一些初始化代码,然后才能合理地显示我的应用程序,我正在使用Josh Smith来完成它 我使用以下项目结构: MainProgram -- Properties -- AssemblyInfo.cs (including the custom attribute) -- App.xaml -- HostWindow.xaml (UserControls are embedded here) -- DesignTimeBootstrapper

我需要Blend 4调用一些初始化代码,然后才能合理地显示我的应用程序,我正在使用Josh Smith来完成它

我使用以下项目结构:

MainProgram
  -- Properties
     -- AssemblyInfo.cs (including the custom attribute)
  -- App.xaml
  -- HostWindow.xaml    (UserControls are embedded here)
  -- DesignTimeBootstrapperAttribute.cs

ViewsAssembly
  -- Lots of user controls
由于某些原因,在每次构建之后都不会调用设计时引导程序(导致我的自定义标记扩展在Blend中抛出异常和大量错误消息)。但是,它在最初加载解决方案时被调用,我不理解Blend在这里的行为方式

我做错了什么,还是有其他方法

编辑:
我注意到,每次进行完整的重建都会调用引导程序。也许这可以作为一种解决办法,但我仍然想了解它。

你能验证一下,在重建后,你真的更改了主应用程序的汇编二进制文件,而这些二进制文件不执行启动吗?(如果二进制文件不变,我希望Blend不会计算反射)。我也会尝试干净的解决方案,然后重新反驳

作为一个繁重的工作,您可能会考虑在生成后事件中更改解决方案/项目文件(例如,添加一个空间),这将导致混合重新加载解决方案并再次执行自定义的启动代码。p>


作为补充说明,我使用VS XAML UI Designer process(xDesProc)的经验表明,它并不总是捕获我在重新构建后所做的更改,我必须使用任务管理器强制重新加载,sme可能会发生在blend上。

感谢您的建议。MainProgram的程序集会随着每次生成而更新,即使只有ViewsAssembly发生了更改。Clen重建听起来像是一个计划)。只是想知道,您的错误是否像“错误消息:类型“[ClassName]”的构造函数没有0个参数”不,不是这些。我在项目的某些部分中使用了服务定位器,需要在使用它之前对其进行初始化。由于未调用初始化,因此当Blend尝试使用它时会抛出异常。