Skip to content

NH-3990 - Upgrade VB test project to VS2017 project structure #670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 39 additions & 142 deletions src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj
Original file line number Diff line number Diff line change
@@ -1,160 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>
</SchemaVersion>
<ProjectGuid>{7C2EF610-BCA0-4D1F-898A-DE9908E4970C}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>NHibernate.Test.VisualBasic</RootNamespace>
<AssemblyName>NHibernate.Test.VisualBasic</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkProfile />
<StartAction>Program</StartAction>
<StartProgram>$(MSBuildProjectDirectory)\..\..\Tools\nunit\nunit-x86.exe</StartProgram>
<StartArguments>NHibernate.Test.VisualBasic.dll</StartArguments>
<TargetFramework>net461</TargetFramework>
<GenerateAssemblyTitleAttribute>False</GenerateAssemblyTitleAttribute>
<GenerateAssemblyProductAttribute>False</GenerateAssemblyProductAttribute>
<GenerateAssemblyCompanyAttribute>False</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyDescriptionAttribute>False</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyVersionAttribute>False</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>False</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>False</GenerateAssemblyInformationalVersionAttribute>
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>NHibernate.Test.VisualBasic.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DocumentationFile>NHibernate.Test.VisualBasic.xml</DocumentationFile>
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=3.6.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>

<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Diagnostics" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Compile Remove="Issues\NH3302\**" /> <!--"Like" not supported in new dotnet compiler, not implemented anyways in .net framework-->
Copy link
Member

@hazzik hazzik Aug 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed this. '"Like" not supported in new dotnet compiler' is not actually true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I meant that it's not implemented in the full .NET Framework version of NHibernate. At least it's ignored in the tests:

        <TestFixture(), Ignore("Not fixed yet.")> _

I don't actually know if it has been fixed, as I didn't try running it. Either way, the whole file doesn't compile with dotnet build.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because Microsoft.VisualBaaic assembly is not referenced

</ItemGroup>

<ItemGroup>
<Compile Include="..\SharedAssemblyInfo.vb">
<Link>SharedAssemblyInfo.vb</Link>
</Compile>
<Compile Include="AssemblyInfo.vb" />
<Compile Include="Issues\NH2966\Client.vb" />
<Compile Include="Issues\NH2966\Fixture.vb" />
<Compile Include="Issues\NH3302\Entity.vb" />
<Compile Include="Issues\NH3302\Fixture.vb" />
<Compile Include="Issues\NH2963\Entity.vb" />
<Compile Include="Issues\NH2963\Fixture.vb" />
<Compile Include="Issues\NH0000\Entity.vb" />
<Compile Include="Issues\NH0000\Fixture.vb" />
<Compile Include="Issues\IssueTestCase.vb" />
<Compile Include="Issues\NH2545\Fixture.vb" />
<Compile Include="Issues\NH2545\Entity.vb" />
<Compile Include="Issues\NH2966\Order.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Remove="**\*.hbm.xml" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="**\*.hbm.xml" Exclude="bin\**\*.*" />
</ItemGroup>

