Skip to content

Commit

Permalink
Fix VS experience (dotnet#4007)
Browse files Browse the repository at this point in the history
dotnet#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 dotnet#3998
  • Loading branch information
RussKie authored and AdamYoblick committed Sep 25, 2020
1 parent d0dbeb1 commit 49ec003
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
54 changes: 27 additions & 27 deletions eng/packageContent.targets
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 2 additions & 0 deletions start-vs.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 49ec003

Please sign in to comment.