In the Sitecore® Experience Solution Developer Course you learn to set up a Visual Studio solution for Sitecore 8 by doing the following steps:
- Create a new ASP.NET Web Application using the Empty ASP.NET 4.5.2 Template.
- Copy the Global.asax, Web.config, Views\Web.config files from the Sitecore Website folder into your Visual Studio project folder.
- Add the assemblies Sitecore.Kernel.dll, Sitecore.MVC.Analytics.dll, and Sitecore.MVC.dll to your Visual Studio project.
- Create a folder named App_Config in your Visual Studio project.
Optionally, you navigate to the Global.asax file and investigate the error list. If you notice that there are warnings, you can install the following NuGet packages with their depending packages.
- Microsoft.ASPNET.WebApi
- Microsoft.ASPNET.WebApi.Cors
These steps were not enough to fix the warnings in the Global.asax file. I had to install the following NuGet packages
- Microsoft.AspNet.Mvc
- Microsoft.AspNet.WebPages
Recently, I followed these steps when setting up a Visual Studio solution for Sitecore 9.0 (Initial Release) and it worked fine.
Now, I am trying to do the same with Sitecore 9.0 Update-1, but I still get warnings from the Global.asax.
The first warning was:
ASP.NET runtime error: The pre-application start initialization method Start on type WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Unable to open configSource file 'App_Config\Sitecore.config'
After adding the App_Config\Sitecore.config file to the Visual Studio project, it complained about more missing config files. After adding them, it started showing the following warning:
ASP.NET runtime error: The pre-application start initialization method Start on type WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.
I installed the Microsoft.Extensions.DependencyInjection NuGet package. After that, it started giving me the following warning.
ASP.NET runtime error: The pre-application start initialization method Start on type WebMatrix.WebData.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
I tried to fix it by installing the NETStandard.Library NuGet package, but it didn't fix it. I ended up with a Visual Studio solution like that.
Have you guys managed to fix these warnings or do you advise me simply ignoring them?
Update: I am setting up a Visual Studio solution using .NET Framework 4.7 and an Empty ASP.NET Web Application (.NET Framework) template. I am using Visual Studio 2017.
Initialize
pipeline for anything you would normally do there). Do you get all the errors if you remove this file?