.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Deployment of the dll (framework version 2.0)

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
330 Views, 5 Replies

Deployment of the dll (framework version 2.0)

Help! Please!
The dll I have compiled (framework bersion 2.0) uses both file and sql database functionality. On my workstation I have the SDK with includes a framework version 2.0 version of mscorcfg.msc - so it was simple to set security permissions for the compiled dll on my workstation. But I dont really want to install Visual Studio on the user workstations just to be able to distribute the programs I develop for Acad. Without applying mscorcfg.msc the other users just hit exception security permission errors. I tried using CASPOL. Caspol informed me that the assembly doesnt have a strong name. Then I tried to apply a strong name in the assembly without success - hit another error when trying to compile - error: referenced acad managed object doesnt have a strong name!
What's the solution (please)?
Thanks,
Kevin.
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: Anonymous

I assume you want your users to load your .NET code from outside of running
computer, for example, a network share (if the dll is loaded locally, you
wouldn't get the security exception).

Yes, .NET2.0 does not have User-friendly .NET Configuration applet any more
(.NET1.x does), you need to use CASPOL.exe to configure .NET security for a
computer. However, you do not have to sign your assembly a strong name in
order to allow .NET code being loaded from a network share.

Here is what I do when I want to have my .NET code being loaded from a
network share rather than being installed on each computer (if the .NET app
is complicated, such as a full scale desktop app, I'd always install it
locally):

1. Create a network share, give all users read/execute permission. Only
dedicated user (myself/net admin) has write permission;
2. Place .NET code (DLLs, EXEs) into taht folder (or its subfolders);
3. Create a Code Group, pointing to this network folder and give full trust
(or other level of trust of your choice). This is done with .NET
Configuration Applet (1.x or 2.0 if you have .NET SDK installed) or
CASPOL.exe (2.0).

Here is the simple BAT command that run CASPOL.exe for this setup:

C:\Windows\Microsoft.net\framework\v2.0.50727\caspol -machine -addgroup
All_Code -url file://serverName/DotNETCodeFolder/* FullTrust -name
MY_DOTNET_Code_Group -description "AutoCAD ObjectARX NET2.0 Applications"

So, on each computer, you simply double-click the *.bat file. The code group
will be created. From then on, whenever you have some .NET code that you'd
like being loaded by user from a central location, simply drop it into that
network folder. Since you/the admin is the only one to write file to that
folder, all code there is trusted (by you), isn't it?

wrote in message news:5387232@discussion.autodesk.com...
Help! Please!
The dll I have compiled (framework bersion 2.0) uses both file and sql
database functionality. On my workstation I have the SDK with includes a
framework version 2.0 version of mscorcfg.msc - so it was simple to set
security permissions for the compiled dll on my workstation. But I dont
really want to install Visual Studio on the user workstations just to be
able to distribute the programs I develop for Acad. Without applying
mscorcfg.msc the other users just hit exception security permission errors.
I tried using CASPOL. Caspol informed me that the assembly doesnt have a
strong name. Then I tried to apply a strong name in the assembly without
success - hit another error when trying to compile - error: referenced acad
managed object doesnt have a strong name!
What's the solution (please)?
Thanks,
Kevin.
Message 3 of 6
Matt S
in reply to: Anonymous

Does the folder have to have permissions set?

I can't seem to get it to work.
Message 4 of 6
Anonymous
in reply to: Anonymous

I strongly suggest you do this on a computer with .NET Configuration applet
(i.e. .NET SDK/VisualStudio2005 installed when it is .NET2.0). Once you did
once in a GUI way, you would be understand the CASPOL command I posted
easily and modify it according to your need. I did this to some of my .NET
code (loading from network) share since .NET 1.0 and it alway works. Note,
if your code could be called by different version of .NET framework (i.e.
the code was written with 1.x, by now you call them in 1.x app and/or 2.0
app), you have to configure the security with corresponding .NET framework.

To do it in GUI way:

1. Open "Control Panel"->"Administrative Tools"->"Microsoft .NET Framework
x.x Configuration" applet;
2. Right-click node "Console Root->.Net Framework x.x->MyComputer->Runtime
Security Policy->Machine->Code Group->All_Code" and select "New...";
3. Select "Create a new code group" radio button, enter name and
description. Click "Next";
4. Select "URL" in the dropdown list for "Condition Type", and enter the
path pointing to the said network folder, in such format:

file://servername/.../foldername/*

Click Next;
5. Select a predefined permission set. Usually I select "Full Trust",
because I know I am the only one who can drop .NET code into that folder.
You can choose different permission set, or define your own, if you want to.
6. Click next and OK.

Now, you go back to the CASPOL command I posted, you would understand the
command does the same thing as the above steps.



wrote in message news:5387919@discussion.autodesk.com...
Does the folder have to have permissions set?

I can't seem to get it to work.
Message 5 of 6
Anonymous
in reply to: Anonymous

Thanks.

I am hoping to try it out within the next 2 days.


"Norman Yuan" wrote in message
news:5388281@discussion.autodesk.com...
I strongly suggest you do this on a computer with .NET Configuration applet
(i.e. .NET SDK/VisualStudio2005 installed when it is .NET2.0). Once you did
once in a GUI way, you would be understand the CASPOL command I posted
easily and modify it according to your need. I did this to some of my .NET
code (loading from network) share since .NET 1.0 and it alway works. Note,
if your code could be called by different version of .NET framework (i.e.
the code was written with 1.x, by now you call them in 1.x app and/or 2.0
app), you have to configure the security with corresponding .NET framework.

To do it in GUI way:

1. Open "Control Panel"->"Administrative Tools"->"Microsoft .NET Framework
x.x Configuration" applet;
2. Right-click node "Console Root->.Net Framework x.x->MyComputer->Runtime
Security Policy->Machine->Code Group->All_Code" and select "New...";
3. Select "Create a new code group" radio button, enter name and
description. Click "Next";
4. Select "URL" in the dropdown list for "Condition Type", and enter the
path pointing to the said network folder, in such format:

file://servername/.../foldername/*

Click Next;
5. Select a predefined permission set. Usually I select "Full Trust",
because I know I am the only one who can drop .NET code into that folder.
You can choose different permission set, or define your own, if you want to.
6. Click next and OK.

Now, you go back to the CASPOL command I posted, you would understand the
command does the same thing as the above steps.



wrote in message news:5387919@discussion.autodesk.com...
Does the folder have to have permissions set?

I can't seem to get it to work.
Message 6 of 6
Ed.Jobe
in reply to: Anonymous

".NET2.0 does not have User-friendly .NET Configuration applet any more "
My pc at home does. But my pc at work doesn't. I'm thinking that the difference is Visual Studio vs the runtime.

Ed

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost