.NET

Reply
Contributor
grinchman
Posts: 20
Registered: ‎08-16-2006
Message 1 of 6 (162 Views)

Deployment of the dll (framework version 2.0)

162 Views, 5 Replies
11-06-2006 11:32 PM
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.
*Norman Yuan
Message 2 of 6 (162 Views)

Re: Deployment of the dll (framework version 2.0)

11-07-2006 06:23 AM in reply to: grinchman
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.
Valued Contributor
Matt S
Posts: 64
Registered: ‎05-05-2004
Message 3 of 6 (162 Views)

Re: Deployment of the dll (framework version 2.0)

11-07-2006 09:24 AM in reply to: grinchman
Does the folder have to have permissions set?

I can't seem to get it to work.
*Norman Yuan
Message 4 of 6 (162 Views)

Re: Deployment of the dll (framework version 2.0)

11-07-2006 12:28 PM in reply to: grinchman
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.
*Bill S
Message 5 of 6 (162 Views)

Re: Deployment of the dll (framework version 2.0)

11-08-2006 05:39 AM in reply to: grinchman
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.
Distinguished Contributor
eljobe
Posts: 704
Registered: ‎01-24-2003
Message 6 of 6 (162 Views)

Re: Deployment of the dll (framework version 2.0)

02-28-2007 02:20 PM in reply to: grinchman
".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.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community