InstallUtil Security Error

  • Thread starter Thread starter Dani
  • Start date Start date
D

Dani

When I run the following command as an Administrator on Windows 2003
version 5.2.3790...


C:\Windows\Microsoft.NET\Framework\v1.1.4322>installutil


.... I get following error dialog appears:


InstallUtil.exe - Common Language Runtime Debugging Services
Application has generated an exception that could not be handled.
Process id=0x...(....), Thread id=0x...(....)


This is followed with the following text in the Command Prompt:


Unhandled Exception: System.Security.SecurityException: Security
error. at
System.Configuration.InstallUtil.Main(String[] args)

The granted set of failing assembly was:
<PermissionSet class="System.Security.PermissionSet" version="1">
<IPermission
class="System.Security.Permissions.EnvironmentPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1" Unrestricted="true"/>


snip

Must I reinstall the framework to fix this? Here is a thread regarding
a very similar with which the problem was not solved by reinstalling
the framework:

http://groups.google.com/group/micr...llutil+security+error&rnum=4#534954f4f4a5f672
 
It sounds like the code access security policy on the server has probably
been modified so that locally run code no longer receives an unrestricted
permission grant. If this is the case, changing the permission grant for
installutil.exe (and/or some supporting assemblies) should fix the problem
without requiring a reinstall. If would like help in determining what
additional permission grants might be required, could you please post the
full exception details (including the portions that you "snipped")?
 
Here are the full exception details:


Unhandled Exception: System.Security.SecurityException: Security error.
at System.Configuration.InstallUtil.Main(String[] args)

The granted set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission
class="System.Security.Permissions.EnvironmentPermission, mscorl
ib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission
class="System.Security.Permissions.FileDialogPermission, mscorli
b, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Security.Permissions.FileIOPermission,
mscorlib, V
ersion=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission
class="System.Security.Permissions.IsolatedStorageFilePermission
, mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
"
version="1"
Unrestricted="true"/>
<IPermission
class="System.Security.Permissions.ReflectionPermission, mscorli
b, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Security.Permissions.RegistryPermission,
mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Security.Permissions.SecurityPermission,
mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="Assertion, UnmanagedCode, Execution,
ControlThread, Contr
olEvidence, ControlPolicy, SerializationFormatter, ControlDomainPolicy,
ControlP
rincipal, ControlAppDomain, RemotingConfiguration, Infrastructure,
BindingRedire
cts"/>
<IPermission class="System.Security.Permissions.UIPermission,
mscorlib, Versi
on=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Net.DnsPermission, System,
Version=1.0.5000.0, Cul
ture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Drawing.Printing.PrintingPermission,
System.Drawin
g, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
version="1"
Unrestricted="true"/>
<IPermission class="System.Diagnostics.EventLogPermission, System,
Version=1.
0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Net.SocketPermission, System,
Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Net.WebPermission, System,
Version=1.0.5000.0, Cul
ture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Diagnostics.PerformanceCounterPermission,
System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission
class="System.DirectoryServices.DirectoryServicesPermission, Sys
tem.DirectoryServices, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5
f7f11d50a3a"
version="1"
Unrestricted="true"/>
<IPermission class="System.Messaging.MessageQueuePermission,
System.Messaging
, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
version="1"
Unrestricted="true"/>
<IPermission
class="System.ServiceProcess.ServiceControllerPermission, System
..ServiceProcess, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d
50a3a"
version="1"
Unrestricted="true"/>
<IPermission class="System.Data.OleDb.OleDbPermission, System.Data,
Version=1
..0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Data.SqlClient.SqlClientPermission,
System.Data, V
ersion=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission
class="System.Security.Permissions.StrongNameIdentityPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"

version="1"

PublicKeyBlob="0024000004800000940000000602000000240000525341310
00400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB
23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE
4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D2
61C8A12436518206DC093344D5AD293"
Name="InstallUtil"
AssemblyVersion="1.0.5000.0"/>
<IPermission
class="System.Security.Permissions.UrlIdentityPermission, mscorl
ib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"

Url="file://C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Install
Util.exe"/>
<IPermission
class="System.Security.Permissions.ZoneIdentityPermission, mscor
lib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Zone="MyComputer"/>
</PermissionSet>
 
Thanks, Nicole. After reading your response, I found that the NET
Framework 1.1 Configuration application was giving me the following
error when being launched:

Snap-in failed to initialize.
Name:.Net Framework 1.1 Configuration
CLSID:{1270E004-F895-42BE-8070-DF90D60CBB75}


This error is further discussed here:

http://groups.google.com/group/micr...mework+configuration&rnum=12#385fce82f72466df

To solve this problem, as discussed in that thread, I manually edited
the following file...


C:\Windows\microsoft.net\Framework\v1.1.4322\CONFIG\Enterprisesec.config

....where I changed the Enterprise Code Group "All_Code" from
"Everything" to "FullTrust". Afterwards, I was able to launch the "Net
Framework 1.1 Configuration" and run the InstallUtil.exe. All of this
fixed my original problem of setup crashing when trying to install a
windows service.
 
...where I changed the Enterprise Code Group "All_Code" from
"Everything" to "FullTrust".

While this might work, it presumably goes against the intent of whoever
altered the policy in the first place. There are other ways to grant
additional permissions to a subset of assemblies without potentially
compromising a protective mechanism on your server, and you might want to
consider working with the original policy modifier to select an appropriate
approach...
 
As far as I know, the policy was only once modified by another
developer for the purpose of attempting to install this assembly. This
is the first .net assembly that we created for this server. The
developer, who created the assembly, was having some problems with the
installation, but I'm not sure what it was. Thus, I am not sure what
caused installutil to not work.

On a new installation of Windows server 2003, the Enterprise Code Group
"All_Code" is set by default to "FullTrust". This leads me to believe
that maybe the developer changed the permission set to "Everything",
hoping to solve another problem. Maybe, I could reset the Enterprise,
Machine and User policies? As far as I know, this is the only
non-Microsoft .net assembly on this server.
 
Might it be possible that your network administrators have set up automatic
propagation of CAS policy over your network? If so, you might want to check
with them too. If it turns out they haven't, resetting the entire CAS
policy would be the simplest approach if you suspect that unplanned and/or
erroneous policy modifications have been applied.
 
I'll have a check with them. Thank you so much for your assistance. :)
 
Back
Top