How do i mark as assembly as \"safe\"?
Alternatively, how do i have Visual Studio tell me when something in my assembly is not \"safe\"?
Sometimes you cann
SAFE is the most restrictive permission set. Code executed by an assembly with SAFE permissions cannot access external system resources such as files, the network, environment variables, or the registry
so its about code execution permission set inside SQL Server code domain
Unsafe
flag from VS has nothing to do, basically, with code execution security, but enables non managed code execution. So this about non managed code integration into managed code base
CLS Compilant
attribute as defined here is about defining the code of the assembly marked with that attribute like a code that follows CSL (Common Language Specification) guideline. So this about compilation and code architecture.
How do i mark as assembly as "safe"?
It defined in the first link in this answer and has relation with SQL Server integration.
How does SQL know that as assembly is "not safe"?
Considering description provided: "Creates a managed application module that contains class metadata and managed code as an object in an instance of SQL Server", SQL Server relays on metadata
, that in some fields provides an information about the fact if it is "safe" or not.