.NET

Reply
Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 1 of 23 (1,080 Views)

My first .NET code with lots of errors, please need help.

1080 Views, 22 Replies
05-19-2010 05:56 AM
Hi everyone,
I am having a difficult time understanding the errors that the .NET API is giving me. When I run my first code:

'---code--------------------------------------
Imports Autodesk.AutoCAD.Runtime

Public Class vbstudentClass

' Define command 'NewCmd1'
_
Public Sub NewCmd1()
MsgBox("NewCmd1")
' Type your code here

End Sub

End Class
'----Immediate Window--------------------------------------

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='NaN' BindingExpression:smileytongue:ath=Source.MinimumWidth; DataItem='ToolBarControl' (Name=''); target element is 'ToolBarControl' (Name=''); target property is 'MinWidth' (type 'Double')
System.Windows.Data Error: 39 : BindingExpression path error: 'BackgroundOpacity' property not found on 'object' ''ContentPresenter' (Name='PART_CustomizeButtonInMainPanel')'. BindingExpression:smileytongue:ath=BackgroundOpacity; DataItem='ContentPresenter' (Name='PART_CustomizeButtonInMainPanel'); target element is 'SystemDropShadowChrome' (Name='Shdw'); target property is 'Opacity' (type 'Double')
System.Windows.Data Error: 39 : BindingExpression path error: 'Current' property not found on 'object' ''QuickAccessUndoControl' (HashCode=32115247)'. BindingExpression:smileytongue:ath=Current; DataItem='QuickAccessUndoControl' (HashCode=32115247); target element is 'ContentPresenter' (Name=''); target property is 'NoTarget' (type 'Object')
System.Windows.Data Error: 39 : BindingExpression path error: 'Current' property not found on 'object' ''QuickAccessRedoControl' (HashCode=6503226)'. BindingExpression:smileytongue:ath=Current; DataItem='QuickAccessRedoControl' (HashCode=6503226); target element is 'ContentPresenter' (Name=''); target property is 'NoTarget' (type 'Object')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='NaN' BindingExpression:smileytongue:ath=Source.MinimumWidth; DataItem='InfoToolbar' (Name='InfoCenter'); target element is 'InfoToolbar' (Name='InfoCenter'); target property is 'MinWidth' (type 'Double')
System.Windows.Data Error: 39 : BindingExpression path error: 'BackgroundOpacity' property not found on 'object' ''ContentPresenter' (Name='PART_CustomizeButtonInMainPanel')'. BindingExpression:smileytongue:ath=BackgroundOpacity; DataItem='ContentPresenter' (Name='PART_CustomizeButtonInMainPanel'); target element is 'SystemDropShadowChrome' (Name='Shdw'); target property is 'Opacity' (type 'Double')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=mToggleButton'. BindingExpression:smileysad:no path); DataItem=null; target element is 'RibbonItemControl' (Name=''); target property is 'KeyTipPlacementTarget' (type 'UIElement')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=mToggleButton'. BindingExpression:smileysad:no path); DataItem=null; target element is 'RibbonItemControl' (Name=''); target property is 'KeyTipActivationTarget' (type 'UIElement')
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=mText'. BindingExpression:smileysad:no path); DataItem=null; target element is 'RibbonItemControl' (Name=''); target property is 'KeyTipPlacementTarget' (type 'UIElement')
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:smileytongue:ath=BackgroundBorderColor; DataItem=null; target element is 'SolidColorBrush' (HashCode=5425146); target property is 'Color' (type 'Color')


Thank you,

-Jay
*Tony Tanzillo
Message 2 of 23 (1,081 Views)

Re: My first .NET code with lots of errors, please need help.

05-19-2010 09:02 AM in reply to: junoj
In Visual Studio, choose Tools->Options, and in the left
pane of the dialog, select the "Debugging" item.

On the right side, check "Enable Just My Code".


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6393678@discussion.autodesk.com...
Hi everyone,
I am having a difficult time understanding the errors that the .NET API is
giving me. When I run my first code:

'---code--------------------------------------
Imports Autodesk.AutoCAD.Runtime

Public Class vbstudentClass

' Define command 'NewCmd1'
_
Public Sub NewCmd1()
MsgBox("NewCmd1")
' Type your code here

End Sub

