* release/2.1.3xx:
Updating the CLI stage0 to 2.1.300 and fixing some build failures.
Update Microsoft.NETCore.App Package Version
Formatting...
Drop the LZMA archive for every build.
This commit implements a `mode` option that can control how an application is
published with the `dotnet publish` command.
There are three supported modes:
* self-contained: publishes a self-contained application (same as
--self-contained).
* fx-dependent: publishes a framework-dependent application (with an
application host when a runtime is specified).
* fx-dependent-no-exe: publishes a framework-dependent application without an
application host.
The default when publishing without a runtime specified is
`fx-dependent-no-exe`.
The default when publishing with a runtime specified is `self-contained`.
`fx-dependent` requires netcoreapp2.1 or later when a runtime is specified.
The `--self-contained` option is still supported, but is now hidden so that
users will be encouraged to move to the `--mode` option.
Fixes#6237.
There is no need to store relative path today. But some part of the system does not accept relative path and there is no indication if it is storing full path or not. This is the root cause of https://github.com/dotnet/cli/issues/9319
“someplace” means different full path for Path class on unix and Windows. And the mock file system uses real Path class. Change tests' setup to use essentially “TEMPATH/someplace” instead of “someplace”
This reverts commit f9b939fe89.
That fix caused a regression that prevented a single `/property` option to
define multiple properties using the `/property:First=foo;Second=bar` syntax.
Users that want literal semicolons in the property values should use escaped
quotes around the property value, e.g. `/property:Prop='"foo;bar;baz"'`.
Fixes#9369.
Currently, dotnet will crash with an `ArgumentNullException` if `USERPROFILE`
(Windows) or `HOME` (macOS and Linux) is not set in the environment. This
is because there is a missing null check after retrieving the environment
variable's value. Additionally, if either variable is set to an empty string,
a `.dotnet` directory is created in the current directory where dotnet is being
run.
This commit fixes this by printing a graceful error informing the user the home
directory could not be determined and to set `DOTNET_CLI_HOME` to the directory
to use. This variable will be respected before `USERPROFILE` or `HOME`. It is
likely that CI environments where `HOME` is not set can use `DOTNET_CLI_HOME`
to specify a local temporary location; by using this variable rather than
setting `HOME`, it is guaranteed to only affect dotnet.
It was discussed that we should perhaps fallback to some temporary location if
the home directory could not be determined, but NuGet currently requires `HOME`
to be set to work. Because of this, it was decided that we should just handle
this case gracefully and provide a way for users to override the home directory
without relying on `USERPROFILE`/`HOME` entirely.
Closes#8053.
This commit attempts to make the command line help user experience for `dotnet`
more consistent for all of the built-in SDK commands.
The following has been changed:
* Organized the top-level help into a section detailing how to run .NET
applications and a section on running SDK commands.
* Sorted the SDK commands by name (previous ordering was undefined).
* Removed `--verbosity` from the "common options section" since it is not a
top-level option, nor is it common to all commands.
* Added missing parameter names for parameterized options (especially for the
`dotnet tool` subcommands).
* Fixed the localization of parameter names for parameterized options.
* Added missing `PROJECT` parameter to a few commands.
* Fixed the localization of the build command's `PROJECT` parameter description.
* Fixed the confusing descriptions for the `--framework`, `--configuration`,
and `--runtime` options that were being shared between different commands.
* Fixed the "unknown command" error for `dotnet help <command>` to show in red.
* Deleted .resx for `dotnet msbuild` that is no longer used.
* Change the option descriptions to be more consistent in their grammatical
structure.
* Removed extra blank line from end of help output.
Fixes#7431.
Fixes#9230.
Fixes#9165.
This commit adds a few simple unit tests to cover the `dotnet complete`
command.
It only checks the top-level output, integration with the `new`
command from the templating engine, and the custom `nuget` command parser that
is solely intended for use with `dotnet complete`.
This commit improves command completion by updating the `new` and `nuget` parsers to
match their current supported syntax. Removes the unnecessary description
strings that were not used (these commands are parsed by assemblies external to
the CLI). The top level options are also sync'd to the currently supported
options.
Additionally, it unhides the `msbuild` and `vstest` commands so that `dotnet
complete` suggests them.
Fixes#9286.
The `dotnet sln list` command uses `Project reference(s)` as the header for the
output instead of `Project(s)`. To be consistent with Visual Studio, the header
should refer to these as projects rather than project references as users can't
add "project references" to a solution.
This commit changes the header to `Project(s)`.
Additionally, the command now filters out solution folders and only shows
projects.
Fixes#9246.
Commit 10289504a8 changed the default verbosity
option used for MSBuild from `-v:quiet` to `-verbosity:quiet`. This triggered a
match that was being done against arguments starting with `-verbosity` to
forward the value to VSTest via the `VSTestVerbosity` property. The result is
that VSTest is using a default verbosity of `quiet`, suppressing error output
that users expect to see.
The fix is to change the check to only match against user-supplied options.
The default level the command uses for MSBuild is not forwarded to VSTest.
Fixes#9229.
do as part of first run based on whether this is the invoke-reportsuccess from a native installer or a regular command
being invoked for the first time. This in turn allows us to ignore the skip first run variable on native installers and
expand the cache always in those cases.
This commit fixes adding the tools directory to the user's PATH for the native
installers.
The issue was a regression caused by #8886. The change used a "no-op" sentinel
file that reported it existed. This "no-op" sentinel was used for the native
installers. Unlike the other "no-op" sentinels used by the native installer,
we do want PATH to be modified by the native installer.
The fix is to change the "no-op" sentinel to report the file doesn't exist, but
also to not to attempt to create the file.
This fixes#9208.
The `GivenFailedPackageInstallWhenRunWithPackageIdItShouldFail` test should
match against `ToolInstallationFailedWithRestoreGuidance` and not
`ToolInstallationFailed`. This passed prior to the LOC update because
the former started with the latter and a "contains" match was being performed.
On Windows, the Razor server correctly creates the pid file with
`FileAccess.Write` and `FileOptions.DeleteOnClose`. This requires a share mode
of `FileShare.Write | FileShare.Delete` to open. However, the
`dotnet build-server shutdown` command was opening the file with
`FileShare.Read`. As a result, an `IOException` was being thrown and was not
handled.
This change first opens the file with the appropriate share access and also
properly handles a failure to access or read the contents of the pid file.
Additionally, an integration test was added to test that Razor server shutdown
works as expected.
Fixes#9158.
This commit ensures that any `/property` option's value is surrounded by quotes
to allow MSBuild to properly interpret special characters like semicolons.
Users familiar with MSBuild expect `/property:Name="Value"` to handle
semicolons. However, since `dotnet` parses the command line first, the
quotes get processed by its command line parser. This results in
`/property:Name=Value` being passed to MSBuild, which will not parse a "Value"
containing a semicolon correctly.
Since it is safe to always quote the property value for this option, this fix
simply ensures that the value is surrounded by quotes.
This fixes the issue for all commands that forward arguments to MSBuild.
Fixes#7791.
Commit 9cc2b7cd2f regressed the `--source-feed`
option so that it no longer accepted relative paths. Because the option is now
saved to the temp project file, any relative paths specified by the
`--source-feed` option were made relative to the temp project path and not from
the current working directory of where dotnet was run.
The fix is to use `Path.GetFullPath` of the `--source-feed` option, provided
the option specified was not an absolute URI.
Fixes#9132.
Should use MsBuildProjectExtensionsPath instead.
Change the property passin by project file instead of command line. It is more reliable passing path in xml and also the timing of MsBuildProjectExtensionsPath is controlled. (Before loading SDK)
Change mock fake project to use “;” instead, since c:\path contains “:”.
Test build was causing restore and build in same evaluation, which was
always incorrect, but with a recent change to sdk, it will always fail
outright instead of sometimes getting lucky enough for it not to matter.
This was therefore a breaking change and we will discuss separately how
to handle it. This takes the bad pattern out of the test build to unblock
the build.
Previously, Razor server discovery for the `build-server shutdown` command was
implemented by invoking MSBuild on a project file in the current directory to
evaluate the path to the Razor server dll. This was problematic since it would
only discover a single running Razor server instance and required that the user
run the `build-server shutdown` command from a specific location.
Razor's server now writes a "pid file" to a well-known location
(`~/.dotnet/pids/build`) which the command can now enumerate to discover, and
shutdown, the running Razor servers.
This commit changes the Razor server discovery to use the pid files and removes
the requirement that users need to run the command in specific directories to
work.
Fixes#9084.
Give a different error to guide use to install via global tools so, if several bundled DotnetTools cannot finish source build on time. The user can use global tools to get it.
The original plan that adding a different resolver is hard due to resolver can only find dll that will be used to spawn a process. However, the command constructor will give an error message when resolver find null. By adding a different error when the command name is part of the list, it can achieve the same goal.
If there are shims packaged by convention in nupkg. Shim Repository will simply copy it to the right location.
The query interface ToolPackageInstance will be in charge of finding the shim folder and filter the right RID. Shim Repository will pick the right file after the folder is located since Shim Repository knows the shim name and it also book keep the files at uninstallation.
During development, due to the wrong adapter level. The mock duplicated too much logic. So, I corrected the abstraction level to lower (only create shim). And replaced the existing mock with a much smaller one without any atomic control and file move, copy logic. At the same time. The chmod, which is a IO action, causes problem during tests. So I added adapter layer to it and put it in Util.
* release/2.1.1xx:
Fixing another typo in that is breaking RHEL.
Fix a typo in the rpm.targets when testing the rpm generated packages.
Update to aspnet 2.0.7 build 230
Producing an empty commit to trigger a rebuild of the CLI
Fix AspNetCoreRuntimeBuildDropFeed to use CoreSetupBlobRootUrl
Adding a work around for publishing self-contained apps to RIDs that are not available for Microsoft.NETCore.App 2.0.0.
Reverse the order in which old runtime stores are listed
Update to ASP.NET Core 2.0.7 build 228
Moving the opensuse 43.2 docker file to the right folder.
Updating the CLI branding to 2.1.105, to go over the 104 release we will have to do for NuGet. Also, fixed the branding of the runtime in our installers to 2.0.7.
Updating the runtime to 2.0.7 and the CLI branding to 2.1.104.
Update SDK to 2.1.100-preview-62730-07
Add msbuild myget.org feed
MSBuild 15.6.84
Conflicts:
build/Branding.props
build/DependencyVersions.props
build/NugetConfigFile.targets
build/Version.props
packaging/osx/clisdk/resources/cs.lproj/conclusion.html
packaging/osx/clisdk/resources/de.lproj/conclusion.html
packaging/osx/clisdk/resources/en.lproj/conclusion.html
packaging/osx/clisdk/resources/es.lproj/conclusion.html
packaging/osx/clisdk/resources/fr.lproj/conclusion.html
packaging/osx/clisdk/resources/it.lproj/conclusion.html
packaging/osx/clisdk/resources/ja.lproj/conclusion.html
packaging/osx/clisdk/resources/ko.lproj/conclusion.html
packaging/osx/clisdk/resources/pl.lproj/conclusion.html
packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html
packaging/osx/clisdk/resources/ru.lproj/conclusion.html
packaging/osx/clisdk/resources/tr.lproj/conclusion.html
packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html
packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html
packaging/windows/clisdk/bundle.wxl
On environments where registry access is disabled, the first run experience
fails because it could not add the tools path to the user's environment.
This fix properly handles the security exception by printing a warning and
continuing. Users will have to manually add the PATH environment variable to
their environments to prevent `dotnet tool install` from printing PATH
instructions.
A new file sentinel is added to track whether or not the PATH has been
modified. The first run experience also now correctly skips modifying the PATH
if `DOTNET_SKIP_FIRST_TIME_EXPERIENCE` is set.
Fixes#8874.
This commit checks that the `--tool-path` option for the `tool list` and `tool
uninstall` commands is a directory that exists.
If the directory does not exist, an error and the command help is displayed.
Fixes#8931.
* Publish app host to folder under SDK
* Use carried apphost as shim
* Remove full framework launcher
* Fix test run command issue
* Use latest release/2.1 build
* Test with 32 bit env
* Add missing return
* Update to latest prodcon build
* Add xlfs
This commit implements the `buildserver shutdown` command that can be used to
shutdown MSBuild, VB/C# compiler, and Razor build servers.
By default, all three build servers are shut down. Options can be passed to
shut down a subset of the build servers.
Fixes#8185.
This commit ensures the correct property (`ProjectTypeGuids`) is respected when
adding a project to a solution file.
Additionally, we now error if a project type GUID cannot be determined rather
than incorrectly mapping to the C# project type.
Enabled previously disabled tests that were waiting on upstream changes from
MSBuild and F#.
Fixes#5131.
Fixes#7742.
* Move some projects to netstandard2.0
* Use version agnostic $(TargetFrameworkIdentifier) property to make changing versions easier since we only care about .NET Framework vs .NET Standard
* Add missing project to solution file
* Update TestPackageProjects.targets to use netstandard2.0 on non-Windows
This commit implements the missing `--tool-path` option for the list tool
command. This enables the command to list locally installed tools.
Fixes#8803.
This commit fixes the tool package store such that it stores a full path
instead of, potentially, a relative path.
This prevents a relative path from inadvertently being passed to NuGet
during the restore and causing it to restore relative to the temp project
directory.
Fixes#8829.
Currently the list tool command tests, while localizing the column headers,
didn't properly take into account the fact that localized builds might produce
strings longer than the English versions of the column header strings. This
results in a mismatch of the actual from the expected due to additional column
padding.
The fix is to stop using a static expected table and do a simple calculation of
the expected table based on the length of the localized strings.
Fixes issue related to PR #8799.
Other than change source to source-feed and make it additional instead of exclusive. I changed source to be multiple. Because restore support multiple source https://github.com/Microsoft/dotnet/issues/361
As for mock. The offline feed and source feed is considered the same, so remove the category of “source”. I renamed source to “AdditionalFeed” because that is more accurate on implementation level.
Note:
NuGet feed don’t have order. Whichever responses the fastest, is the first.
No change on restore.
scripts/cli-test-env.sh change is due to mac 10.13 is finally added to RID graph. And it is “considered” one of the CLI supported RID
This commit fixes the ToolPackageInstaller tests so that they no longer modify
the current working directory. The directory being set is now being properly
passed in as an argument to override the default of the current working
directory.
Additionally, this commit also changes the package root to a temp location
rather than based off of the current working directory.
This commit attempts to filter the diagnostic messages emitted during tool
installation. The diagnostic messages may be prefixed with the temporary
project; since this is an implementation detail that only causes confusion and
clutter in the diagnostic messages, the prefix is removed if present.
Fixes#8707.
* Change to escape string via XML
* tool-path option -- "Session tool"
From the beginning design, shim and packageInstaller take package location from constructor and don't have assumption anymore. From previous discussion, tool-path will simply change global location to the one user want, and everything else is the same.
However, this "override" need to happen during the call, that means InstallToolCommand will create different shim and packageInstaller object according to the tool-path during the call instead of constructor DI.
* global package location change
* block of leading dot as command name
* Localization of tool-path option
This commit fixes the case sensitivity of tool package identifiers.
Previously the install and uninstall commands unintentionally required the tool
package ids to specified in all lowercase for the install / uninstall to work.
Fixes#8682.