Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 788233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:19:48+00:00 2026-05-14T21:19:48+00:00

I updated my Visual Studio 2010 to the version 10.0.30319.1 RTM Rel and start

  • 0

I updated my Visual Studio 2010 to the version 10.0.30319.1 RTM Rel and start getting the following exception during the build:

System.NullReferenceException: Object reference not set to an instance of an object.
at 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)
at Microsoft.Silverlight.Build.Tasks.CompileXaml.Execute()
at Bohr.Silverlight.BuildTasks.BohrCompileXaml.Execute()

The code of BohrCompileXaml.Execute is the following:

     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!  

And the definition of the task:

        <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>

What can be the reason? And how can I get more info what’s happening inside CompileXaml class?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T21:19:48+00:00Added an answer on May 14, 2026 at 9:19 pm

    My first guess is that the parameter ReferenceAssemblies is null. ReferenceAssemblies is used to get the XamlSchemaContext in CompileTask.

    To make it work, you have two choice :

    • Set the property SkipLoadingAssembliesInXamlCompiler to true
    • Or pass an assembly path in ReferenceAssemblies property (mscorlib.dll or another silverlight dll)

    The simpler is to set the property SkipLoadingAssembliesInXamlCompiler to true. To do that modify your BohrCompileXaml task like that :

    CompileXaml xamlCompiler = new CompileXaml();
    ...
    xamlCompiler.SkipLoadingAssembliesInXamlCompiler = true;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Visual Studio 2010 updated to the latest version and the MVC3
Why is Deserialize throwing an exception after I updated Visual Studio 2010? EDIT (Question
I am using Visual Studio 2010. I've donwloaded an updated class (i.e. UpdatedClass.cs) which
Visual Studio 2010 RTM randomly crashes when editing XAML in a WPF application. I'm
I have .Net framework v4.0.30319 SP1Rel and visual studio 2010 v 10.0.40219.1 SP1Rel (data
I recently updated Visual Studio 2010 to SP1 and noticed the .NET 4 framework
I'm currently trying to build subversion 1.7.3 with Visual Studio 2010 SP1 on Windows
I'm using Visual Studio Express 2010, with freeglut_static.lib linked (in Properties>Linker>Input>Additional Dependencies, version 2.8.0)
In Visual Studio 2010 you get automatic notifications about extension updates. I don't want
Using C# .net 4.0 and visual studio 2010. I need to update a table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.