Re: Assembly could not be installed because existing policy would keep it from being used



MS
Thanks for updating us

"MS" <adriandams@xxxxxxxxx> wrote in message
news:efIGOMYyJHA.1380@xxxxxxxxxxxxxxxxxxxxxxx
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

"MS" <adriandams@xxxxxxxxx> wrote in message
news:u5uE9vBxJHA.4176@xxxxxxxxxxxxxxxxxxxxxxx
Thanks. I've totally run out of ideass, so I hope someone comes up with
something

"Uri Dimant" <urid@xxxxxxxxxxx> wrote in message
news:OCNJCJ9wJHA.2376@xxxxxxxxxxxxxxxxxxxxxxx
MS
I posted your question in private ms forum , let see how is going.



"MS" <adriandams@xxxxxxxxx> wrote in message
news:%23Mo%23p51wJHA.5472@xxxxxxxxxxxxxxxxxxxxxxx
Thanks for the discussion, though. Nice to at least communicate with
someone

"Uri Dimant" <urid@xxxxxxxxxxx> wrote in message
news:OS7lJ31wJHA.4176@xxxxxxxxxxxxxxxxxxxxxxx
MS
I do not really know how I can help, out of ideas



"MS" <adriandams@xxxxxxxxx> wrote in message
news:eSQi801wJHA.1504@xxxxxxxxxxxxxxxxxxxxxxx
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?

"Uri Dimant" <urid@xxxxxxxxxxx> wrote in message
news:OTCpzt1wJHA.4476@xxxxxxxxxxxxxxxxxxxxxxx
MS
Have you tried this one?
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/6546340a-2cf7-4308-88d0-c403cebdb66b



"MS" <adriandams@xxxxxxxxx> wrote in message
news:umL4Hm1wJHA.3848@xxxxxxxxxxxxxxxxxxxxxxx
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.


"Uri Dimant" <urid@xxxxxxxxxxx> wrote in message
news:uphY0d1wJHA.5244@xxxxxxxxxxxxxxxxxxxxxxx
MS
What if you change to
with permission_set = SAFE ?







"MS" <adriandams@xxxxxxxxx> wrote in message
news:O5h%23Pa1wJHA.988@xxxxxxxxxxxxxxxxxxxxxxx
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


"Uri Dimant" <urid@xxxxxxxxxxx> wrote in message
news:eeK9wP1wJHA.1212@xxxxxxxxxxxxxxxxxxxxxxx
MS
Can you post the exact command, btw, have you enabled CLR on the
server ?




"MS" <adriandams@xxxxxxxxx> wrote in message
news:un15fM1wJHA.5672@xxxxxxxxxxxxxxxxxxxxxxx
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?

























.



Relevant Pages