Discussion:
Assembly could not be installed because existing policy would keep it from being used
(too old to reply)
MS
2009-04-22 14:03:32 UTC
Permalink
I have an application that loads a dotnet assembly into sqlserver and it
works fine on my dev machine, but fails with the following error on the
customers machine.

Assembly 'MyAssembly' could not be installed because existing policy would
keep it from being used

I have looked into the enterprise, machine and user code access policies and
they all seem to allow execution. At any rate, I don't see any difference
between the policies on the target machine and those on my dev machine, but
I guess I'm not looking in the right place.

Does anyone know what policy is being referred to in this error?
Uri Dimant
2009-04-22 14:11:18 UTC
Permalink
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver and it
works fine on my dev machine, but fails with the following error on the
customers machine.
Assembly 'MyAssembly' could not be installed because existing policy would
keep it from being used
I have looked into the enterprise, machine and user code access policies
and they all seem to allow execution. At any rate, I don't see any
difference between the policies on the target machine and those on my dev
machine, but I guess I'm not looking in the right place.
Does anyone know what policy is being referred to in this error?
MS
2009-04-22 14:28:06 UTC
Permalink
This is the query I am using (yes, clr is enabled. the only query below that
fails is the last one)

sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver and it
works fine on my dev machine, but fails with the following error on the
customers machine.
Assembly 'MyAssembly' could not be installed because existing policy
would keep it from being used
I have looked into the enterprise, machine and user code access policies
and they all seem to allow execution. At any rate, I don't see any
difference between the policies on the target machine and those on my dev
machine, but I guess I'm not looking in the right place.
Does anyone know what policy is being referred to in this error?
Uri Dimant
2009-04-22 14:36:32 UTC
Permalink
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only query below
that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver and it
works fine on my dev machine, but fails with the following error on the
customers machine.
Assembly 'MyAssembly' could not be installed because existing policy
would keep it from being used
I have looked into the enterprise, machine and user code access policies
and they all seem to allow execution. At any rate, I don't see any
difference between the policies on the target machine and those on my
dev machine, but I guess I'm not looking in the right place.
Does anyone know what policy is being referred to in this error?
MS
2009-04-22 14:49:21 UTC
Permalink
I get this error: (on my dev machine)
CREATE ASSEMBLY failed because type "MyAssembly" in safe assembly
"DataWorks.MI.log4net" has a finalizer. Finalizers are not allowed in safe
assemblies.
Post by Uri Dimant
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only query below
that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver and it
works fine on my dev machine, but fails with the following error on the
customers machine.
Assembly 'MyAssembly' could not be installed because existing policy
would keep it from being used
I have looked into the enterprise, machine and user code access
policies and they all seem to allow execution. At any rate, I don't see
any difference between the policies on the target machine and those on
my dev machine, but I guess I'm not looking in the right place.
Does anyone know what policy is being referred to in this error?
Uri Dimant
2009-04-22 15:05:10 UTC
Permalink
MS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b
Post by MS
I get this error: (on my dev machine)
CREATE ASSEMBLY failed because type "MyAssembly" in safe assembly
"DataWorks.MI.log4net" has a finalizer. Finalizers are not allowed in safe
assemblies.
Post by Uri Dimant
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only query below
that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver and
it works fine on my dev machine, but fails with the following error on
the customers machine.
Assembly 'MyAssembly' could not be installed because existing policy
would keep it from being used
I have looked into the enterprise, machine and user code access
policies and they all seem to allow execution. At any rate, I don't
see any difference between the policies on the target machine and
those on my dev machine, but I guess I'm not looking in the right
place.
Does anyone know what policy is being referred to in this error?
MS
2009-04-22 15:15:53 UTC
Permalink
Yes, I've read that post before. Sadly, it doesn't really say which policy
is required. That is really my sticking point. Which policy is preventing
the execution that the error refers to?
Post by Uri Dimant
MS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b
Post by MS
I get this error: (on my dev machine)
CREATE ASSEMBLY failed because type "MyAssembly" in safe assembly
"DataWorks.MI.log4net" has a finalizer. Finalizers are not allowed in
safe assemblies.
Post by Uri Dimant
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only query below
that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver and
it works fine on my dev machine, but fails with the following error on
the customers machine.
Assembly 'MyAssembly' could not be installed because existing policy
would keep it from being used
I have looked into the enterprise, machine and user code access
policies and they all seem to allow execution. At any rate, I don't
see any difference between the policies on the target machine and
those on my dev machine, but I guess I'm not looking in the right
place.
Does anyone know what policy is being referred to in this error?
Uri Dimant
2009-04-22 15:21:55 UTC
Permalink
MS
I do not really know how I can help, out of ideas
Post by MS
Yes, I've read that post before. Sadly, it doesn't really say which policy
is required. That is really my sticking point. Which policy is preventing
the execution that the error refers to?
Post by Uri Dimant
MS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b
Post by MS
I get this error: (on my dev machine)
CREATE ASSEMBLY failed because type "MyAssembly" in safe assembly
"DataWorks.MI.log4net" has a finalizer. Finalizers are not allowed in
safe assemblies.
Post by Uri Dimant
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only query
below that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver and
it works fine on my dev machine, but fails with the following error
on the customers machine.
Assembly 'MyAssembly' could not be installed because existing policy
would keep it from being used
I have looked into the enterprise, machine and user code access
policies and they all seem to allow execution. At any rate, I don't
see any difference between the policies on the target machine and
those on my dev machine, but I guess I'm not looking in the right
place.
Does anyone know what policy is being referred to in this error?
MS
2009-04-22 15:24:21 UTC
Permalink
Thanks for the discussion, though. Nice to at least communicate with someone
Post by Uri Dimant
MS
I do not really know how I can help, out of ideas
Post by MS
Yes, I've read that post before. Sadly, it doesn't really say which
policy is required. That is really my sticking point. Which policy is
preventing the execution that the error refers to?
Post by Uri Dimant
MS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b
Post by MS
I get this error: (on my dev machine)
CREATE ASSEMBLY failed because type "MyAssembly" in safe assembly
"DataWorks.MI.log4net" has a finalizer. Finalizers are not allowed in
safe assemblies.
Post by Uri Dimant
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only query
below that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver
and it works fine on my dev machine, but fails with the following
error on the customers machine.
Assembly 'MyAssembly' could not be installed because existing
policy would keep it from being used
I have looked into the enterprise, machine and user code access
policies and they all seem to allow execution. At any rate, I don't
see any difference between the policies on the target machine and
those on my dev machine, but I guess I'm not looking in the right
place.
Does anyone know what policy is being referred to in this error?
Uri Dimant
2009-04-23 05:15:38 UTC
Permalink
MS
I posted your question in private ms forum , let see how is going.
Post by MS
Thanks for the discussion, though. Nice to at least communicate with someone
Post by Uri Dimant
MS
I do not really know how I can help, out of ideas
Post by MS
Yes, I've read that post before. Sadly, it doesn't really say which
policy is required. That is really my sticking point. Which policy is
preventing the execution that the error refers to?
Post by Uri Dimant
MS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b
Post by MS
I get this error: (on my dev machine)
CREATE ASSEMBLY failed because type "MyAssembly" in safe assembly
"DataWorks.MI.log4net" has a finalizer. Finalizers are not allowed in
safe assemblies.
Post by Uri Dimant
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only query
below that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver
and it works fine on my dev machine, but fails with the following
error on the customers machine.
Assembly 'MyAssembly' could not be installed because existing
policy would keep it from being used
I have looked into the enterprise, machine and user code access
policies and they all seem to allow execution. At any rate, I
don't see any difference between the policies on the target
machine and those on my dev machine, but I guess I'm not looking
in the right place.
Does anyone know what policy is being referred to in this error?
MS
2009-04-23 14:01:08 UTC
Permalink
Thanks. I've totally run out of ideass, so I hope someone comes up with
something
Post by Uri Dimant
MS
I posted your question in private ms forum , let see how is going.
Post by MS
Thanks for the discussion, though. Nice to at least communicate with someone
Post by Uri Dimant
MS
I do not really know how I can help, out of ideas
Post by MS
Yes, I've read that post before. Sadly, it doesn't really say which
policy is required. That is really my sticking point. Which policy is
preventing the execution that the error refers to?
Post by Uri Dimant
MS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b
Post by MS
I get this error: (on my dev machine)
CREATE ASSEMBLY failed because type "MyAssembly" in safe assembly
"DataWorks.MI.log4net" has a finalizer. Finalizers are not allowed in
safe assemblies.
Post by Uri Dimant
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only query
below that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver
and it works fine on my dev machine, but fails with the following
error on the customers machine.
Assembly 'MyAssembly' could not be installed because existing
policy would keep it from being used
I have looked into the enterprise, machine and user code access
policies and they all seem to allow execution. At any rate, I
don't see any difference between the policies on the target
machine and those on my dev machine, but I guess I'm not looking
in the right place.
Does anyone know what policy is being referred to in this error?
Uri Dimant
2009-04-26 05:54:27 UTC
Permalink
MS
See if it helps I got from fellow MVP
/*
Tell them to check the ownership of the database on the box where it is
failing. We've had problems installing unsafe assemblies if the database
owner is a domain user. When we change the owner from a domain user to sa
it tends to work for us. Don't know if sa owning the database would be
acceptable in their environment, but it works for us.

*/
Post by MS
Thanks. I've totally run out of ideass, so I hope someone comes up with
something
Post by Uri Dimant
MS
I posted your question in private ms forum , let see how is going.
Post by MS
Thanks for the discussion, though. Nice to at least communicate with someone
Post by Uri Dimant
MS
I do not really know how I can help, out of ideas
Post by MS
Yes, I've read that post before. Sadly, it doesn't really say which
policy is required. That is really my sticking point. Which policy is
preventing the execution that the error refers to?
Post by Uri Dimant
MS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b
Post by MS
I get this error: (on my dev machine)
CREATE ASSEMBLY failed because type "MyAssembly" in safe assembly
"DataWorks.MI.log4net" has a finalizer. Finalizers are not allowed
in safe assemblies.
Post by Uri Dimant
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only query
below that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver
and it works fine on my dev machine, but fails with the following
error on the customers machine.
Assembly 'MyAssembly' could not be installed because existing
policy would keep it from being used
I have looked into the enterprise, machine and user code access
policies and they all seem to allow execution. At any rate, I
don't see any difference between the policies on the target
machine and those on my dev machine, but I guess I'm not looking
in the right place.
Does anyone know what policy is being referred to in this error?
Uri Dimant
2009-04-28 09:05:34 UTC
Permalink
MS
Do you have any info? Does it work?
Post by Uri Dimant
MS
See if it helps I got from fellow MVP
/*
Tell them to check the ownership of the database on the box where it is
failing. We've had problems installing unsafe assemblies if the database
owner is a domain user. When we change the owner from a domain user to sa
it tends to work for us. Don't know if sa owning the database would be
acceptable in their environment, but it works for us.
*/
Post by MS
Thanks. I've totally run out of ideass, so I hope someone comes up with
something
Post by Uri Dimant
MS
I posted your question in private ms forum , let see how is going.
Post by MS
Thanks for the discussion, though. Nice to at least communicate with someone
Post by Uri Dimant
MS
I do not really know how I can help, out of ideas
Post by MS
Yes, I've read that post before. Sadly, it doesn't really say which
policy is required. That is really my sticking point. Which policy is
preventing the execution that the error refers to?
Post by Uri Dimant
MS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b
Post by MS
I get this error: (on my dev machine)
CREATE ASSEMBLY failed because type "MyAssembly" in safe assembly
"DataWorks.MI.log4net" has a finalizer. Finalizers are not allowed
in safe assemblies.
Post by Uri Dimant
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only query
below that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the
server ?
Post by MS
I have an application that loads a dotnet assembly into
sqlserver and it works fine on my dev machine, but fails with
the following error on the customers machine.
Assembly 'MyAssembly' could not be installed because existing
policy would keep it from being used
I have looked into the enterprise, machine and user code access
policies and they all seem to allow execution. At any rate, I
don't see any difference between the policies on the target
machine and those on my dev machine, but I guess I'm not
looking in the right place.
Does anyone know what policy is being referred to in this error?
MS
2009-04-30 11:04:09 UTC
Permalink
I've found the problem.

