{"id":1021,"date":"2004-09-29T02:49:00","date_gmt":"2004-09-29T02:49:00","guid":{"rendered":"\/blogs\/bobb\/post\/Using-FX-assemblies-outside-of-the-list.aspx"},"modified":"2004-09-29T02:49:00","modified_gmt":"2004-09-29T02:49:00","slug":"using-fx-assemblies-outside-of-the-list","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/","title":{"rendered":"Using FX assemblies outside of &#8220;the list&#8221;"},"content":{"rendered":"<p>\nIt turns out that you can force SQL Server to use FX libraries that are not on the approved list. Deploying user code that uses these through Visual Studio produces:\n<\/p>\n<p>\nError: Assembly &#39;system.runtime.remoting, version=2.0.3600.0, culture=neutral, publickeytoken=b77a5c561934e089.&#39; was not found in the SQL catalog.\n<\/p>\n<p>\nBut that&#39;s because Visual Studio uses CREATE ASSEMBLY &quot;from bytes&quot;, passing in the byte array. You can also use &quot;CREATE ASSEMBLY foo FROM &#39;c:\\types\\foo.dll&#39;. SQL Server then searches the directory specified (c:\\types in this case) for dependent assemblies. When you use VS autodeploy it doesn&#39;t do this, making &quot;automatic cataloging of dependent assemblies with IsVisable=No&quot; difficult (impossible?) to prove when using autodeploy.\n<\/p>\n<p>\nWhen I use CREATE ASSEMBLY with a file on my &quot;simple remoting program&quot;, there is a more telling error:\n<\/p>\n<p>\nMsg 6581, Level 16, State 1, Line 1<br \/>\nCould not find assembly &#39;system.runtime.remoting&#39; in directory &#39;c:\\types\\&#39;.\n<\/p>\n<p>\nOh. Copying &#39;System.Runtime.Remoting&#39; to c:\\types produces another &quot;Could not find assembly&quot;. Eventually I put my assembly in the FX lib directory so it can resolve everything and set the permission_set to unsafe. This works and I&#39;ve deployed it. Looking in sys.assemblies, it&#39;s taken 15 FX libraries that are not on &quot;the list&quot; with it. They&#39;re cataloged as &quot;normal&quot; libraries with IsVisible=True in the metadata. That means you can&#39;t declare catalog or use their methods from SQL Server directly, only from other user assemblies, subject (of course) to security.\n<\/p>\n<p>\nIt also DOESN&#39;T imply that these libraries are unsafe in general, just when you use SQL Server as a runtime host. SQL Server likes to do things like control it&#39;s own threading, exception handling, memory allocation, etc, etc. Most\/all other current runtime hosts don&#39;t. It&#39;s not going to USE most\/any of these in my one-line program, mind you, it&#39;s just following dependency chains&nbsp;in the manifests. Things may work fine.\n<\/p>\n<p>\nBTW, just in case you didn&#39;t gather this, this is NOT NOT NOT RECOMMENDED. Just meant to answer the question &quot;can you&#8230;&quot;. I, for one, am GLAD there&#39;s a list. That they are definately looking out for reliability\/scalability\/etc. Very cool.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It turns out that you can force SQL Server to use FX libraries that are not on the approved list. Deploying user code that uses these through Visual Studio produces: Error: Assembly &#39;system.runtime.remoting, version=2.0.3600.0, culture=neutral, publickeytoken=b77a5c561934e089.&#39; was not found in the SQL catalog. But that&#39;s because Visual Studio uses CREATE ASSEMBLY &quot;from bytes&quot;, passing in [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,38],"tags":[],"class_list":["post-1021","post","type-post","status-publish","format-standard","hentry","category-sql-server-2005","category-sqlclr"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using FX assemblies outside of &quot;the list&quot; - Bob Beauchemin<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using FX assemblies outside of &quot;the list&quot; - Bob Beauchemin\" \/>\n<meta property=\"og:description\" content=\"It turns out that you can force SQL Server to use FX libraries that are not on the approved list. Deploying user code that uses these through Visual Studio produces: Error: Assembly &#039;system.runtime.remoting, version=2.0.3600.0, culture=neutral, publickeytoken=b77a5c561934e089.&#039; was not found in the SQL catalog. But that&#039;s because Visual Studio uses CREATE ASSEMBLY &quot;from bytes&quot;, passing in [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/\" \/>\n<meta property=\"og:site_name\" content=\"Bob Beauchemin\" \/>\n<meta property=\"article:published_time\" content=\"2004-09-29T02:49:00+00:00\" \/>\n<meta name=\"author\" content=\"Bob Beauchemin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bob Beauchemin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/\",\"name\":\"Using FX assemblies outside of \\\"the list\\\" - Bob Beauchemin\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\"},\"datePublished\":\"2004-09-29T02:49:00+00:00\",\"dateModified\":\"2004-09-29T02:49:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server 2005\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/category\/sql-server-2005\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Using FX assemblies outside of &#8220;the list&#8221;\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/\",\"name\":\"Bob Beauchemin\",\"description\":\"SQL Server Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e\",\"name\":\"Bob Beauchemin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g\",\"caption\":\"Bob Beauchemin\"},\"sameAs\":[\"http:\/www.sqlskills.com\/blogs\/bobb\/\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/author\/bobb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using FX assemblies outside of \"the list\" - Bob Beauchemin","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/","og_locale":"en_US","og_type":"article","og_title":"Using FX assemblies outside of \"the list\" - Bob Beauchemin","og_description":"It turns out that you can force SQL Server to use FX libraries that are not on the approved list. Deploying user code that uses these through Visual Studio produces: Error: Assembly &#39;system.runtime.remoting, version=2.0.3600.0, culture=neutral, publickeytoken=b77a5c561934e089.&#39; was not found in the SQL catalog. But that&#39;s because Visual Studio uses CREATE ASSEMBLY &quot;from bytes&quot;, passing in [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/","og_site_name":"Bob Beauchemin","article_published_time":"2004-09-29T02:49:00+00:00","author":"Bob Beauchemin","twitter_misc":{"Written by":"Bob Beauchemin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/","name":"Using FX assemblies outside of \"the list\" - Bob Beauchemin","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website"},"datePublished":"2004-09-29T02:49:00+00:00","dateModified":"2004-09-29T02:49:00+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/using-fx-assemblies-outside-of-the-list\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/bobb\/"},{"@type":"ListItem","position":2,"name":"SQL Server 2005","item":"https:\/\/www.sqlskills.com\/blogs\/bobb\/category\/sql-server-2005\/"},{"@type":"ListItem","position":3,"name":"Using FX assemblies outside of &#8220;the list&#8221;"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/","name":"Bob Beauchemin","description":"SQL Server Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/bobb\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e","name":"Bob Beauchemin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g","caption":"Bob Beauchemin"},"sameAs":["http:\/www.sqlskills.com\/blogs\/bobb\/"],"url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/author\/bobb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/1021","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/comments?post=1021"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/1021\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/media?parent=1021"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/categories?post=1021"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/tags?post=1021"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}