Intent.VisualStudio.Projects
This Intent Architect module adds the Visual Studio
Designer to an Intent Architect Application, generates and manages both Visual Studio .sln
and .NET .csproj
files.
The .NET Settings stereotype
The Suppress Warnings
property
Adds a <NoWarn />
element to the .csproj
file with the specified value of semi-colon separated codes of warnings to suppress.
By default this is populated with the value $(NoWarn)
which will apply the default suppressed warnings. While this value is set to $(NoWarn)
, no <NoWarn />
element will be added to the .csproj
file.
;1561
is automatically appended by some Intent Architect application templates to suppress the Missing XML comment for publicly visible type or member 'Type_or_Member' warning.
Central Package Management
In .NET, Central Package Management (CPM) allows management of versions of NuGet packages for multiple .csproj
from a central Directory.Packages.props
file and an MSBuild property.
To have Intent Architect automatically create and manage a Directory.Packages.props
file for a solution, on the Visual Studio Solution Options stereotype, check the Manage Package Versions Centrally property.
Once enabled, PackageReference
items .csproj
files will by default no longer add a Version
attributes added to them and any existing ones will be removed.
Once Manage Package Versions Centrally
is enabled, several options become available to control where the Directory.Packages.props
file is output.
Available Output Location Options
Same as .sln file (default):
TheDirectory.Packages.props
file will be placed in the same directory as the solution (.sln
) file.Relative Path:
TheDirectory.Packages.props
file will be placed at the specified relative path field value, which is resolved against the solution (.sln) file location.- Relative Path field:
This field is only available when the Output Location is set to Relative Path. For example, setting the value to../
will result in the output folder being one folder higher than the solution file location.
- Relative Path field:
Check Parent Folders:
The system will check parent directories (starting from the solution file's location) for an existingDirectory.Packages.props
file. If found, that file will be used; otherwise, a new one will be created in the solution (.sln) file's directory.- Only Check Current Git Repository (checkbox):
This option is available when Check Parent Folders is selected. If enabled, the search will stop at the root of the current Git repository (i.e., the first directory containing a.git
folder).
- Only Check Current Git Repository (checkbox):
Managing Project Package Versions
It is also possible to control the behaviour of a single project by setting the Manage Package Versions property on its stereotype:
The following options are available:
(unmanaged) - Intent will not add, change or remove the
ManagePackageVersionsCentrally
property in the.csproj
file.(unspecified) - Intent will ensure there is no
ManagePackageVersionsCentrally
property in the.csproj
file removing it if necessary.Version
attributes will be added toPackageReference
items depending on whether or not the Solution has the CPM option set.false - Intent will ensure the
ManagePackageVersionsCentrally
property is present with a value offalse
and regardless of the the Solution's CPM setting,Version
attributes will always be added toPackageReference
items.true - Intent will ensure the
ManagePackageVersionsCentrally
property is present with a value oftrue
and regardless of the the Solution's CPM setting,Version
attributes will be removed fromPackageReference
items.
Note
Regardless of the project level's Manage Package Versions setting, unless the solution has Manage Package Versions Centrally set, Intent will not update or manage PackageVersion
items for a Directory.Packages.props
file.
Use top-level statements
When enabled the Program.cs
will no longer generate a class and instead use top-level statements.
Note
Requires at least version 6.0.0
of the Intent.Modules.AspNetCore
to be installed in order for changes to take effect.
Use minimal hosting model
When enabled Startup.cs
will no longer be generated and all start-up will be performed in Program.cs
by of the new minimal hosting model introduced with .NET 6.
Note
Requires at least version 6.0.0
of the Intent.Modules.AspNetCore
to be installed in order for changes to take effect.