question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WPF App Build Error

See original GitHub issue

Apologies if I have missed a solution somewhere. I have searched through the current issue library and help docs.

I am experiencing a problem when building a WPF App project in VS2017. I have tried this on Windows 7 and Windows 10. I install VS2017 community edition, create a new 4.6.2 WPF App project and then add Realm from NuGet.

After this the project will not build. I get the following error:

Severity Code Description Project File Line Suppression State Error Unknown build error, ‘Binary format of the specified custom attribute was invalid.’

I am new to realm and I appreciate that this might be specific to my configuration so any pointers or things to check for would be beneficial.

I have also tried updating all packages that can be updated via NuGet and still experience the error.

Does anyone have any ideas?

Goals

Build a simple WPF App in VS2017 using Realm from NuGet

Expected Results

Build Succeeded

Actual Results

Severity Code Description Project File Line Suppression State Error Unknown build error, ‘Binary format of the specified custom attribute was invalid.’

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(268,9): error MC1000: Unknown build error, ‘Binary format of the specified custom attribute was invalid.’

Steps to Reproduce

  1. Open VS2017
  2. Create ‘WPF App’ Project (Target 4.6.2 - Does the same for 4.7 & 4.7.1 etc.)
  3. Add Realm from NuGet - wait for install to complete
  4. Build project - This is where I get the error

Code Sample

Version of Realm and Tooling

  • Realm Object Server Version: N/A
  • Flavor:
    • Developer
    • Professional
    • Enterprise
  • Server OS & Version: N/A
  • Client SDK Version: Realm 2.1
  • Client OS & Version: Windows 10 Pro (1709 - 16299.248)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Martynnwcommented, Apr 23, 2018

Just to add my team has run into the same issue which manifested when we tried to build a nuget package for a project using Realms 3.0.

When packaging nuget makes a call to CustomAttributeData.GetCustomAttributes which fails silently due to the ‘Binary format of the specified custom attribute was invalid.’ exception. Nuget.exe returns

Authors is required.
Description is required.

For now we will have to downgrade to Realms 2.0, being able to package our libraries is essential.

0reactions
tuyen-vuduccommented, Jul 14, 2018

I created another issue for this (#1758)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding a resource to WPF application causes build error
I'm working through the book Head First C# and consistently have issues when adding resources to a window. This is a 100% repeatable...
Read more >
VS 2019 fails to build WPF projects
I have a compile error when running unit tests against a WPF project. ... WPF app}\obj\Debug{subpath}{XAML file}.g.cs' could not be found.
Read more >
WPF .NET application breaks with error Could not load file ...
Hello, I have a C# WPF .NET application that uses a 3rd party SDK called PaymentSDK.dll which I include and reference inside the...
Read more >
Updating to 16.4 from 16.3.x causes build issues with WPF ...
When building a WPF project the following error is shown, this built fine in the last 16.3.x version that was released.
Read more >
Unable to Build WPF Application
I am trying to build a WPF application and keep getting the following error: [MSB4062] The "TransformXml" task could not be loaded from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found