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 MSThanks. I've totally run out of ideass, so I hope someone comes up with
something
Post by Uri DimantMS
I posted your question in private ms forum , let see how is going.
Post by MSThanks for the discussion, though. Nice to at least communicate with someone
Post by Uri DimantMS
I do not really know how I can help, out of ideas
Post by MSYes, 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 DimantMS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b
Post by MSI 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 DimantMS
What if you change to
with permission_set = SAFE ?
Post by MSThis 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 DimantMS
Can you post the exact command, btw, have you enabled CLR on the server ?
Post by MSI 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?