Author Topic: VS 2012 Express vs VB 2010 Express  (Read 9018 times)

0 Members and 1 Guest are viewing this topic.

Bill Tillman

  • Guest
VS 2012 Express vs VB 2010 Express
« on: October 01, 2012, 10:18:26 AM »
Has anyone else noticed that you can put the exact same block of VB.NET code in VB 2010 Express and VS 2012 Express and VS 2012 Express will fail to run it.

Code: [Select]
Sub Main()
        Dim vAcadApp As AutoCAD.AcadApplication
        Dim vAcadDoc As AutoCAD.AcadDocument
        vAcadApp = New AutoCAD.AcadApplication
        vAcadApp.Visible = True
        vAcadApp.WindowState = AutoCAD.AcWindowState.acMax

End Sub

In VB 2010 Express, this will open my copy of AC 2013 with the main window maximized. In VS 2012 Express this will create:

Quote
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in ConsoleApplication3.exe

Additional information: Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))

and it's pointing to the Visible=True line. And if I comment out that line it will create the same error on the next line.  Guess I will have to downgrade back to VB 2010 Express.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: VS 2012 Express vs VB 2010 Express
« Reply #1 on: October 01, 2012, 10:20:56 AM »
Stupid question time: have you made *all* the same tweaks to the 2012 install that you've made to the 2010 install over the years?
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Bill Tillman

  • Guest
Re: VS 2012 Express vs VB 2010 Express
« Reply #2 on: October 01, 2012, 10:34:30 AM »
That's a good point...but AFAIK the VB 2010 Express copy I'm running is as-is, out of the box. I did not make any tweaks to it...not yet anyway. I would love to set the text editor's colors to the same as the default one in VS 2012 Express. That dark background with colored letters is not only easier on the eyes, but it looks really cool. Oh yes, I have not made any tweaks to VS 2012 Express either except setting that color for the text editor.
« Last Edit: October 01, 2012, 02:08:43 PM by Bill Tillman »

BlackBox

  • King Gator
  • Posts: 3770
Re: VS 2012 Express vs VB 2010 Express
« Reply #3 on: October 01, 2012, 10:53:23 AM »
Has anyone else noticed that you can put the exact same block of VB.NET code in VB 2010 Express and VS 2012 Express and VS 2012 Express will fail to run it.

When you 'put the exact same block of VB.NET code' into VS 2012 Express, are you opening the 2010 project, or pasting the block of code?

If the latter, are you compiling your new/different 2012 project to the same .NET framework (i.e., 4.0 for 2013)?

Also, since you've installed VS 2012 Express, you now have .NET 4.5 installed... Did you specify AutoCAD 2013's Acad.Exe.Config to use .NET 4.0 (as the newest is used by default, unless specified).

HTH
"How we think determines what we do, and what we do determines what we get."

Bill Tillman

  • Guest
Re: VS 2012 Express vs VB 2010 Express
« Reply #4 on: October 01, 2012, 02:21:01 PM »
It's actually a VS 2012 project. And as I found out just now, you cannot open a VS 2012 Express project using VB 2010 Express. It reports that the project was built with a newer version. Ok so here is the scoop.

I created the project in VS 2012 Express VB.NET module. I then tried to run it but it stopped as described above. I then went to a remote session on the other monitor that I'm running on another computer. Both machines have AC 2013 with SP1.1 installed. The remote machine has VB 2010 Express and my local desktop has VS 2012 Express. On the remote machine I opened a new project and installed the exact same reference for AutoCAD 2013. Then I copied and pasted the code into the project. It ran just fine.

Now the OMG part. On this local desktop I also have VB 2010 Express installed so I tried the exact same setup with it and the program crashed at exactly the same spot. The difference between the machine that this will run on and one it will not...the remote machine where it runs is Windows XPx86 with SP3, this local desktop on which it will not run is Windows 7x64.

I hate to think that Win7 is the problem. I left a PM for you RenderMan on cadtutor describing how this exact code will not work at my home where I also run Win7. I have a laptop running Windows Vista and the code runs fine there too. Ooooh this is getting spooky. But again I'm deep in the debugging part and hope that I'm not being a flake and reporting bad information. AFAIK, what I'm seeing seems to be related to Windows 7. I will keep trying with this but the bosses are starting to lose patience.

Bill Tillman

  • Guest
Re: VS 2012 Express vs VB 2010 Express
« Reply #5 on: October 01, 2012, 03:06:09 PM »
One of the developers who works in the IT dept came by and looked at it. He quickly became deer in the headlights. They are going to set me up with Virtual Machine XP to see if we can get to the bottom of this. I can't believe in this whole place they don't have even one spare computer to use as a test machine but that's where I'm at.

BlackBox

  • King Gator
  • Posts: 3770
Re: VS 2012 Express vs VB 2010 Express
« Reply #6 on: October 01, 2012, 03:24:02 PM »
I left a PM for you RenderMan

... Didn't mean to keep you waiting; work's crazy right now.

