VisualStudio2010をバージョン10.0.30319.1RTMRelに更新し、ビルド中に次の例外が発生し始めました。
System.NullReferenceException:オブジェクト参照がオブジェクトのインスタンスに設定されていません。Microsoft.Silverlight.Build.Tasks.CompileXaml.LoadAssemblies(ITaskItem [] ReferenceAssemblies)at Microsoft.Silverlight.Build.Tasks.CompileXaml.get_GetXamlSchemaContext()at Microsoft.Silverlight.Build.Tasks.CompileXaml.GenerateCode(ITaskItem item、Boolean isApplication )Microsoft.Silverlight.Build.Tasks.CompileXaml.Execute()でBohr.Silverlight.BuildTasks.BohrCompileXaml.Execute()で
BohrCompileXaml.Executeのコードは次のとおりです。
public override bool Execute() {
List<TaskItem> pages = new List<TaskItem>();
foreach (ITaskItem item in SilverlightPages) {
string newFileName = getGeneratedName(item.ItemSpec);
String content = File.ReadAllText(item.ItemSpec);
String parentClassName = getParentClassName(content);
if (null != parentClassName) {
content = content.Replace("<UserControl", "<" + parentClassName);
content = content.Replace("</UserControl>", "</" + parentClassName + ">");
content = content.Replace("bohr:ParentClass=\"" + parentClassName + "\"", "");
}
File.WriteAllText(newFileName, content);
pages.Add(new TaskItem(newFileName));
}
if (null != SilverlightApplications) {
foreach (ITaskItem item in SilverlightApplications) {
Log.LogMessage(MessageImportance.High, "Application: " + item.ToString());
}
}
foreach (ITaskItem item in pages) {
Log.LogMessage(MessageImportance.High, "newPage: " + item.ToString());
}
CompileXaml xamlCompiler = new CompileXaml();
xamlCompiler.AssemblyName = AssemblyName;
xamlCompiler.Language = Language;
xamlCompiler.LanguageSourceExtension = LanguageSourceExtension;
xamlCompiler.OutputPath = OutputPath;
xamlCompiler.ProjectPath = ProjectPath;
xamlCompiler.RootNamespace = RootNamespace;
xamlCompiler.SilverlightApplications = SilverlightApplications;
xamlCompiler.SilverlightPages = pages.ToArray();
xamlCompiler.TargetFrameworkDirectory = TargetFrameworkDirectory;
xamlCompiler.TargetFrameworkSDKDirectory = TargetFrameworkSDKDirectory;
xamlCompiler.BuildEngine = BuildEngine;
bool result = xamlCompiler.Execute(); // HERE we got the error!
そして、タスクの定義:
<BohrCompileXaml
LanguageSourceExtension="$(DefaultLanguageSourceExtension)"
Language="$(Language)"
SilverlightPages="@(Page)"
SilverlightApplications="@(ApplicationDefinition)"
ProjectPath="$(MSBuildProjectFullPath)"
RootNamespace="$(RootNamespace)"
AssemblyName="$(AssemblyName)"
OutputPath="$(IntermediateOutputPath)"
TargetFrameworkDirectory="$(TargetFrameworkDirectory)"
TargetFrameworkSDKDirectory="$(TargetFrameworkSDKDirectory)"
>
<Output ItemName="Compile" TaskParameter="GeneratedCodeFiles" />
<!-- Add to the list list of files written. It is used in Microsoft.Common.Targets to clean up
for a next clean build
-->
<Output ItemName="FileWrites" TaskParameter="WrittenFiles" />
<Output ItemName="_GeneratedCodeFiles" TaskParameter="GeneratedCodeFiles" />
</BohrCompileXaml>
理由は何ですか?そして、どうすればCompileXamlクラス内で何が起こっているのかをより多くの情報を得ることができますか?