Our product assemblies are installed in the GAC along with policy
assemblies to allow for assembly-rebinding (this lets applications built
against older versions of our assemblies to work with newer versions).

When we delete the assembly-rebind policies, the loading into sqlserver
works.
Post by Uri Dimant
MS
Do you have any info? Does it work?
Post by Uri Dimant
MS
See if it helps I got from fellow MVP
/*
Tell them to check the ownership of the database on the box where it is
failing. We've had problems installing unsafe assemblies if the database
owner is a domain user. When we change the owner from a domain user to sa
it tends to work for us. Don't know if sa owning the database would be
acceptable in their environment, but it works for us.
*/
Post by MS
Thanks. I've totally run out of ideass, so I hope someone comes up with
something
Post by Uri Dimant
MS
I posted your question in private ms forum , let see how is going.
Post by MS
Thanks for the discussion, though. Nice to at least communicate with someone
Post by Uri Dimant
MS
I do not really know how I can help, out of ideas
Post by MS
Yes, I've read that post before. Sadly, it doesn't really say which
policy is required. That is really my sticking point. Which policy
is preventing the execution that the error refers to?
Post by Uri Dimant
MS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b
Post by MS
I get this error: (on my dev machine)
CREATE ASSEMBLY failed because type "MyAssembly" in safe assembly
"DataWorks.MI.log4net" has a finalizer. Finalizers are not allowed
in safe assemblies.
Post by Uri Dimant
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only
query below that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on
the server ?
Post by MS
I have an application that loads a dotnet assembly into
sqlserver and it works fine on my dev machine, but fails with
the following error on the customers machine.
Assembly 'MyAssembly' could not be installed because existing
policy would keep it from being used
I have looked into the enterprise, machine and user code
access policies and they all seem to allow execution. At any
rate, I don't see any difference between the policies on the
target machine and those on my dev machine, but I guess I'm
not looking in the right place.
Does anyone know what policy is being referred to in this error?
MS
2009-04-30 11:01:06 UTC
Permalink
I have founf the answer to this problem.

