Notifications
Clear all

[Closed] Example C#/C++ .net assembly for use in max9?

Hello,

I’m trying to use the new .net features of max. Still figuring things out. I’m trying to create a custom C# or C++ assembly, ship it to a customer and allow them to load it up and use the functionality. I’m wondering if anyone has created custom C++/C# that they load up via dotnet.LoadAssembly and then use in maxscript?

Things that are unclear to me:

  1. What kind of project do I create in visual studio .net? there are about 20 dot net project types! Our language is C++, but ANY information C#, VB, etc, is helpful
  2. Any special steps required to use the library?

It’s a broad question Sorry. I’m hoping someone else out there has already done this.

Any advice?
Thanks
Mark

5 Replies

Hi,

I did it before with C#. Select a Class library project which will compile in to a dll. Then you can load it in max.

If you want to place the dll in to your GAC you need to sign it with a strong name. But you can load it from any location like…

myAssembly = dotNetClass “System.Reflection.Assembly”
myVar = assembly.loadfrom “myPath\myProject.dll”

change myPath and myProject name to your dll location and dll name

Hi susanta,
Thanks. That tells me just about everything… one more… Did you use Visual Studio 2005 or 2003? I’m trying to figure out if it will work with “Class Libraries” from 2003 (.net 1.1 I think) versus Visual Studio 2005, (.net 2.0)

appreciate your help! Thank you

Mark

1 Reply
(@ypuech)
Joined: 11 months ago

Posts: 0

Hi mzartler,

It’s not recommended because some .NET 1.1 methods, classes etc. are deprecated in .NET 2.0. And maybe these class libraries could not be loaded and used correctly. So, if you want to use class libraries from 1.1 you need to compile them with .NET 2.0 (remember the compiler is free!).

I’ve developed a small utility plugin that uses .NET Framework 2.0 with C++/CLI ; it’s pretty cool and easy to develop : http://ypuechweb.free.fr/dot_net_test.html

In my work area I’m using visual studio 2005 team system…but in my home I’m using free visual studio express edition (It has almost all features, but some futures of commercial editions are missing, which are helpful to handle complex project and team environment). But express editions are good enough to do personal work. You can download it from Microsoft website.

I’m not sure…if the system has .net framework v2.0 SDK installed then I think it also will be possible to load manually all v 2.0 assemblies in visual studio 2003 project reference folder. I suggest you double check MSDN.

Are you guys using recent framework v 3.0? As per MSDN, it is a using v 2.0 but with some other additional class library. If you are installing it and you already have v 2.0 then it only install those additional libraries. So the projects made with v 2.0 need no change to work with v 3.0. But I’m yet not start to work with it.

Are you guys using recent framework v 3.0? As per MSDN, it is a using v 2.0 but with some other additional class library. If you are installing it and you already have v 2.0 then it only install those additional libraries. So the projects made with v 2.0 need no change to work with v 3.0. But I’m yet not start to work with it.

Not yet using it but thanks for the information. Yes, .NET 3.0 is cool, especially WPF. I’ll install .NET Framework 3.0!