Browse Source

Fix VS experience (#4007)

#3998 has regressed VS experience due to changed packageContent.targets,
that no longer could resolve $(IntellisenseXml) variable.
This prevented VS from resolving tooling and dependnecies.
To fix this move all properties within `GetPackageContent` target.

Also run `restore.cmd` before launching VS. This is reqired to ensure
the intellisense bundle, as well as all required SDK and tooling are
downloaded.
This streamlined the DevEx.

Relates to #3998
pull/4010/head
Igor Velikorossov 5 years ago
committed by GitHub
parent
commit
81c9744a43
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 54
      eng/packageContent.targets
  2. 2
      start-vs.cmd

54
eng/packageContent.targets

@ -1,38 +1,38 @@
<Project>
<PropertyGroup>
<RefPackagePath Condition="'$(RefPackagePath)' == ''">ref/$(TargetFramework)</RefPackagePath>
<IncludePdbInPackage Condition="'$(IncludePdbInPackage)' == '' AND '$(IsFacadeAssembly)' != 'true' AND '$(DebugType)' != 'embedded'">true</IncludePdbInPackage>
<IncludeResourcesInPackage>true</IncludeResourcesInPackage>
</PropertyGroup>
<Target Name="GetPackageContent"
DependsOnTargets="SatelliteDllsProjectOutputGroup"
Returns="@(PackageFile)">
<PropertyGroup Condition="'$(PackagePath)' == ''">
<PackagePath>lib/$(TargetFramework)</PackagePath>
<PackagePath Condition="'$(IsFacadeAssembly)' == 'true'">lib/$(TargetFramework);$(RefPackagePath)</PackagePath>
</PropertyGroup>
<PropertyGroup>
<RefPackagePath Condition="'$(RefPackagePath)' == ''">ref/$(TargetFramework)</RefPackagePath>
<IncludePdbInPackage Condition="'$(IncludePdbInPackage)' == '' AND '$(IsFacadeAssembly)' != 'true' AND '$(DebugType)' != 'embedded'">true</IncludePdbInPackage>
<IncludeResourcesInPackage>true</IncludeResourcesInPackage>
</PropertyGroup>
<PropertyGroup>
<!-- Also in global.json -->
<DotNetApiDocsNet50>0.0.0.1</DotNetApiDocsNet50>
<PropertyGroup Condition="'$(PackagePath)' == ''">
<PackagePath>lib/$(TargetFramework)</PackagePath>
<PackagePath Condition="'$(IsFacadeAssembly)' == 'true'">lib/$(TargetFramework);$(RefPackagePath)</PackagePath>
</PropertyGroup>
<!--
The xml file should ALWAYS come from the dotnet-api-docs artifact.
This blob lives in Azure storage at https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/dotnet-api-docs_net5.0/
Instructions for updating these artifacts are at https://github.com/dotnet/winforms/blob/master/docs/intellisense.md
-->
<IntellisenseXmlDir>$(CommonLibrary_NativeInstallDir)\bin\dotnet-api-docs_net5.0\$(DotNetApiDocsNet50)\_intellisense\net-5.0\</IntellisenseXmlDir>
<IntellisenseXmlFileSource>$(IntellisenseXmlDir)$(AssemblyName).xml</IntellisenseXmlFileSource>
<PropertyGroup>
<!-- Also in global.json -->
<DotNetApiDocsNet50>0.0.0.1</DotNetApiDocsNet50>
<!-- Set the xml destination (for a later step that copies files from the dotnet-api-docs to local build artifacts) -->
<IntellisenseXmlDest Condition="'$(ProduceReferenceAssembly)' == 'true' And '$(PackageAsRefAndLib)' != 'true'" >$([System.IO.Path]::ChangeExtension('$(TargetRefPath)', '.xml'))</IntellisenseXmlDest>
<IntellisenseXmlDest Condition="'$(PackageAsRefAndLib)' == 'true'" >$([System.IO.Path]::ChangeExtension('$(TargetPath)', '.xml'))</IntellisenseXmlDest>
<IntellisenseXmlDestDir Condition="'$(IntellisenseXmlDest)' != ''">$([System.IO.Path]::GetDirectoryName('$(IntellisenseXml)'))</IntellisenseXmlDestDir>
<!--
The xml file should ALWAYS come from the dotnet-api-docs artifact.
This blob lives in Azure storage at https://netcorenativeassets.blob.core.windows.net/resource-packages/external/windows/dotnet-api-docs_net5.0/
Instructions for updating these artifacts are at https://github.com/dotnet/winforms/blob/master/docs/intellisense.md
-->
<IntellisenseXmlDir>$(CommonLibrary_NativeInstallDir)\bin\dotnet-api-docs_net5.0\$(DotNetApiDocsNet50)\_intellisense\net-5.0\</IntellisenseXmlDir>
<IntellisenseXmlFileSource>$(IntellisenseXmlDir)$(AssemblyName).xml</IntellisenseXmlFileSource>
</PropertyGroup>
<!-- Set the xml destination (for a later step that copies files from the dotnet-api-docs to local build artifacts) -->
<IntellisenseXmlDest Condition="'$(ProduceReferenceAssembly)' == 'true' And '$(PackageAsRefAndLib)' != 'true'" >$([System.IO.Path]::ChangeExtension('$(TargetRefPath)', '.xml'))</IntellisenseXmlDest>
<IntellisenseXmlDest Condition="'$(PackageAsRefAndLib)' == 'true'" >$([System.IO.Path]::ChangeExtension('$(TargetPath)', '.xml'))</IntellisenseXmlDest>
<IntellisenseXmlDestDir Condition="'$(IntellisenseXmlDest)' != ''">$([System.IO.Path]::GetDirectoryName('$(IntellisenseXml)'))</IntellisenseXmlDestDir>
<Target Name="GetPackageContent"
DependsOnTargets="SatelliteDllsProjectOutputGroup"
Returns="@(PackageFile)">
</PropertyGroup>
<!--
If this file does NOT exist, and the assembly is NOT a facade assembly, this is an error.

2
start-vs.cmd

@ -13,6 +13,8 @@ set DOTNET_MULTILEVEL_LOOKUP=0
:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
set PATH=%DOTNET_ROOT%;%PATH%
call restore.cmd
if not exist "%DOTNET_ROOT%\dotnet.exe" (
echo [ERROR] .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
exit /b 1

Loading…
Cancel
Save