Open kanisimoff opened 4 years ago
Hi, Could you let me know what Microsoft.VisualStudio.Web.CodeGeneration.Design package version you are using from the csproj file.
Thanks.
Hi, All links to all libraries from the project:
<ItemGroup>
<PackageReference Include="Markdig" Version="0.18.0" />
<PackageReference Include="Markdig.SyntaxHighlighting" Version="1.1.7" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="3.1.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" />
</ItemGroup>
Thanks
Just to get some information, what was the last action you made that made this warning pop up? Updated the Code Gen package, adding the Abstraction package etc. What does the file contain pertaining the warning?
Thanks
I have a basic site project and a project with a class library. I added assemblies to the class library as indicated in the previous post, but when compiling I get an error message: IWebHostEnvironment could not be found.
Thanks
Is the problem still persisting?
I had a similar issue with a class library and the way I solved it was adding FrameworkReference Include="Microsoft.AspNetCore.App" to the references. Oddly enough it seemed like the project was stuck using an earlier version of .NetCore's framework. I know its not directly connected but it might help out someone else.
I received the same problem while trying to build a docker image : error CS0246: The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?). Target Framework : .net Core 3.0
I received the same problem while trying to build a docker image : error CS0246: The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?). Target Framework : .net Core 3.0
Issue solved by adding in our csproj file (3.1 core app):
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
@kanisimoff does the aformentioned info help?
yes, it helps
I received the same problem while trying to build a docker image : error CS0246: The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?). Target Framework : .net Core 3.0
Issue solved by adding in our csproj file (3.1 core app):
<ItemGroup> <FrameworkReference Include="Microsoft.AspNetCore.App" /> </ItemGroup>
I tried a tutorial on self-hosted SignalR server in a console application and your solution work great :).
See: SignalR background-service
But apparently there is another solution as the example i used actually uses another SDK in the project file.
<Project Sdk="Microsoft.NET.Sdk.Web">
I started a new console app and it gives me
<Project Sdk="Microsoft.NET.Sdk">
Both solution work. Thanx :)
<FrameworkReference Include="Microsoft.AspNetCore.App" />
This worked for me thanks
I received the same problem while trying to build a docker image : error CS0246: The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?). Target Framework : .net Core 3.0
Issue solved by adding in our csproj file (3.1 core app):
<ItemGroup> <FrameworkReference Include="Microsoft.AspNetCore.App" /> </ItemGroup>
I tried a tutorial on self-hosted SignalR server in a console application and your solution work great :).
See: SignalR background-service
But apparently there is another solution as the example i used actually uses another SDK in the project file.
<Project Sdk="Microsoft.NET.Sdk.Web">
I started a new console app and it gives me
<Project Sdk="Microsoft.NET.Sdk">
Both solution work. Thanx :)
This works
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include=...
</ItemGroup>
And also changing
<Project Sdk="Microsoft.NET.Sdk">
to
<Project Sdk="Microsoft.NET.Sdk.Web">
Worked for me
this also worked for me
`
`
Package Microsoft.AspNetCore.App 2.2.0 is not compatible with netstandard2.1 (.NETStandard,Version=v2.1). Package Microsoft.AspNetCore.App 2.8.0 supports: netcoreapp2.2 (.NETCoreApp,Version=v2.2) 😞
Scaffolding is not supported in netstandard. Only netcoreapp2.1+ and .NET 5.0+.
Thanks.
I received the same problem while trying to build a docker image : error CS0246: The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?). Target Framework : .net Core 3.0
Issue solved by adding in our csproj file (3.1 core app):
<ItemGroup> <FrameworkReference Include="Microsoft.AspNetCore.App" /> </ItemGroup>
Cant beleive this fixed it in VS2022 same issue crazy but its a .net 6 project is it safe to do that,
<FrameworkReference Include="Microsoft.AspNetCore.App" />
This worked for me thanks
This worked for me also, this solves it
I use Microsoft.Extensions.Hosting.Abstraction, but when compiling, I see an 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
Actual behavior:
Additional information about the project:
Target framework(s):
.Net Core 3.1
Package version of Microsoft.AspNetCore.App or Microsoft.AspNetCore.All (if applicable):
Microsoft.Extensions.Hosting.Abstraction v3.1.0