Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Recommended Posts

How can one build , in VS2012 Pro (using Desktop) a project that will run on a box without MasterCam 7 installed, only V6? We upgraded from VS2010 to VS2012, and it seems it -forces- you to compile .NET 4.0 apps, and then gives you warnings that you are targeting a .NET 3 app. (nethook 2.0)

Link to comment
Share on other sites

Visual Studio 2012

 

For .NET projects it will default to the v4.0 framework.

For Mastercam X6 this will not work. (as you've found out)

You just need to reset the "Target Framework” in your Project to one earlier than v4.0 (v3.5, v2.0)

Select the Project-Properties and on the Application and set the “Target framework”.

 

 

For CHook projects, you can use Visual Studio 2012 “as your IDE, but the X6/X7 the project must be compiled using the “V100” Toolset from Visual Studio 2010.

Select the Project-Properties and under Configuration Properties, on the General page make sure that the "Platform toolset" is set to ->

Visual Studio 2010 (V100).

Link to comment
Share on other sites

Aye, did that, and tried much more .. still no luck ...

 

 

Changed the target net frame work to 3.5, removed the reference to X7\netHook 3.0, added the reference to X6\NetHook 2.0, (v 15.0.4.13972) changed the path/startup app references to x6, did a clean/rebuild, save, shut down, restart, and the errors just piled up.

 

First error: The primary reference "NETHook2_0" could not be resolved because it was built against the ".NETFramework,Version=v4.0" framework.

 

Second and more errors : The primary reference "NETHook2_0" could not be resolved because it has an indirect dependency on the framework assembly [add .Net assembly name here], Version=4.0.0.0, which could not be resolved in the currently targeted framework. To resolve this problem, either remove the reference "NETHook2_0" or retarget your application to a framework version which contains [add .Net assembly name here], Version=4.0.0.0,

 

 

Checked the .sln, .vbproj, and vbproj.user files in notepad; there is no reference to NetHook3, or Mcx7.

 

 

and if I look in the object browser, NetHook3, and ONLY nethook 3, is referenced.... no nethook 2...

Link to comment
Share on other sites

Update: I was able to import/set project properties for MasterCam X5 rather easily. The one warning I received I was able to dismiss by setting the target to X86.

 

X6, however, still remains a problem. I imported the now working X5 template, and attempted to switch it over to v6, and no matter what I did from the IDE, manually browse to the X6 folder, or select it from the 'recent' list, or purging the recent list, or pasting the full filespec in the browse window, it still added the X5 reference!

 

I shut down VS and edited the project files manually. When I opened the project back up, i got all those piles of errors again, like yesterday, and while the references section DID say I was using the NetHook2 dll in the mcam6 directory, the object browser showed the NetHook 3 dll in the mcx7 directory!

 

I also tried re-downloading the original project template for X6. Same results, same pile of errors, and same NetHook 3 dll showing in object browser.

 

Just a thought ... could this be due to the fact that the X6 nethook dll does NOT show version information ?

Link to comment
Share on other sites

Create a new NETHook project, delete the NETHook3_0.dll reference and add the X6 NETHook2_0.dll reference then update the class implementation from Nethook3App to Nethook2App and re-build, that is all you should need to do. I just created a new NEThook this way and it runs in X6 just fine.

 

Just did that. Got no errors, the nethook 2 reference shows .... and NetHook 3 is in the object browser (I checked, and the new features are there) :/

 

Ooops - forgot to reference .Net 3.5 - now I have all the errors :/

Link to comment
Share on other sites

Just tried adding the Nethook2.dll that is in the Mcx7 folder .... and it works :)

 

[Edit ].... or not. As soon as I go to launch what is an effectively empty project, nethook 2 disappears from the object browser as part of my project, but remains in the "references" list. and the reference to Mastercam.app now gives an error. it also says that my output path is not specified, but i can see it is

Link to comment
Share on other sites

Just did that. Got no errors, the nethook 2 reference shows .... and NetHook 3 is in the object browser (I checked, and the new features are there) :/

 

Ooops - forgot to reference .Net 3.5 - now I have all the errors :/

 

You do not need to make any changes to the project .NET library references, NETHook2_0.dll located in your X6 folder is built against 4.0. If you follow the steps I posted earlier it works as expected.

 

As I stated earlier:

 

1. Create a new VS2012 NETHook project using the Mastercam NETHook project template.

2. Delete the NETHook3_0.dll project reference.

3. Add a new reference, browse to your X6 folder and select the NETHook2_0.dll

4. Replace the Nethook3App implementation of your class to Nethook2App

5. Save project, clean and build.

6. Done.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...