I will keep trying with this but the bosses are starting to lose patience.

FWIW -

Unless there's a requirement for .NET 4.5 framework that I am unaware of, skip the non-critical VS 2012 Express upgrade, and use VS 2010, given that your testing shows that it (the 2010 project) works.

Management doesn't care for non-essential upgrades, especially when that pushes back deadline(s).

** Edit - Helk; they don't like it when it's due to critical upgrades for that matter! :lol: LoL
« Last Edit: October 01, 2012, 03:27:04 PM by RenderMan »
"How we think determines what we do, and what we do determines what we get."

Bill Tillman

  • Guest
Re: VS 2012 Express vs VB 2010 Express
« Reply #7 on: October 01, 2012, 03:40:49 PM »
Sorry dude, I forgot to include that fact. I have set VS 2012 Express to work with 4.0 FW. And that is the FW on the other machines as well. In spite of IT trying to set me up with VM...which could take days, I will do some extra cirricular work on this tonight at my home lab. I will have to build myself an XP machine because I've recently thrown out all the old computers which I had running XP. Heck, I don't even have a parallel port anymore because of all the new replacements I've bought. But I still have the license for about 4 or 5 XP installs. I will build an XP machine with both VB 2010 Express and VS 2012 Express. I will use the trial version of AutoCAD to do the testing even though we just cut a PO from this office today to buy another 2013 license from our reseller. At some point this evening I will know if it's a Windows 7 issue or not. I gotta believe there is something else happening but what I saw today was only limited when it was being run on Windows 7.

BlackBox

  • King Gator
  • Posts: 3770
Re: VS 2012 Express vs VB 2010 Express
« Reply #8 on: October 01, 2012, 03:48:04 PM »
Sorry dude, I forgot to include that fact. I have set VS 2012 Express to work with 4.0 FW. And that is the FW on the other machines as well.

No worries; but what about checking this
"How we think determines what we do, and what we do determines what we get."

BlackBox

  • King Gator
  • Posts: 3770
Re: VS 2012 Express vs VB 2010 Express
« Reply #9 on: October 01, 2012, 03:52:05 PM »
Copied from an older OOTB Acad.Exe.Config:

Code - C#: [Select]
  1. <!--<snip>-->
  2.  
  3.   <startup>
  4.     <!--We always use the latest version of the framework installed on the computer. If you
  5. are having problems then explicitly specify .NET 2.0 by uncommenting the following line.
  6.                 <supportedRuntime version="v2.0.50727"/>
  7. -->
  8.   </startup>
  9.  
  10. <!--<snip>-->
  11.  


... Not sure if 2013 still has this behavior or not.
"How we think determines what we do, and what we do determines what we get."

Bill Tillman

  • Guest
Re: VS 2012 Express vs VB 2010 Express
« Reply #10 on: October 01, 2012, 04:22:46 PM »
Thanks...again I still new to a lot of this. In setting the FW for the project should I be using the .NET Framework 4.0 or the .NET Framework 4.0 for Client. I just noticed that the default setting on the VB 2010 Express on the Win7 machine is Client, as is the VB 2010 Express copy of the XP machine.

BlackBox

  • King Gator
  • Posts: 3770
Re: VS 2012 Express vs VB 2010 Express
« Reply #11 on: October 01, 2012, 04:28:11 PM »
FWIW -

I am by _no_ means a .NET expert (still in my piper cub as it happens *Will Tony ever stop changing his avatar?*), but my apps are set to '.NET framework #.#" (no client).
"How we think determines what we do, and what we do determines what we get."

Bill Tillman

  • Guest
Re: VS 2012 Express vs VB 2010 Express
« Reply #12 on: October 01, 2012, 05:23:16 PM »
It does appear to be something with Windows 7 and/or x64 bit CPU's.

http://msdn.microsoft.com/en-us/library/ms228772(v=vs.80).aspx

More to come as I debug this...unless someone would like to step in at this point with a resolution.

BlackBox

  • King Gator
  • Posts: 3770
Re: VS 2012 Express vs VB 2010 Express
« Reply #13 on: October 01, 2012, 07:25:31 PM »
I only skimmed tgat MSDN link... But, last I checked all versions of Autocad were single threaded (even 2013, despite core console), so multi-threading contention should not be an issue.
"How we think determines what we do, and what we do determines what we get."

Bill Tillman

  • Guest
Re: VS 2012 Express vs VB 2010 Express
« Reply #14 on: October 02, 2012, 09:04:36 AM »
That link at MSDN contains what appears to be a very complicated fix for this. And some extensive testing I did last night shows me that in spite of it's nice Window dressing, and that the automation I did with Excel worked bitchin fine, using the new VS 2012 Express, with AutoCAD at least, it is filled with land mines. And even though the supervisors here are all for it, I told them this morning we need to leave well enough alone. So I'm going back to VB 2010 Express and will stay with that platform for the forseeable future. What the heck, all that testing last night gave me something constructive to do while I watched the Cowboys self-destruct and embarass the entire NFL.