question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build conflict with SqlDbType

See original GitHub issue

A thread was started on an old EF Core issue that evolved into something which may be an issue with M.D.SqlClient, or should probably at least be investigated.

See https://github.com/aspnet/EntityFrameworkCore/issues/7820

Snippet of build output:

1>Build FAILED.
1>
1>TVPBuilder.cs(48,29,48,38): error CS0433: The type 'SqlDbType' exists in both 'System.Data.Common, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Data.SqlClient, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
1>Program.cs(13,92,13,101): error CS0433: The type 'SqlDbType' exists in both 'System.Data.Common, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Data.SqlClient, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
1>    0 Warning(s)
1>    2 Error(s)
1>
1>Time Elapsed 00:00:00.38

@slubowsky reported the issue, and @ErikEJ (one of our top contributors) has been able to reproduce it. I’m sure they will be wiling to help as needed if you need more information.

/cc @David-Engel @vickyharp @divega

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

11reactions
ErikEJcommented, Aug 1, 2019

Confirmed that adding a newer reference fixes the issue:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Data.SqlClient" Version="1.0.19189.1-Preview" />
    <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.8.0-beta1" />
    <PackageReference Include="System.Data.SqlClient" Version="4.6.1" />
  </ItemGroup>

</Project>
1reaction
David-Engelcommented, Aug 1, 2019

I think Wraith2’s suggestion may work around it (add a newer reference yourself). But you probably need to file an issue in the Application Insights server repo and ask them to update the version they depend on since that old System.Data.SqlClient version is where the issue lies: https://github.com/microsoft/ApplicationInsights-dotnet-server/issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disadvantages of not specifying SqlDbType in ...
Question: what are potential problems or disadvantages that I might run into by not including the SqlDbType in the SQLCommand.Parameters?
Read more >
Implement custom conflict resolver (Merge) - SQL Server
Build the project to create the custom conflict resolver library file. Deploy the library in the directory that contains the Merge Agent ...
Read more >
Merging a Conflict with SQL Source Control and Beyond ...
Tony Davis explains how to resolve simple merge conflicts, such as conflicting changes to the same stored procedure, using SQL Source Control ...
Read more >
Collation conflict when creating stored procedure
All you need to do is force a collation in that query via the COLLATE option/keyword. For example: ... [key] COLLATE ...
Read more >
T-SQL- Error: “Cannot resolve the collation conflict between…”
The easiest solution is to use COLLATE DATABASE_DEFAULT on all character columns when creating your temp tables. This uses the collation already ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found