.NET

Reply
Distinguished Contributor
SRSDS
Posts: 243
Registered: ‎04-15-2011
Message 1 of 6 (360 Views)

User Controls.resx - Object reference not set to an instance of an object

360 Views, 5 Replies
04-08-2012 02:29 PM

Hi,

 

I've just changed a VS compile options to use .NET Framework 3.5 (previously Framework 4).

My user controls that I've added as containers for the pallette don't seem to agree with it and I get a "Object reference not set to an instance of an object" error on each of their resx files. And one on Resources.resx.

 

Attached is a screenshot.

Is there anything I can do to fix this?

Distinguished Contributor
SRSDS
Posts: 243
Registered: ‎04-15-2011
Message 2 of 6 (329 Views)

Re: User Controls.resx - Object reference not set to an instance of an object

04-12-2012 04:06 AM in reply to: SRSDS

One suggestion I have found was to search and replace  "4.0.0.0" with "2.0.0.0".

After doing this the application loads but now none of my CommandMethods are working. 

 

<CommandMethod("DRR", CommandFlags.UsePickSet Or CommandFlags.Redraw Or CommandFlags.Modal)>

Sub DRR()

*Expert Elite*
Alfred.NESWADBA
Posts: 8,880
Registered: ‎06-29-2007
Message 3 of 6 (322 Views)

Re: User Controls.resx - Object reference not set to an instance of an object

04-12-2012 04:12 AM in reply to: SRSDS

Hi,

 

on what release of AutoCAD are you working currently?

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Distinguished Contributor
SRSDS
Posts: 243
Registered: ‎04-15-2011
Message 4 of 6 (318 Views)

Re: User Controls.resx - Object reference not set to an instance of an object

04-12-2012 06:59 AM in reply to: Alfred.NESWADBA

Hi Alfred,

 

I'm a bit confused about what's going on here and am just stumbling around.

 

I was trying to get 2012 working. It was loading but commands weren't working.

I've just tried 2011where the commands are working but the debugger isn't.

 

.NETFramework v4.0 doesn't seem to work for 2011. It used to but I reformated my computer and it doesn't anymore.

 And maybe I should be using 3.5 anyway?

*Expert Elite*
Alfred.NESWADBA
Posts: 8,880
Registered: ‎06-29-2007
Message 5 of 6 (314 Views)

Re: User Controls.resx - Object reference not set to an instance of an object

04-12-2012 07:12 AM in reply to: SRSDS

Hi,

 

>> I was trying to get 2012 working

That needs Framework 4.0, so to step back to 3.5 would be the wrong decission (for AutoCAD 2012)

 

>> I've just tried 2011where the commands are working but the debugger isn't.

Now you should be carefull to not mix up your projects.

 

There is a workaround for how Framework 3.5 based projects work with 2012 and also get debugging to work (look at the "Through the Interface"-site by Kean Walmsley).

 

For me the best solution is to have a project for 2011, using Framework 3.5 and another project for 2012 using Framework 4.

Both projects can point to the same source-files but uses different references and project settings.

 

What I can't reproduce at the moment (because of limited time): if you created a project with 4.0 including creation of forms or user-controls (therefor using resx-files, I think) ...if these projects are working when you save them back to an older Framework as the controls you used before came from Framework 4. That may be a problematic situation.

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Distinguished Contributor
SRSDS
Posts: 243
Registered: ‎04-15-2011
Message 6 of 6 (296 Views)

Re: User Controls.resx - Object reference not set to an instance of an object

04-15-2012 05:05 AM in reply to: Alfred.NESWADBA

Thanks Alfred,

That explains things. I think for now I will stay with 2012 and will try to tackle earlier versions if the need arises.

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community