Set DisableImplicitFrameworkReferences for all projects (dotnet/corefx#34786)
authorEric StJohn <ericstj@microsoft.com>
Fri, 25 Jan 2019 16:59:14 +0000 (08:59 -0800)
committerGitHub <noreply@github.com>
Fri, 25 Jan 2019 16:59:14 +0000 (08:59 -0800)
* Set DisableImplicitFrameworkReferences for all projects

The SDK added targets which require the assets file when framework reference items are set.

We can disable the implicit FrameworkReference item in order to prevent these from running.

* Don't rely on implicit VB imports

DisableImplicitFrameworkReferences also doubles as DisableImplicitNamespaceImports.

Rather than enable this I think it's better just to stop relying on the default imports.

* Add missing reference to EventLog

Commit migrated from https://github.com/dotnet/corefx/commit/6653c5fe2adc7c7fca962df3fdc6675354726951

18 files changed:
eng/depProj.targets
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft.VisualBasic.Core.vbproj
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/FileSystem.Windows.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/FileSystem.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/MalformedLineException.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/SpecialDirectories.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileIO/TextFieldParser.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Helpers/NativeMethods.Windows.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Helpers/NativeTypes.vb
src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Helpers/UnsafeNativeMethods.vb
src/libraries/Microsoft.VisualBasic.Core/tests/VB/FileIOTestBase.vb
src/libraries/Microsoft.VisualBasic.Core/tests/VB/FileIOTests.vb
src/libraries/Microsoft.VisualBasic.Core/tests/VB/Helpers.vb
src/libraries/Microsoft.VisualBasic.Core/tests/VB/Microsoft.VisualBasic.VB.Tests.vbproj
src/libraries/Microsoft.VisualBasic.Core/tests/VB/SpecialDirectoriesTests.vb
src/libraries/Microsoft.VisualBasic.Core/tests/VB/TextFieldParserTests.vb
src/libraries/System.Diagnostics.EventLog/ref/System.Diagnostics.EventLog.csproj
src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj

index c202436..d032988 100644 (file)
@@ -36,8 +36,6 @@ See the LICENSE file in the project root for more information.
   <PropertyGroup>
     <!-- Always raise runtime/lib items even for frameworks that may not use them -->
     <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
-    <!-- Don't reference implicit framework packages, depprojs are meant to be wholy explicit -->
-    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
     <!-- We don't need the SDK to validate that we get runtime packages -->
     <EnsureRuntimePackageDependencies>false</EnsureRuntimePackageDependencies>
     <!-- don't generate netcoreapp files -->
index 91136a0..2f8301e 100644 (file)
     <Reference Include="System.Threading.Tasks" />
     <Reference Include="System.Threading.Thread" />
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetsUap)' == 'true'">
-    <!-- UAP is missing default imports -->
-    <Import Include="Microsoft.VisualBasic;System;System.Collections;System.Collections.Generic;System.Diagnostics;System.Linq;System.Xml.Linq;System.Threading.Tasks" />
-  </ItemGroup>
 </Project>
index f6b58a5..977a91e 100644 (file)
@@ -4,7 +4,9 @@
 Option Strict On
 Option Explicit On
 
+Imports System
 Imports System.ComponentModel
+Imports System.Diagnostics
 Imports System.Security
 Imports System.Runtime.Versioning
 Imports System.Text
index a04652f..08a1fbc 100644 (file)
@@ -3,8 +3,12 @@
 ' See the LICENSE file in the project root for more information.
 Option Strict On
 Option Explicit On
+
+Imports System
+Imports System.Collections
 Imports System.Collections.Specialized
 Imports System.ComponentModel
+Imports System.Diagnostics
 Imports System.Globalization
 Imports System.Security
 Imports System.Runtime.Versioning
index 0885133..1f5ca7c 100644 (file)
@@ -3,6 +3,8 @@
 ' See the LICENSE file in the project root for more information.
 Option Strict On
 Option Explicit On
+
+Imports System
 Imports System.Environment
 Imports System.Security
 Imports Microsoft.VisualBasic.CompilerServices.Utils
index 40dbb12..cfef037 100644 (file)
@@ -4,6 +4,8 @@
 Option Explicit On
 Option Strict On
 
+Imports System
+Imports System.Diagnostics
 Imports System.Security
 Imports System.Runtime.ConstrainedExecution
 Imports System.Runtime.InteropServices