Our product allows customers to build custom applications using the
product's assemblies. They may build an application against version 1 of our
product. When we release version 2, we don't want everyone to have to
rebuild their applications against these version 2 binaries, so we deploy a
policy assembly that allows dotnet to "rebind" any application built against
version 1 onto the new version 2 assemblies.

When we install the product, the assemblies are installed into the GAC
allong with these rebind policies. It was these rebind policy assemblies
that was causing the problem.

To test, we deleted the policies from the GAC and the problem disappeared.

Not the end of things for me, though; since we really do need the rebind
policies I'll have to come up with some way of allowing them to work with
SQLCLR
Post by MS
Thanks. I've totally run out of ideass, so I hope someone comes up with
something
Post by Uri Dimant
MS
I posted your question in private ms forum , let see how is going.
Post by MS
Thanks for the discussion, though. Nice to at least communicate with someone
Post by Uri Dimant
MS
I do not really know how I can help, out of ideas
Post by MS
Yes, I've read that post before. Sadly, it doesn't really say which
policy is required. That is really my sticking point. Which policy is
preventing the execution that the error refers to?
Post by Uri Dimant
MS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b
Post by MS
I get this error: (on my dev machine)
CREATE ASSEMBLY failed because type "MyAssembly" in safe assembly
"DataWorks.MI.log4net" has a finalizer. Finalizers are not allowed
in safe assemblies.
Post by Uri Dimant
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only query
below that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver
and it works fine on my dev machine, but fails with the following
error on the customers machine.
Assembly 'MyAssembly' could not be installed because existing
policy would keep it from being used
I have looked into the enterprise, machine and user code access
policies and they all seem to allow execution. At any rate, I
don't see any difference between the policies on the target
machine and those on my dev machine, but I guess I'm not looking
in the right place.
Does anyone know what policy is being referred to in this error?
Uri Dimant
2009-04-30 11:33:20 UTC
Permalink
MS
Thanks for updating us
Post by MS
I have founf the answer to this problem.
Our product allows customers to build custom applications using the
product's assemblies. They may build an application against version 1 of
our product. When we release version 2, we don't want everyone to have to
rebuild their applications against these version 2 binaries, so we deploy
a policy assembly that allows dotnet to "rebind" any application built
against version 1 onto the new version 2 assemblies.
When we install the product, the assemblies are installed into the GAC
allong with these rebind policies. It was these rebind policy assemblies
that was causing the problem.
To test, we deleted the policies from the GAC and the problem disappeared.
Not the end of things for me, though; since we really do need the rebind
policies I'll have to come up with some way of allowing them to work with
SQLCLR
Post by MS
Thanks. I've totally run out of ideass, so I hope someone comes up with
something
Post by Uri Dimant
MS
I posted your question in private ms forum , let see how is going.
Post by MS
Thanks for the discussion, though. Nice to at least communicate with someone
Post by Uri Dimant
MS
I do not really know how I can help, out of ideas
Post by MS
Yes, I've read that post before. Sadly, it doesn't really say which
policy is required. That is really my sticking point. Which policy is
preventing the execution that the error refers to?
Post by Uri Dimant
MS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b
Post by MS
I get this error: (on my dev machine)
CREATE ASSEMBLY failed because type "MyAssembly" in safe assembly
"DataWorks.MI.log4net" has a finalizer. Finalizers are not allowed
in safe assemblies.
Post by Uri Dimant
MS
What if you change to
with permission_set = SAFE ?
Post by MS
This is the query I am using (yes, clr is enabled. the only query
below that fails is the last one)
sp_configure 'clr enabled', 1
go
reconfigure
go
exec sp_dbcmptlevel 'IncuityStore', 90
go
alter database IncuityStore set trustworthy on
go
Create assembly [MyAssembly]
from 'C:\svndev\Services\MyAssembly.dll'
with permission_set = unsafe
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the
server ?
Post by MS
I have an application that loads a dotnet assembly into
sqlserver and it works fine on my dev machine, but fails with
the following error on the customers machine.
Assembly 'MyAssembly' could not be installed because existing
policy would keep it from being used
I have looked into the enterprise, machine and user code access
policies and they all seem to allow execution. At any rate, I
don't see any difference between the policies on the target
machine and those on my dev machine, but I guess I'm not
looking in the right place.
Does anyone know what policy is being referred to in this error?
MS
2009-04-22 14:30:01 UTC
Permalink
Could it be becausee the asssembly that I want to load is in the GAC?
Post by Uri Dimant
MS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MS
I have an application that loads a dotnet assembly into sqlserver and it
works fine on my dev machine, but fails with the following error on the
customers machine.
Assembly 'MyAssembly' could not be installed because existing policy
would keep it from being used
I have looked into the enterprise, machine and user code access policies
and they all seem to allow execution. At any rate, I don't see any
difference between the policies on the target machine and those on my dev
machine, but I guess I'm not looking in the right place.
Does anyone know what policy is being referred to in this error?
Adrian Dams
2009-04-24 13:55:03 UTC
Permalink
When is someone from Microsoft going to respond to this question.

It seems like a bunch of people have this problem and yet no-one from MS is
keying in
Post by MS
I have an application that loads a dotnet assembly into sqlserver and it
works fine on my dev machine, but fails with the following error on the
customers machine.
Assembly 'MyAssembly' could not be installed because existing policy would
keep it from being used
I have looked into the enterprise, machine and user code access policies and
they all seem to allow execution. At any rate, I don't see any difference
between the policies on the target machine and those on my dev machine, but
I guess I'm not looking in the right place.
Does anyone know what policy is being referred to in this error?
Continue reading on narkive:
Loading...