<ItemGroup>
<None Include="..\NHibernate.Test\App.config">
<Link>App.config</Link>
<SubType>Designer</SubType>
</None>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
<None Include="packages.config" />
<Compile Include="..\SharedAssemblyInfo.vb" Link="SharedAssemblyInfo.vb" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NHibernate.Test\NHibernate.Test.csproj">
<Project>{7AEE5B37-C552-4E59-9B6F-88755BCB5070}</Project>
<Name>NHibernate.Test</Name>
</ProjectReference>
<ProjectReference Include="..\NHibernate\NHibernate.csproj">
<Project>{5909BFE7-93CF-4E5F-BE22-6293368AF01D}</Project>
<Name>NHibernate</Name>
</ProjectReference>
<None Include="..\NHibernate.Test\App.config" Link="App.config" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Issues\NH2545\Issues.NH2545.Mappings.hbm.xml" />
<PackageReference Include="Antlr3.Runtime" Version="3.5.1" />
<PackageReference Include="Iesi.Collections" Version="4.0.2" />
<PackageReference Include="log4net" Version="2.0.8" />
<PackageReference Include="nunit" Version="3.7.1" />
<PackageReference Include="Remotion.Linq" Version="2.1.2" />
<PackageReference Include="Remotion.Linq.EagerFetching" Version="2.1.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.7.6" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.3.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Issues\NH0000\Issues.NH0000.Mappings.hbm.xml" />
<ProjectReference Include="..\NHibernate\NHibernate.csproj" />
<ProjectReference Include="..\NHibernate.Test\NHibernate.Test.csproj" ExcludeAssets="ContentFiles" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Issues\NH2966\Issues.NH2966.Mappings.hbm.xml" />
<EmbeddedResource Include="Issues\NH3302\Issues.NH3302.Mappings.hbm.xml" />
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

</Project>
4 changes: 0 additions & 4 deletions src/NHibernate.Test.VisualBasic/packages.config

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,11 @@ public ForceEscalationToDistributedTx() : this(false) {}

public void Prepare(PreparingEnlistment preparingEnlistment)
{
Assert.AreNotEqual(thread, Thread.CurrentThread.ManagedThreadId);
if (thread == Thread.CurrentThread.ManagedThreadId)
{
log.Warn("Thread.CurrentThread.ManagedThreadId ({0}) is same as creation thread");
}

if (shouldRollBack)
{
log.Debug(">>>>Force Rollback<<<<<");
Expand Down
8 changes: 7 additions & 1 deletion src/NHibernate.Test/NHibernate.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@
<PackageReference Include="Antlr3.Runtime" Version="3.5.1" />
<PackageReference Include="Iesi.Collections" Version="4.0.2" />
<PackageReference Include="log4net" Version="2.0.8" />
<PackageReference Include="nunit" Version="3.6.0" />
<PackageReference Include="nunit" Version="3.7.1" />
<PackageReference Include="Remotion.Linq" Version="2.1.2" />
<PackageReference Include="Remotion.Linq.EagerFetching" Version="2.1.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.7.6" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.3.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -60,4 +62,8 @@
<Reference Include="System.Transactions" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="3.6.0" />
<PackageReference Include="nunit" Version="3.7.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -32,4 +34,8 @@
</Reference>
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
12 changes: 10 additions & 2 deletions src/NHibernate/Linq/Functions/CompareGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,17 @@ internal static bool IsCompareMethod(MethodInfo methodInfo)
return true;

// This is .Net 4 only, and in the System.Data.Services assembly, which we don't depend directly on.
return methodInfo != null && methodInfo.Name == "Compare" &&
if (methodInfo != null && methodInfo.Name == "Compare" &&
methodInfo.DeclaringType != null &&
methodInfo.DeclaringType.FullName == "System.Data.Services.Providers.DataServiceProviderMethods";
methodInfo.DeclaringType.FullName == "System.Data.Services.Providers.DataServiceProviderMethods")
return true;

if (methodInfo != null && methodInfo.Name == "CompareString" &&
Copy link
Member

@hazzik hazzik Aug 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is normally handled by VBStringComparisonExpression. The VB Core/New Roslyn case will be fixed in re-linq 2.2 (it's in alpha-3 now)

Copy link
Contributor Author

@ngbrown ngbrown Aug 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Is this work-around fine for now, or should NHibernate depend on the alpha package?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, test with 2.2-alpha3 and wait for the official release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This work-around will have to stay till re-linq 2.2.0-alpha-004.

methodInfo.DeclaringType != null &&
(methodInfo.DeclaringType.FullName == "Microsoft.VisualBasic.CompilerServices.EmbeddedOperators"))
return true;

return false;
}


Expand Down