index 9205b74..1f9d8dd 100644 (file)
@@ -2,6 +2,7 @@
 ' The .NET Foundation licenses this file to you under the MIT license.
 ' See the LICENSE file in the project root for more information.
 
+Imports System
 Imports System.Security
 Imports System.Runtime.InteropServices
 Imports System.Runtime.Versioning
index c66b565..7d0f1a4 100644 (file)
@@ -4,6 +4,7 @@
 Option Explicit On
 Option Strict On
 
+Imports System
 Imports System.Runtime.CompilerServices
 Imports Xunit
 Namespace Microsoft.VisualBasic.Tests.VB
index 368d368..15ede09 100644 (file)
@@ -5,7 +5,10 @@ Option Explicit On
 Option Strict On
 
 Imports Microsoft.VisualBasic.FileIO
+Imports System
+Imports System.Collections.Generic
 Imports System.Collections.ObjectModel
+Imports System.Linq
 Imports System.Runtime.CompilerServices
 Imports System.Runtime.InteropServices
 Imports System.Text
index 9bae201..a744ccc 100644 (file)
@@ -4,6 +4,7 @@
 Option Explicit On
 Option Strict On
 
+Imports System
 Imports System.Runtime.CompilerServices
 
 Namespace Microsoft.VisualBasic.Tests.VB
index 20c0f42..cfa3c78 100644 (file)
@@ -11,8 +11,4 @@
     <Compile Include="FileIOTests.vb" />
     <Compile Include="TextFieldParserTests.vb" />
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetsUap)' == 'true'">
-    <!-- UAP is missing default imports -->
-    <Import Include="Microsoft.VisualBasic;System;System.Collections;System.Collections.Generic;System.Diagnostics;System.Linq;System.Xml.Linq;System.Threading.Tasks" />
-  </ItemGroup>
 </Project>
index cf3855d..cdd8b10 100644 (file)
@@ -5,6 +5,7 @@ Option Explicit On
 Option Strict On
 
 Imports Microsoft.VisualBasic.FileIO
+Imports System
 Imports Xunit
 
 Namespace Microsoft.VisualBasic.Tests.VB
index 57b63a0..1179040 100644 (file)
@@ -13,6 +13,7 @@
   <ItemGroup Condition="'$(TargetsNetFx)' == 'true'">
     <Reference Include="mscorlib" />
     <Reference Include="System" />
+    <Reference Include="System.Core" />
   </ItemGroup>
   <ItemGroup Condition="'$(TargetsNetFx)' != 'true'">
     <ProjectReference Include="..\..\System.Security.Principal.Windows\ref\System.Security.Principal.Windows.csproj" />
index 81ce847..d78eb58 100644 (file)
@@ -2,13 +2,13 @@
   <PropertyGroup>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <IsPartialFacadeAssembly Condition="'$(TargetsNetFx)' == 'true'">true</IsPartialFacadeAssembly>
-    <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetGroup)' == 'netstandard'">SR.PlatformNotSupported_EventLog</GeneratePlatformNotSupportedAssemblyMessage>
+    <GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsNetStandard)' == 'true'">SR.PlatformNotSupported_EventLog</GeneratePlatformNotSupportedAssemblyMessage>
     <!-- Although we have a netstandard configuration, we know we are not currently UAP compatible-->
     <UWPCompatible>false</UWPCompatible>
     <ProjectGuid>{432779B9-3CBD-4871-A7DC-D8A192319DBD}</ProjectGuid>
     <Configurations>net461-Debug;net461-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netcoreapp2.0-Windows_NT-Debug;netcoreapp2.0-Windows_NT-Release;netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release</Configurations>
   </PropertyGroup>
-  <ItemGroup Condition="$(TargetGroup.StartsWith('netcoreapp'))">
+  <ItemGroup Condition="'$(TargetsNetCoreApp)' == 'true'">
     <Compile Include="System\Diagnostics\CompModSwitches.cs" />
     <Compile Include="System\Diagnostics\EntryWrittenEventArgs.cs" />
     <Compile Include="System\Diagnostics\EntryWrittenEventHandler.cs" />
   <ItemGroup Condition="'$(TargetsNetFx)' == 'true'">
     <Reference Include="mscorlib" />
     <Reference Include="System" />
+    <Reference Include="System.Core" />
   </ItemGroup>
   <ItemGroup Condition="'$(TargetsNetFx)' != 'true'">
     <Reference Include="Microsoft.Win32.Primitives" />