Skip to content

Commit 25ec368

Browse files
authored
Fixed: do not reference assemblies that are transitively referenced, to prevent conflicting versions (resulting in a build warning) (#115)
1 parent dec136e commit 25ec368

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

src/Content/NetCoreTool.Template.WebApi/CSharp/.template.config/template.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,10 @@
434434
"description": "Add a connector for MySQL databases using ADO.NET.",
435435
"defaultValue": "false"
436436
},
437+
"HasConnectorMySqlWithoutEfCore": {
438+
"type": "computed",
439+
"value": "ConnectorMySqlOption && (!ConnectorMySqlEfCoreOption)"
440+
},
437441
"HasConnectorMySqlInSteeltoeV3": {
438442
"type": "computed",
439443
"value": "ConnectorMySqlOption && IsSteeltoeV3"
@@ -472,6 +476,10 @@
472476
"description": "Add a connector for PostgreSQL databases using ADO.NET.",
473477
"defaultValue": "false"
474478
},
479+
"HasConnectorPostgreSqlWithoutEfCore": {
480+
"type": "computed",
481+
"value": "ConnectorPostgreSqlOption && (!ConnectorPostgreSqlEfCoreOption)"
482+
},
475483
"HasConnectorPostgreSqlInSteeltoeV3": {
476484
"type": "computed",
477485
"value": "ConnectorPostgreSqlOption && IsSteeltoeV3"
@@ -500,6 +508,10 @@
500508
"description": "Add a connector for RabbitMQ message brokers.",
501509
"defaultValue": "false"
502510
},
511+
"HasConnectorRabbitMqWithoutMessaging": {
512+
"type": "computed",
513+
"value": "ConnectorRabbitMqOption && (!HasAnyMessagingRabbitMqInSteeltoeV3)"
514+
},
503515
"HasConnectorRabbitMqInSteeltoeV3": {
504516
"type": "computed",
505517
"value": "ConnectorRabbitMqOption && IsSteeltoeV3"
@@ -528,6 +540,10 @@
528540
"description": "Add a connector for Microsoft SQL Server databases using ADO.NET.",
529541
"defaultValue": "false"
530542
},
543+
"HasConnectorSqlServerWithoutEfCore": {
544+
"type": "computed",
545+
"value": "ConnectorSqlServerOption && (!ConnectorSqlServerEfCoreOption)"
546+
},
531547
"HasConnectorSqlServerInSteeltoeV3": {
532548
"type": "computed",
533549
"value": "ConnectorSqlServerOption && IsSteeltoeV3"

src/Content/NetCoreTool.Template.WebApi/CSharp/Company.WebApplication.CS.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
44
<TargetFramework>$(FrameworkOption)</TargetFramework>
@@ -28,17 +28,17 @@
2828
<ItemGroup>
2929
<PackageReference Include="Microsoft.Azure.Cosmos" Condition="'$(ConnectorCosmosDbOption)' == 'True'" Version="3.47.*" />
3030
<PackageReference Include="Microsoft.Azure.SpringCloud.Client" Condition="'$(HasHostingAzureSpringCloudInSteeltoeV3)' == 'True'" Version="2.0.0-preview.3" />
31-
<PackageReference Include="Microsoft.Data.SqlClient" Condition="'$(ConnectorSqlServerOption)' == 'True'" Version="$(SqlClientVersion)" />
31+
<PackageReference Include="Microsoft.Data.SqlClient" Condition="'$(HasConnectorSqlServerWithoutEfCore)' == 'True'" Version="$(SqlClientVersion)" />
3232
<PackageReference Include="Microsoft.EntityFrameworkCore" Condition="'$(HasAnyEfCoreConnector)' == 'True'" Version="$(AspNetCoreVersion)" />
3333
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Condition="'$(ConnectorSqlServerEfCoreOption)' == 'True'" Version="$(AspNetCoreVersion)" />
3434
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Condition="'$(ConnectorRedisOption)' == 'True'" Version="$(AspNetCoreVersion)" />
3535
<PackageReference Include="MongoDB.Driver" Condition="'$(ConnectorMongoDbOption)' == 'True'" Version="3.2.*" />
36-
<PackageReference Include="MySql.Data" Condition="'$(ConnectorMySqlOption)' == 'True'" Version="$(MySqlVersion)" />
36+
<PackageReference Include="MySql.Data" Condition="'$(HasConnectorMySqlWithoutEfCore)' == 'True'" Version="$(MySqlVersion)" />
3737
<PackageReference Include="MySql.EntityFrameworkCore" Condition="'$(ConnectorMySqlEfCoreOption)' == 'True'" Version="$(AspNetCoreVersion)" />
3838
<PackageReference Include="Newtonsoft.Json" Condition="'$(ConnectorCosmosDbOption)' == 'True'" Version="13.0.*" />
39-
<PackageReference Include="Npgsql" Condition="'$(ConnectorPostgreSqlOption)' == 'True'" Version="$(AspNetCoreVersion)" />
39+
<PackageReference Include="Npgsql" Condition="'$(HasConnectorPostgreSqlWithoutEfCore)' == 'True'" Version="$(AspNetCoreVersion)" />
4040
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Condition="'$(ConnectorPostgreSqlEfCoreOption)' == 'True'" Version="$(AspNetCoreVersion)" />
41-
<PackageReference Include="RabbitMQ.Client" Condition="'$(ConnectorRabbitMqOption)' == 'True'" Version="$(RabbitMqVersion)" />
41+
<PackageReference Include="RabbitMQ.Client" Condition="'$(HasConnectorRabbitMqWithoutMessaging)' == 'True'" Version="$(RabbitMqVersion)" />
4242
<PackageReference Include="Steeltoe.CircuitBreaker.HystrixCore" Condition="'$(HasCircuitBreakerHystrixInSteeltoeV3)' == 'True'" Version="$(SteeltoeVersion)" />
4343
<PackageReference Include="Steeltoe.CircuitBreaker.Hystrix.MetricsStreamCore" Condition="'$(HasCircuitBreakerHystrixInSteeltoeV3)' == 'True'" Version="$(SteeltoeVersion)" />
4444
<PackageReference Include="Steeltoe.Configuration.CloudFoundry" Condition="'$(HasHostingCloudFoundryInSteeltoeV4)' == 'True'" Version="$(SteeltoeVersion)" />

0 commit comments

Comments
 (0)