Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I am starting a new project in
ASP.NET Core 3.1
. In the model project they used these
3 packages
in
project_name.json
file:
"Microsoft.AspNetCore.Razor.Tools ": { "version":
"1.0.0-preview2-final", "type": "build" },
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.1"
And there was a
tools
section in
project_name.json file
:
"tools": { "Microsoft.AspNetCore.Server.IISIntegration.Tools":
"1.0.0-preview2-final", "Microsoft.AspNetCore.Razor.Tools":
"1.0.0-preview2-final"}
which adds
' "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final" '
.
I want to install the packages from
NuGet package manager
simply. But I am not finding:
Microsoft.AspNetCore.Razor.Tools
package there. I looked out what's its replacement but didn't come up with one.
And, there was a package
'Microsoft.AspNetCore.Mvc.Core'
that I replaced for
' "Microsoft.AspNetCore.Mvc": "1.0.1" '.
So, the questions are,
What is the replacement for
'Microsoft.AspNetCore.Razor.Tools'
? Is the package like
'Microsoft.AspNetCore.Razor'
in
NuGet
the replacement? Or should I add it manually in
.csproj
? If 'yes' then I think that the package is a little outdated as it last was updated in 2016. And, can I do that manually in
.csproj
as I can do in
project_name.json
?
How to configure the
tools
section? As there are no tools section now in the
.csproj
file like
project_name.json
file has.
Is
'Microsoft.AspNetCore.Mvc.Core'
is replacment for
'Microsoft.AspNetCore.Mvc'
?
Thank you
.
What is the replacement for 'Microsoft.AspNetCore.Razor.Tools'? Is the
package like 'Microsoft.AspNetCore.Razor' in NuGet the replacement? Or
should I add it manually in .csproj? If 'yes' then I think that the
package is a little outdated as it last was updated in 2016. And, can
I do that manually in .csproj as I can do in project_name.json?
Actually
, the package
Microsoft.AspNetCore.Razor.Tools
exists under
nuget.org
and it is just a preview version.
In
Nuget package management UI
, it has a set switch to separate the official and preview nuget packages.
You can refer to this:
Besides, you can add reference node directly in
xxx.csproj
file. The UI function is just download the related nuget package into the local and then modify
xxx.csproj
to add the
Reference
elements.
Add like these in your
xxx.csproj
:
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Razor.Tools" Version="1.0.0-preview2-final" />
</ItemGroup>
How to configure the tools section? As there are no tools section now
in the .csproj file like project_name.json file has.
So far, the latest Net Core does not support project.json format.Instead, they migrate it into xxx.csproj
file.
So in the new Net Core 3.1 project, you should change xxx.csproj
to add them.
This document shows how to migrate each node in project.json
file to xxx.csproj
file.
About tools section, you can see this, use DotNetCliToolReference
selection in xxx.csproj
file.
Solution
For your issue, you should add like this in your xxx.csproj
file:
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.AspNetCore.Server.IISIntegration.Tools" Version="1.0.0-preview2-final" />
</ItemGroup>
Then you can use it.
Is 'Microsoft.AspNetCore.Mvc.Core' is replacment for
'Microsoft.AspNetCore.Mvc'?
They are quite different from each other. Each has its own feature.
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.