Author Topic: Overkill Command  (Read 16961 times)

0 Members and 1 Guest are viewing this topic.

TheMaster

  • Guest
Re: Overkill Command
« Reply #15 on: May 01, 2013, 11:11:34 PM »
Quote

It will build for me and maybe go to project properties and uncheck it from imported namespaces and see if using a importing statement helps or maybe load up the project.
 
You might have to do a repair on framework.
http://msdn.microsoft.com/en-us/library/8f0k13d2.aspx
 
You could also look at results from Gacutil.exe to help find problems

Hi Jeff,

Thanks for the suggestions, if you look at the code I posted I did try to fully qualify the name but still getting the ambiguous error.

System.Func should be the fully qualified name right?

Do you think there could be an issue with the .NET 4.0 framework installed on my machine since I created an empty project and it still won't compile?

Edit:
I tried to also create a C# project using the AutoCAD wizard then created a class using Tony's example. Still getting the same error.

Edit:
Looking at the error message close it looks like there is a reference to a file in the AutoDesk folder to System.Core.DLL. What is this, do I need it?

Do you know if it was installed with the software?  If so, then that's definitely a problem.

System.Core.dll should not be anywhere except in your .NET framework distribution folder. That's not a file that should be deployed with any application that uses it.

Try renaming it, and then starting AutoCAD and see if there's a problem. Also have a look at acad.exe.config to see what redirects there are if any.

If Autodesk distributed that file with the software, that's a major screw-up.

TJK44

  • Guest
Re: Overkill Command
« Reply #16 on: May 02, 2013, 08:12:31 AM »
This is weird, when I rename the System.Core.dll file in C:\Program Files\Autodesk\AutoCAD Mechanical 2012 and then start AutoCAD it regenerates this file. On starting also says please wait while windows configures AutoCAD each time this file is not present. I tried resetting Settings to Default then renaming this file but same behavior.

I also opened acad.exe.config in notepad and searched for System.Core, nowhere to be found.

Edit: It seems like this file is getting referenced when using AutoCADs wizard. If I create an empty Class Library and reference the AutoCAD dlls then create Tony's Editor Extension Method class I don't get these errors. Not sure if there would be a way to fix an older project to not reference this System.Core file in the AutoCAD install folder. I cannot find the reference to this dll anywhere in the project.
« Last Edit: May 02, 2013, 08:37:17 AM by TJK44 »

TheMaster

  • Guest
Re: Overkill Command
« Reply #17 on: May 02, 2013, 11:08:53 AM »
This is weird, when I rename the System.Core.dll file in C:\Program Files\Autodesk\AutoCAD Mechanical 2012 and then start AutoCAD it regenerates this file. On starting also says please wait while windows configures AutoCAD each time this file is not present. I tried resetting Settings to Default then renaming this file but same behavior.

I also opened acad.exe.config in notepad and searched for System.Core, nowhere to be found.

Edit: It seems like this file is getting referenced when using AutoCADs wizard. If I create an empty Class Library and reference the AutoCAD dlls then create Tony's Editor Extension Method class I don't get these errors. Not sure if there would be a way to fix an older project to not reference this System.Core file in the AutoCAD install folder. I cannot find the reference to this dll anywhere in the project.

In that case, Autodesk is installing System.Core.dll, but I can't fathom why they would do that, and install it into the application folder.  That makes no sense at all.

The reference is most-likely indirect. IOW, one of the AutoCAD assemblies that you're referencing is referencing it.

TJK44

  • Guest
Re: Overkill Command
« Reply #18 on: May 02, 2013, 02:25:56 PM »
Does anyone else who has an install of AutoCAD 2012 see the same behavior?

TheMaster

  • Guest
Re: Overkill Command
« Reply #19 on: May 02, 2013, 03:14:56 PM »
Does anyone else who has an install of AutoCAD 2012 see the same behavior?

i just looked and noticed that it's installed in my AutoCAD 2012 folder too, and the version of the assembly is 3.5. What framework release is your project targeting, and is it installed into the same folder as Acad.exe ?

TJK44

  • Guest
Re: Overkill Command
« Reply #20 on: May 02, 2013, 04:18:03 PM »
Thanks Tony,

My project is targeting .NET 4.0.

What are you asking is installed into my acad folder?

TheMaster

  • Guest
Re: Overkill Command
« Reply #21 on: May 02, 2013, 04:20:55 PM »
Thanks Tony,

My project is targeting .NET 4.0.

What are you asking is installed into my acad folder?

Is your project's assembly installed in the same folder as Acad.exe/System.Core.dll is what I mean by the last question.

TJK44

  • Guest
