AddIn Help!

Hi,

 

I've been running into a bunch of issues while trying to build a SolidEdge AddIn and am wondering if anyone has any words of wisdom (or even words of average intelligence) for me.

 

I am trying to build a SolidEdge AddIn with the following configuration:

 

Visual Studio 2010 Professional (using C# as the language of choice)

SolidEdge ST2 64 bit

Windows 7 Professional

 

I've built a shell of an AddIn following the instructions on the GTAC site. I've had to do the following:

 

1. Change my target to x64.

2. By doing step 1, I run into an issue where I am using the wrong version of regasm. Some searches on the internet has pointed my to turning off the COM interop option in the build tab of the project properties and adding the proper call to the proper regasm in the post build events.

3. By doing step 2, I find that I get the following errors:

 

Failed to load '....\xxxxxx.dll' because it is not a valid .NET assembly

 

and

 

The command ""C:\Windows\Microsoft.NET\Framework64\v2.0.50727\regasm" "....\xxxx.dll"" exited with code 100.

 

4. Some dubiously named helpful hints from the internet pointed my in the direction of .NET version compliance, but changing this option in the build tab of the property pages in my project, gives other errors.

 

So, ultimately, I am wondering if anyone has successfully built an AddIn given the specs I mentioned above and if so, could you point in the write direction with project properties/settings/magic dust/secret incantations.

 

Thanks,

 

Brian

 

Posted by: Brian Mansfield
Post date: 10/16/2010 2:40:38 PM

2 REPLIES

RE: AddIn Help!

Brian,

 

I have not done any addin work in awhile so I'm guessing here.  What I am unsure of is if we can build our .NET addins using the 3.5\4.0 framework or do we still need to build for v2.0.  Edge.exe.config has supportedRuntime version still set to v2.0.50727 in ST3.  That dictates which version of the CLR gets used in the host process.  Until I test more on my own and talk with Solid Edge development, I can't know for sure.

 

As a test though, I would suggest you change your project settings to build using 2.0.

 

 

 

I checked on my machine and I have 4 different versions of regasm.exe.  It makes no sense to me why you would have to configure this as a post-build event but like I said, I haven't messed with any of this in a long time.  If you do need to manually specify the path, you have to make sure you're using the right version.

 

 

 

 

Posted by: Jason Newell
Post date: 10/20/2010 2:38:01 AM

RE: AddIn Help!

You need to make sure you use the regasm tool that is the same version as your DLL. MS seems to keep changing the format of the DLL file making it necessary to use the correct version of the tool. Also as you noted, MS runs the 32 bit version of regasm for 64 bit targets causing the build error you see if you have the "register for com interop" checked on a 64 bit build! MS knows about this and has known for quite some time. I create a bat file that pushes the correct env before invoking regasm and use it to register. I created the bat file by coping the "Visual studio x64 command prompt" icon to my desktop and then right-clicking and looking at the properties. That showed me where their bat file was and I opened it and copied the first few lines into my bat file. Those lines "push" the proper environment, including the amd64 setting so the 64 bit framework regasm tool is used.

 

Also, the edge.exe.config file merely informs the OS as to the minimum version of the .net runtime edge needs. MS policy files should result in a later version being loaded. That is, MS will try to load the latest runtime available on a machine and there should be no issue with running a 3.5 add-in inside Edge. In any case, that would not interfere with registering an add-in.

 

Posted by: R.D. Holland
Post date: 11/12/2010 3:20:19 AM