question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing @using at Layout file

See original GitHub issue

Steps to reproduce:

Please see https://stackoverflow.com/a/58204848/3728901

Severity:       Error
Error Code:     CS0246
Description:    The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?)
Project:        foo
File:       C:\Users\donhuvy\Desktop\acc133b3\foo\obj\Debug\netcoreapp3.0\Razor\Pages\Shared\_Layout.cshtml.g.cs
Line:       455
Suppression State:  Active

Expected behavior:

Has @using at the top of file.

Actual behavior:

Compile project error.

Additional information about the project being scaffolded, such as:

Target framework(s):

.NET Core 3.0.100 , Visual Studio 2019

Package version of Microsoft.AspNetCore.App or Microsoft.AspNetCore.All (if applicable):

Package version of Microsoft.VisualStudio.Web.CodeGeneration.Design - this may be added to your project by scaffolding:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
kanisimoffcommented, Dec 4, 2019

In .Net Core 3.1 I see same error.

Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name ‘IWebHostEnvironment’ could not be found (are you missing a using directive or an assembly reference?) LogicServices D:\GitHub\tyrchik\src\Tyrchik.Site\LogicLayer\LogicServices\UploadFileService.cs 15 Active

1reaction
HaoKcommented, Nov 7, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

LayOut's lost file references
LayOut's lost file references · Add an image to LayOut using file->Insert. · Delete the temp folder. · Save the LayOut file. ·...
Read more >
Layout XML folder is missing in Android Studio
Right-click on the layout folder; Select New -> Layout Resource File from the menu that opens; Enter your new file name; Click ok....
Read more >
Missing Layout files - General Q & A - ChiefTalk Forum
Open the layout, go up to Tools>Layout>Referenced Plan Files.....this should open the plan reference files, you select the plan file you were ...
Read more >
500 error for missing layout file that I don't use
My project is working great locally, no issues. I deployed to Forge, and the login and landing page work. But when I visit...
Read more >
Layouts show <Field Missing> on opening file
The <Field Missing> sometimes occurs for fields that are in the table that the layout is based on and sometimes in the related...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found