Re: Overkill Command
« Reply #22 on: May 02, 2013, 10:23:34 PM »
No it is not. The project is not located locally on my machine, it is located on a server.

TheMaster

  • Guest
Re: Overkill Command
« Reply #23 on: May 03, 2013, 12:47:27 AM »
No it is not. The project is not located locally on my machine, it is located on a server.

Have you tried running your app from the local system, and if so, is the result the same?

TJK44

  • Guest
Re: Overkill Command
« Reply #24 on: May 03, 2013, 08:16:21 AM »
Quote
Have you tried running your app from the local system, and if so, is the result the same?

I copied the project folder locally and same result when open in VS

It seems like it is the wizard that is referencing the System.Core dll from the AutoCAD folder because if I create a new project and reference the AutoCAD dlls (AcDbMgd and AcMgd) manually I didn't have the same issue of ambiguity. But if I use the wizard I see this issue.

At this point I just want to not reference the System.Core dll from the AutoCAD folder because I shouldn't even need a reference to it and I don't want to have to recreate the project because I have a lot of forms I would need to recreate and code to make sure is correct again.

This is starting to get frustrating because I can't find the reference anywhere and I don't see why it would be referenced in the first place with the wizard?
« Last Edit: May 03, 2013, 08:21:25 AM by TJK44 »

TheMaster

  • Guest
Re: Overkill Command
« Reply #25 on: May 03, 2013, 05:09:36 PM »
Quote
Have you tried running your app from the local system, and if so, is the result the same?

I copied the project folder locally and same result when open in VS

It seems like it is the wizard that is referencing the System.Core dll from the AutoCAD folder because if I create a new project and reference the AutoCAD dlls (AcDbMgd and AcMgd) manually I didn't have the same issue of ambiguity. But if I use the wizard I see this issue.

At this point I just want to not reference the System.Core dll from the AutoCAD folder because I shouldn't even need a reference to it and I don't want to have to recreate the project because I have a lot of forms I would need to recreate and code to make sure is correct again.

This is starting to get frustrating because I can't find the reference anywhere and I don't see why it would be referenced in the first place with the wizard?

I don't use the wizard so I can't tell you much about what it is doing, but my guess is that the reference is indirect (IOW, one of the Autodesk assemblies referenced by your project references the file in the AutoCAD folder).

And, it is probably not AcMgd or AcDbMgd, it is most-likely one of the assemblies that is dependent on WPF (like AdWindows.dll), so unless you referenced all of the assemblies that are referenced in the problem solution, you might not see it.

[Update]

Here is something that may be worth a try: If your project contains references to any assemblies located in the AutoCAD program folder (and are not in the SDK folder), try copying those assemblies to the SDK folder, and reference them from there (CopyLocal=false). Because System.Core.dll is not in the SDK folder, the Autodesk assemblies that are referencing it should use the same one that you're referencing.

« Last Edit: May 04, 2013, 04:04:03 PM by TT »

TJK44

  • Guest
Re: Overkill Command
« Reply #26 on: May 06, 2013, 10:22:28 AM »
Hi Tony,

Thanks for your time.

I copied AcDbMgd, AcMgd, and AdWindows to the separate folder, deleted the references created by the wizard and the reference the dlls in the other folder. Same situation arises. It seems like there is no way around this if using AutoCAD's wizard.

MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Overkill Command
« Reply #27 on: May 06, 2013, 01:43:20 PM »
At the risk of sounding like Captain Obvious,  don't use the wizard.

I never liked their wizard.  I used AcadNetAddinWizard for a while too.  Now I just created a basic template for AutoCAD and another one for AutoCAD MEP and I just use those to start with.  That along with some basic snippets on my tool bar and I never seem to need to use the wizard anymore.
Revit 2019, AMEP 2019 64bit Win 10

TJK44

  • Guest
Re: Overkill Command
« Reply #28 on: May 06, 2013, 01:51:53 PM »
I'm not going to use the wizard anymore, but this VS studio project was one of my earlier ones so I used Autodesk's wizard. I really don't want to have to recreate the entire project if it's not necessary.

TheMaster

  • Guest
Re: Overkill Command
« Reply #29 on: May 06, 2013, 08:13:21 PM »
I'm not going to use the wizard anymore, but this VS studio project was one of my earlier ones so I used Autodesk's wizard. I really don't want to have to recreate the entire project if it's not necessary.

I've used project templates right from the outset, and have never used their Wizard.

I have different project templates for different project types, some include WinForms or WPF or both, and others include some of my own libraries assemblies.

There isn't much the Wizard does except set a few properties (like native debugging, and it even asks you if you want it on x64, which isn't supported).

The wizard may be ok for a complete noob, but most the experience, it is like tits on a bull.