wet-boew / cdts-DotNetTemplates

Documentation for CDTS
7 stars 2 forks source link

ASP.NET Core 3.1 - Compiler warning: CS0436 #3

Open ahmad-shahid opened 1 year ago

ahmad-shahid commented 1 year ago

Problem Found in Version: At least 2.3.3 and higher Template: MVC Environment: AKAMAI Master/Layout: N/A Additional settings: Only with ASP.NET Core 3.1

Problem Description: We have compiler's warnings when using the GoC nuget package and targeting ASP.NET Core 3.1. If you use ASP.NET Core 2.2 there is no warning. I even tried with the sample link and I get the same problem once I upgrade it to 3.1. There is 9-10 warnings looking like:

Severity Code Description Project File Line Suppression State Warning CS0436 The type 'Views_GoC_WebTemplateLayout_Application' in 'C:\Users\nicolas.rodrigues\source\repos\WebApplication1\WebApplication1\obj\Debug\netcoreapp3.1\Razor\Views\GoC.WebTemplate_Layout.Application.cshtml.g.cs' conflicts with the imported type 'Views_GoC_WebTemplateLayout_Application' in 'GoC.WebTemplate.CoreMVC.Views, Version=2.0.8019.23631, Culture=neutral, PublicKeyToken=1461a53e67b98f2c'. Using the type defined in 'C:\Users\nicolas.rodrigues\source\repos\WebApplication1\WebApplication1\obj\Debug\netcoreapp3.1\Razor\Views\GoC.WebTemplate_Layout.Application.cshtml.g.cs'. WebApplication1 C:\Users\nicolas.rodrigues\source\repos\WebApplication1\WebApplication1\obj\Debug\netcoreapp3.1\Razor\Views\GoC.WebTemplate_Layout.Application.cshtml.g.cs 4 Active

We treat warning as errors in our project. For now, we just ignore that specific warning code but it would be nice not to have to. Thank you in advance, Nick

ahmad-shahid commented 1 year ago

Transferred from: https://gccode.ssc-spc.gc.ca/iitb-dgiit/sds/GOCWebTemplates/DotNetTemplates/-/issues/432