Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown build error, 'Object reference not set to an instance of an object.' #2173

Closed
nightwolf13 opened this issue Apr 11, 2018 · 3 comments
Assignees
Milestone

Comments

@nightwolf13
Copy link

Environment data

dotnet --info output:
.NET Command Line Tools (2.1.103)

Product Information:
Version: 2.1.103
Commit SHA-1 hash: 60218cecb5

Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.103\

Microsoft .NET Core Shared Framework Host

Version : 2.0.6
Build : 74b1c703813c8910df5b96f304b0f2b78cdf194d

VS Code version: 1.22.1
C# Extension version: 1.14.0

Steps to reproduce

Simply load project and tries to build.

Expected behavior

Project loaded and built

Actual behavior

Everytime i'm opening any project on my machine i got next warning in omnisharp log:
[warn]: OmniSharp.MSBuild.ProjectLoader
Unknown build error, 'Object reference not set to an instance of an object.'
c:\MyProjects\C#\UIInvestigations\UIInvestigations\UIInvestigations.csproj

I have visual studio 2015 installed on my machine also.. But don't have VS 2017.. When omnisharp is initialized there is also error about not found Microsoft.VisualStudio.Configuration.Native.dll.
When i trying to build my projects all WPF views has build error "InitializeComponent() not found".

@DustinCampbell
Copy link
Member

This is something I've seen specifically with XAML-based projects. I believe the issue is due to some internal failure in the XAML markup compiler task when it tries to create a separate AppDomain to run the markup compiler within. I'll continue investigating to see if I can come up with a reasonable solution.

@hickford
Copy link

Some projects have trouble loading. Please review the output for more details.

OmniSharp.MSBuild.ProjectLoader
Unknown build error, 'Object reference not set to an instance of an object.'

I've also seen this error with xaml projects. Look forward to fix in next release.

@smitpatelx
Copy link

Error: IOException Cannot locate resource

Most of the time this error occur when using visual studio form applications.

To solve this error you can go to your App.xaml file and edit SratupUri to your current xaml form name.

<Application x:Class="AppName.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
    </Application.Resources>
</Application>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants