To share Syncfusion dependent resources like Script files, CSS files, and DLL files among multiple websites or web applications, host them in a common shared location. This hosting can be done locally in a server and shared across multiple projects.
Host the Scripts and CSS files
To host the Script and CSS files, add a virtual directory in the existing website in IIS. It can be added to any existing website or create a new one. To create a new website, right-click the site in IIS and select Add Website.
Then, provide configurations for Add Website dialog and select OK.
Now, a new website has been created. Add the CSS and Scripts in the site to host them. The previously given steps can be skipped if the website is already available. In the physical location of the hosted site’s folder, add the scripts and CSS files.
After adding the files, right-click the website name in the Connections panel and select Refresh. This will update the changes in the site.
Now, the site is hosted. To access it, right-click the website and select Manage Website and then Browse.
From here, you can directly provide a path for the Script or CSS files to load them or enable directory browsing in the features view of the website and browse the contents.
Host the Assembly files
Now, the script and theme files have been hosted. The dependent assemblies are hosted by creating a private NuGet server. This is done with the help of Nuget.Server package provided by .NET Foundation. This package creates an ASP.NET application that can host a package feed on any server that runs IIS. This is as simple as creating an Web application with Visual Studio.
Create a new Web application in Visual Studio. Make sure that the project’s Framework is in 4.6 or above, since Nuget.Server supports only above Framework 4.6.
In this dialog, select the Empty template, then select OK. After creating the application, go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution.
Browse for Nuget.Server package and install it.
Now, the empty Web application is converted into a package source. It also installs a variety of other packages. Select “I Accept” to agree to the license terms and install the packages.
The Nuget.Server package installation creates a Packages folder in the application and modifies web.config to include additional settings for the private Nuget Server.
Make sure that there are no duplicate configurations in the web.config file after the installation.
The duplicate configuration added by the installation will lead to an internal server error when you host it. So, remove the element with older framework version.
Add .nupkg files to the Packages folder in Visual Studio.
To make packages available when the application is published to a server, set each one's Build Action to Content and Copy to Output Directory to Copy always in the Properties window.
Now, press Ctrl + F5 to run the application without debugging.
The OData feed of added packages is found in the previously given page. After the application is deployed, the “http://<domain>/nuget “ is added to the Package Sources and used as a private Nuget Server.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|
|9207||08/24/2018||08/24/2018||ASP.NET Web Forms||General|