Notifications
Clear all

[Closed] C# Issue with 64 bit Max 2010

Hi everyone,

I’m trying to create a DLL using C# for 3DS Max 2010 64bit.

I keep getting this same error:

-- Error occurred in anonymous codeblock; filename: C:\Users\Zachary\Documents\MaxScripts\; position: 0
-- Runtime error: dotNet runtime exception: Invalid directory on URL.

It appears as though this is a common problem on 64 bit machines, but I can’t seem to get the C# compile options correct to make it work.

Is there something I’m missing? The only advice I’ve found on the ‘net is to set the compile options for “All Platforms”, which I have tried, but I have had no success with this.

Has anyone successfully compiled a C# DLL for 64bit Max?

If you have, how did you do it?

5 Replies

I have had no problems with using C# Dlls in max both from Visual Studio 2008 and VS Express 2008.

you load a dll by using

dotnet.loadAssembly @"C:\my folder\myAssembly.dll"

and then instance a class using

dotnetobject "MyNamespace.MyClassName"

where are you having problems exactly?

I am having a problem when I try to load the assembly.

The assembly fails to load properly, giving the error I mentioned in my original post.

It is a problem, I think, in the creation of the DLL file.

I’m using Express 2010. Do you suppose that could be the source of the problem?

check the target framework in the project properties. if you have it set to .NET 4.0(which I think would be the default in VS 2010) then that’s most likely your problem because max 2010 only supports up to .NET 3.5

Yes!

That is it!

Ok. Good to know that.

Apparently Visuals Studio 2010 defaults to dotNet 4.0.

Thanks very much Gravey. This will save me a lot of time.

Thanks to James Haywoods blog, I have a v4 assembly loaded in max 2010 x64 –
http://apps.jhaywood.com/Blog/?c=max&p=1