Skip to content

Commit

Permalink
Add support for VB.NET projects
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Jun 28, 2024
1 parent ae01d87 commit 19e67ad
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<BaseIntermediateOutputPath>$(RepoRootPath)obj\$([MSBuild]::MakeRelative($(RepoRootPath), $(MSBuildProjectDirectory)))\</BaseIntermediateOutputPath>
<BaseOutputPath Condition=" '$(BaseOutputPath)' == '' ">$(RepoRootPath)bin\$(MSBuildProjectName)\</BaseOutputPath>
<PackageOutputPath>$(RepoRootPath)bin\Packages\$(Configuration)\</PackageOutputPath>
<LangVersion>12</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AnalysisLevel>latest</AnalysisLevel>
Expand Down
4 changes: 4 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<LangVersion Condition="'$(Language)'=='C#'">12</LangVersion>
<LangVersion Condition="'$(Language)'=='VB'">16.9</LangVersion>
</PropertyGroup>
<ItemGroup>
<!-- Avoid compile error about missing namespace when combining ImplicitUsings with .NET Framework target frameworks. -->
<Using Remove="System.Net.Http" Condition="'$(TargetFrameworkIdentifier)'=='.NETFramework'" />
Expand Down
6 changes: 6 additions & 0 deletions src/AssemblyInfo.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
' Copyright (c) COMPANY-PLACEHOLDER. All rights reserved.
' Licensed under the MIT license. See LICENSE file in the project root for full license information.

Imports System.Runtime.InteropServices

<Assembly: DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)>
3 changes: 2 additions & 1 deletion src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.cs" Condition=" '$(Language)'=='C#' " />
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.vb" Condition=" '$(Language)'=='VB' " />
</ItemGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove($(MSBuildThisFile), $(MSBuildThisFileDirectory)..))" />
Expand Down

0 comments on commit 19e67ad

Please sign in to comment.