I upgraded an existing 2.2 project to 3.0. I copied the new code for Program/Startup from a new 3.0 project to my existing 2.2 project. It worked, but the IsDevelopment()
below:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
}
Results in this error:
'IWebHostEnvironment' does not contain a definition for 'IsDevelopment' and the best extension method overload 'HostingEnvironmentExtensions.IsDevelopment(IHostingEnvironment)' requires a receiver of type 'IHostingEnvironment'
The same line did not caused a newly created 3.0 project. What do I need to modify/add to the project upgraded from 2.2?