-5

I spent more than 10 days searching for a solution which I tried them all.

I have this error message when I add those libraries to my project Libraries: - PresentationCore.dll - PresentationFramework.dll - System.xaml.dll - WindowsBase.dll

Error Message: In Error List:

Object reference not set to an instance of an object.   App1    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\WindowsXaml\v15.0\8.2\Microsoft.Windows.UI.Xaml.Common.targets  266

In output:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\WindowsXaml\v15.0\8.2\Microsoft.Windows.UI.Xaml.Common.targets(266,5): Xaml Internal Error error WMC9999: Object reference not set to an instance of an object.

The Error in this Line (from file name Microsoft.Windows.UI.Xaml.Common.targets)

<CompileXaml
        LanguageSourceExtension="$(DefaultLanguageSourceExtension)"
        Language="$(Language)"
        RootNamespace="$(RootNamespace)"
        XamlPages="@(Page)"
        XamlApplications="@(ApplicationDefinition)"
        PriIndexName="$(PriIndexName)"
        ProjectName="$(MsBuildProjectName)"
        IsPass1="True"
        CodeGenerationControlFlags="$(XamlCodeGenerationControlFlags)"
        ProjectPath="$(MSBuildProjectFullPath)"
        CIncludeDirectories="$(XamlCppIncludeDirectories)"
        OutputPath="$(XamlGeneratedOutputPath)"
        OutputType="$(OutputType)"
        ReferenceAssemblyPaths="@(ReferenceAssemblyPaths)"
        ReferenceAssemblies="@(ReferencePath)"
        ForceSharedStateShutdown="False"
        CompileMode="RealBuildPass1"
        XAMLFingerprint="$(XAMLFingerprint)"
        FingerprintIgnorePaths="$(XAMLFingerprintIgnorePaths)"
        VCInstallDir="$(VCInstallDir)"
        SavedStateFile="$(XamlSavedStateFilePath)"
        SuppressWarnings="$(SuppressXamlWarnings)"
        TargetPlatformMinVersion="$(TargetPlatformMinVersion)"
        WindowsSdkPath="$(WindowsSdkPath)"
         >

I think the error from the libraries so I tired old versions from framework libraries but the same error appears.

I thought I have error in my code. So, I created an empty project. added library. Build, and same error again, So the problem is not from my code since I have no code in empty project.

My search on the internet suggests to updat both Visual studio and windows to the latest version. (I did that)

Error in my code. (it's empty new project)

So I end up with empty hands with most annoying error and no solution worked out for me for the last 10 days.

Visual Studio Community 2017 Libraries from framework V.4.6.2

PLEASE HELP

THANK YOU

Ammar
  • 33
  • 7
  • 1
    Wow, 10 days? Clearly you are not very good at searching. The question as presented does not make much sense. "Object reference not set to an instance of an object" is a standard error message, easily Googleable, with lots of hits. Problem is, you haven't shown us any code that *has* an object reference, so we cannot possibly determine what is causing the error beyond [what that message already tells you](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Cody Gray - on strike Apr 22 '17 at 13:36
  • What does it means "I tired old libraries"? Did you remove them? Did you try to up/downgrade them? Please read [How to Create a Minimal, Complete and Verifiable Example](https://stackoverflow.com/help/mcve). Post more code, maybe a screenshot of the Exception, every useful information that can help other SO users to help you. Also, please avoid uppercase sentences and repeated invocations for help. Every one who posts a question here is looking for help, your question is not more important than others, and will not have more attention just BECAUSE YOU WRITE THIS WAY. – Massimiliano Kraus Apr 22 '17 at 13:45
  • Thank you both for your answer and comments. As I mentioned earlier I created a new project, Added the libraries and build it, same error. I have no code at all. That is the problem. I will Edit the question to show the error in the VS.net file. – Ammar Apr 22 '17 at 17:43

1 Answers1

2

Since no one answered my question and i couldn't find any solution on the internet. I found out the solution which i will post here in case some one need it in the future.

the WindowsBase.dll does not support WPF that is why it required the xaml which will never work.

so if you need delegate.begininvoke you need to find another solution since it needs WindowsBase.dll

my friend suggested to use worker which i am tring ti do now

Ammar
  • 33
  • 7