4

I'm trying to develop an application in powerbuilder .net 12.5. However I keep getting the following compilation error.

Unknown build error, 'Method 'get_Command' in type 'System.Windows.Controls.Button' 
from     assembly 'PresentationFramework, Version=4.0.0.0, Culture=neutral,    
PublicKeyToken=31bf3856ad364e35' does not have an implementation. Line 3 Position 4.' 

The app is very simple. It's a single wpf window with a button that show a messagebox. I have had this error in different test applications but I can't see what is causing the problem.

I have found other people on the web with the same problem but they all seem to use .net 4.5. and windows 8. There it seems that the compiler uses the wrong .net version. However I don't have .net 4.5

If anybody could point me in the right direction that would be great

EDIT:

I have found some extra information. I have two targets in my solution. A .net assembly target and a wpf target. Everything works fine until I add a reference in my wpf target to my .net assembly target. Then this error occurs. Removing the assembly from the reference list doesn't solve the problem

Blackcom
  • 146
  • 6

1 Answers1

2

I found a solution. When You reference a DLL in a powerbuilder target then it changes the presentationcore.dll reference to the one in the gac. This dll is not the right version (at least not on my pc.) By editing the project with notepad(++) I changed the path to the original presentationcore.dll and now it's compiling again.

Blackcom
  • 146
  • 6
  • Could you indicate what the target file looked like after your mods? A lot of people are encountering this issue. – Bruce Armstrong Feb 22 '13 at 03:48
  • thanks, the key word which helped was GAC, except in my case GAC had newer version while .NET 4.5 folder had older DLL which did not have that method I guess. So I made it use the DLL from GAC for now and it worked (by renaming the other one). GAC DLL version is 4.0.30319.18408. .NET 4.5 folder DLL version is 4.0.30319.18020. Maybe installing newer version of 4.5 could fix this, I did not try yet. – serop Oct 16 '15 at 15:42