{"id":2411,"date":"2019-02-28T18:33:02","date_gmt":"2019-02-28T13:03:02","guid":{"rendered":"https:\/\/www.idslogic.com\/blog\/?p=2411"},"modified":"2025-02-24T12:53:55","modified_gmt":"2025-02-24T07:23:55","slug":"how-to-implement-roslyn-in-your-project","status":"publish","type":"post","link":"https:\/\/www.idslogic.com\/blog\/how-to-implement-roslyn-in-your-project","title":{"rendered":"How to Implement ROSLYN in Your Project"},"content":{"rendered":"<p><span style=\"font-size: 14pt;\">Asp.net and Sitefinity use a runtime compilation to compile assets\u00a0together.\u00a0 But the problem is whenever a new Sitefinity page is requested after build or recycle, there is a long wait time to reload the site.\u00a0 It is runtime compilation.<\/span><\/p>\n<p><span style=\"font-size: 14pt;\"><span style=\"color: #993300;\"><strong>ROSLYN<\/strong> software <\/span>is Microsoft\u2019s new compiler that is approx. 6 times faster than the default compiler.<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">It is available with Sitefinity 10.1 and above and reduce the reloading time drastically.<\/span><\/p>\n<p><span style=\"color: #993300; font-size: 14pt;\"><strong>These are the steps to implement the same in the local development server:<\/strong><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">1-Open the Sitefinity project in visual studio<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">2-Right-Click web project, and select Manage Sitefinity Nuget Packages<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">3-Search for &#8220;Roslyn&#8221; and install CodeDom.Providers.DotNetCompilerPlatform 2.0.1<\/span><\/p>\n<p><span style=\"font-size: 14pt;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2412 size-full\" src=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN.png\" alt=\"ROSLYN\" width=\"839\" height=\"179\" srcset=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN.png 839w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN-300x64.png 300w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN-768x164.png 768w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN-560x119.png 560w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">4-Build the project (This step is important, after successful build, it will add a Roslyn folder to the bin folder<\/span><\/p>\n<p><span style=\"font-size: 14pt;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2413 size-full\" src=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN-2.png\" alt=\"ROSLYN 2\" width=\"414\" height=\"254\" srcset=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN-2.png 414w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN-2-300x184.png 300w\" sizes=\"auto, (max-width: 414px) 100vw, 414px\" \/><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">Also few lines of code is important to add at the bottom of the web.config file.<\/span><\/p>\n<p><span style=\"font-size: 14pt;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2414 size-full\" src=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN-3.png\" alt=\"ROSLYN 3\" width=\"1205\" height=\"129\" srcset=\"https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN-3.png 1205w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN-3-300x32.png 300w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN-3-768x82.png 768w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN-3-1024x110.png 1024w, https:\/\/www.idslogic.com\/blog\/wp-content\/uploads\/2019\/02\/ROSLYN-3-560x60.png 560w\" sizes=\"auto, (max-width: 1205px) 100vw, 1205px\" \/><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">To enable the same on the live server, you need to follow the below two steps.<\/span><\/p>\n<ol>\n<li><span style=\"font-size: 14pt;\">Copy all bin folder dlls (including roslyn sub folder inside bin folder) to live project\u2019s bin folder.<\/span><\/li>\n<li><span style=\"font-size: 14pt;\">Add the new node at the bottom of the web.config (system.codedom) in the live web.config as well<\/span><\/li>\n<\/ol>\n<p><span style=\"font-size: 14pt;\">After everything, you can see the improvement in your live site.<\/span><\/p>\n<p style=\"text-align: center;\"><span style=\"font-size: 14pt;\"><a href=\"\/blog\/use-roslyn-to-boost-sitefinity-website-load-time\"><span style=\"color: #ff0000;\">Use Roslyn to Boost Sitefinity Website Load Time<\/span><\/a><\/span><\/p>\n<p><span style=\"color: #003300; font-size: 14pt;\"><strong>Contributed By<\/strong><\/span><\/p>\n<p><span style=\"font-size: 14pt;\">Biswajit Mishra<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Asp.net and Sitefinity use a runtime compilation to compile assets\u00a0together.\u00a0 But the problem is whenever a new Sitefinity page is requested after build or recycle, there is a long wait time to reload the site.\u00a0 It is runtime compilation. ROSLYN&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2415,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[251],"tags":[743,252,742],"class_list":["post-2411","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sitefinity","tag-roslyn","tag-sitefinity-cms-development","tag-sitefinity-speed-optimization"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/posts\/2411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/comments?post=2411"}],"version-history":[{"count":9,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/posts\/2411\/revisions"}],"predecessor-version":[{"id":10470,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/posts\/2411\/revisions\/10470"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/media\/2415"}],"wp:attachment":[{"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/media?parent=2411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/categories?post=2411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.idslogic.com\/blog\/wp-json\/wp\/v2\/tags?post=2411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}