End Class
'----Immediate Window--------------------------------------

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid
for target property.; Value='NaN' BindingExpression:smileytongue:ath=Source.MinimumWidth;
DataItem='ToolBarControl' (Name=''); target element is 'ToolBarControl'
(Name=''); target property is 'MinWidth' (type 'Double')
System.Windows.Data Error: 39 : BindingExpression path error:
'BackgroundOpacity' property not found on 'object' ''ContentPresenter'
(Name='PART_CustomizeButtonInMainPanel')'.
BindingExpression:smileytongue:ath=BackgroundOpacity; DataItem='ContentPresenter'
(Name='PART_CustomizeButtonInMainPanel'); target element is
'SystemDropShadowChrome' (Name='Shdw'); target property is 'Opacity' (type
'Double')
System.Windows.Data Error: 39 : BindingExpression path error: 'Current' property
not found on 'object' ''QuickAccessUndoControl' (HashCode=32115247)'.
BindingExpression:smileytongue:ath=Current; DataItem='QuickAccessUndoControl'
(HashCode=32115247); target element is 'ContentPresenter' (Name=''); target
property is 'NoTarget' (type 'Object')
System.Windows.Data Error: 39 : BindingExpression path error: 'Current' property
not found on 'object' ''QuickAccessRedoControl' (HashCode=6503226)'.
BindingExpression:smileytongue:ath=Current; DataItem='QuickAccessRedoControl'
(HashCode=6503226); target element is 'ContentPresenter' (Name=''); target
property is 'NoTarget' (type 'Object')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid
for target property.; Value='NaN' BindingExpression:smileytongue:ath=Source.MinimumWidth;
DataItem='InfoToolbar' (Name='InfoCenter'); target element is 'InfoToolbar'
(Name='InfoCenter'); target property is 'MinWidth' (type 'Double')
System.Windows.Data Error: 39 : BindingExpression path error:
'BackgroundOpacity' property not found on 'object' ''ContentPresenter'
(Name='PART_CustomizeButtonInMainPanel')'.
BindingExpression:smileytongue:ath=BackgroundOpacity; DataItem='ContentPresenter'
(Name='PART_CustomizeButtonInMainPanel'); target element is
'SystemDropShadowChrome' (Name='Shdw'); target property is 'Opacity' (type
'Double')
System.Windows.Data Error: 4 : Cannot find source for binding with reference
'ElementName=mToggleButton'. BindingExpression:smileysad:no path); DataItem=null; target
element is 'RibbonItemControl' (Name=''); target property is
'KeyTipPlacementTarget' (type 'UIElement')
System.Windows.Data Error: 4 : Cannot find source for binding with reference
'ElementName=mToggleButton'. BindingExpression:smileysad:no path); DataItem=null; target
element is 'RibbonItemControl' (Name=''); target property is
'KeyTipActivationTarget' (type 'UIElement')
System.Windows.Data Error: 4 : Cannot find source for binding with reference
'ElementName=mText'. BindingExpression:smileysad:no path); DataItem=null; target element
is 'RibbonItemControl' (Name=''); target property is 'KeyTipPlacementTarget'
(type 'UIElement')
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or
FrameworkContentElement for target element.
BindingExpression:smileytongue:ath=BackgroundBorderColor; DataItem=null; target element is
'SolidColorBrush' (HashCode=5425146); target property is 'Color' (type 'Color')


Thank you,

-Jay
Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 3 of 23 (1,078 Views)

Re: My first .NET code with lots of errors, please need help.

05-19-2010 02:24 PM in reply to: junoj
Hi Tony. Thank you for helping me out again.

I am using the 2008 Express Edition, I can't find the option under the Express Edition. Do you happen to know if I can do the same under the Express Edition.

Thank you,

-Jay
*Tony Tanzillo
Message 4 of 23 (1,079 Views)

Re: My first .NET code with lots of errors, please need help.

05-19-2010 02:31 PM in reply to: junoj
Sorry, I'm not too familar with the Express edition,
but on reflection, this may not be the problem.

In your project properties, select both the acmdg.dll
and acdbmdg.dll references, and set their 'CopyLocal'
property to false.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6394130@discussion.autodesk.com...
Hi Tony. Thank you for helping me out again.

I am using the 2008 Express Edition, I can't find the option under the Express
Edition. Do you happen to know if I can do the same under the Express Edition.

Thank you,

-Jay
Valued Contributor
ViktorCAD
Posts: 60
Registered: ‎06-18-2009
Message 5 of 23 (1,078 Views)

Re: My first .NET code with lots of errors, please need help.

05-19-2010 02:31 PM in reply to: junoj
You having a hard time building your application? or are you getting an error when running the application?

you should be able to see the errors dialog box if you hit CNTRL + E.
Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 6 of 23 (1,078 Views)

Re: My first .NET code with lots of errors, please need help.

05-20-2010 07:05 AM in reply to: junoj
Hi Viktor,

I tried the CNTRL + E, but nothing really happen.

When I run the code, the code opens AutoCAD but i do not get any messages. I get a list of errors, i listed the errors above.

Please help,

Thank you,

-Jay
Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 7 of 23 (1,078 Views)

Re: My first .NET code with lots of errors, please need help.

05-20-2010 11:24 AM in reply to: junoj
Hi Viktor, I got it now. . . . .

I was thinking VBA. I did not realize that I had to load the dll files independently.

Thank you,

-Jay
Distinguished Contributor
Mikko
Posts: 212
Registered: ‎10-03-2003
Message 8 of 23 (1,078 Views)

Re: My first .NET code with lots of errors, please need help.

05-20-2010 01:06 PM in reply to: junoj

This may or may not apply to you but I thought just in case you never heard of this program, that I'd supply a link to Dreamspark, https://www.dreamspark.com/default.aspx which has all the Microsoft tools you'll need {color:#0000ff}FREE{color}. All you need be is in High School or College and have a school supplied email address with the extension .edu. If your school is not on the list there is information as to how to get the software on the site. Nothing wrong with the express versions, but here is a chance to get even more if your eligible.

Distinguished Contributor
junoj
Posts: 116
Registered: ‎02-26-2009
Message 9 of 23 (1,078 Views)

Re: My first .NET code with lots of errors, please need help.

05-20-2010 04:28 PM in reply to: junoj
That is grate Mikko. I will defiantly give it a try. I am not sure how much I will gain from upgrading to Pro vs. Express. Perhaps someone can give us some inside on which VB.net API is the best for AutoCAD programming, and why.

Thank you,

-Jay
Mentor
mfernandes
Posts: 204
Registered: ‎08-21-2007
Message 10 of 23 (614 Views)

Re: My first .NET code with lots of errors, please need help.

02-15-2012 11:39 PM in reply to: junoj

 any solution to this issue yet!!!

 

I am using VS Express 2010, Win 7-32, and Map3D 2012 and getting the same errors.

Cannot ignore the errors as it takes considerable amount of time for all the errors before I can actually start working.

 

Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.