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.

Overriding views generates build warning CS0436

See original GitHub issue

Describe the bug When using the nuget package and not the sources and override the views, a warning is generated.

What area is it related to BankID

To Reproduce Steps to reproduce the behavior:

  1. Go to MVC sample project
  2. Remove activelogin sources
  3. Install nuget packages for activelogin
  4. Build

Expected behavior Clean build with no errors or warnings.

Screenshots


$ dotnet build
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 26.88 ms for /Users/danielkvist/development/ActiveLogin.Authentication/src/ActiveLogin.Authentication.GrandId.Api/ActiveLogin.Authentication.GrandId.Api.csproj.
  Restore completed in 26.89 ms for /Users/danielkvist/development/ActiveLogin.Authentication/src/ActiveLogin.Authentication.GrandId.AspNetCore/ActiveLogin.Authentication.GrandId.AspNetCore.csproj.
  Restore completed in 305.79 ms for /Users/danielkvist/development/ActiveLogin.Authentication/samples/Standalone.MvcSample/Standalone.MvcSample.csproj.
  ActiveLogin.Authentication.GrandId.Api -> /Users/danielkvist/development/ActiveLogin.Authentication/src/ActiveLogin.Authentication.GrandId.Api/bin/Debug/netstandard2.0/ActiveLogin.Authentication.GrandId.Api.dll
  ActiveLogin.Authentication.GrandId.AspNetCore -> /Users/danielkvist/development/ActiveLogin.Authentication/src/ActiveLogin.Authentication.GrandId.AspNetCore/bin/Debug/netcoreapp3.1/ActiveLogin.Authentication.GrandId.AspNetCore.dll
obj/Debug/netcoreapp3.1/Razor/Areas/BankIdAuthentication/Views/BankId/_Login.cshtml.g.cs(4,100): error CS0436: The type ‘Areas_BankIdAuthentication_Views_BankId__Login’ in ‘/Users/danielkvist/development/ActiveLogin.Authentication/samples/Standalone.MvcSample/obj/Debug/netcoreapp3.1/Razor/Areas/BankIdAuthentication/Views/BankId/_Login.cshtml.g.cs’ conflicts with the imported type ‘Areas_BankIdAuthentication_Views_BankId__Login’ in ‘ActiveLogin.Authentication.BankId.AspNetCore.Views, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null’. Using the type defined in ‘/Users/danielkvist/development/ActiveLogin.Authentication/samples/Standalone.MvcSample/obj/Debug/netcoreapp3.1/Razor/Areas/BankIdAuthentication/Views/BankId/_Login.cshtml.g.cs’. [/Users/danielkvist/development/ActiveLogin.Authentication/samples/Standalone.MvcSample/Standalone.MvcSample.csproj]

Build FAILED.

obj/Debug/netcoreapp3.1/Razor/Areas/BankIdAuthentication/Views/BankId/_Login.cshtml.g.cs(4,100): error CS0436: The type ‘Areas_BankIdAuthentication_Views_BankId__Login’ in ‘/Users/danielkvist/development/ActiveLogin.Authentication/samples/Standalone.MvcSample/obj/Debug/netcoreapp3.1/Razor/Areas/BankIdAuthentication/Views/BankId/_Login.cshtml.g.cs’ conflicts with the imported type ‘Areas_BankIdAuthentication_Views_BankId__Login’ in ‘ActiveLogin.Authentication.BankId.AspNetCore.Views, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null’. Using the type defined in ‘/Users/danielkvist/development/ActiveLogin.Authentication/samples/Standalone.MvcSample/obj/Debug/netcoreapp3.1/Razor/Areas/BankIdAuthentication/Views/BankId/_Login.cshtml.g.cs’. [/Users/danielkvist/development/ActiveLogin.Authentication/samples/Standalone.MvcSample/Standalone.MvcSample.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:04.92

obj/Debug/netcoreapp3.1/Razor/Areas/BankIdAuthentication/Views/BankId/_Login.cshtml.g.cs(4,100): error CS0436: The type ‘Areas_BankIdAuthentication_Views_BankId__Login’ in ‘/Users/danielkvist/development/ActiveLogin.Authentication/samples/Standalone.MvcSample/obj/Debug/netcoreapp3.1/Razor/Areas/BankIdAuthentication/Views/BankId/_Login.cshtml.g.cs’ conflicts with the imported type ‘Areas_BankIdAuthentication_Views_BankId__Login’ in ‘ActiveLogin.Authentication.BankId.AspNetCore.Views, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null’. Using the type defined in ‘/Users/danielkvist/development/ActiveLogin.Authentication/samples/Standalone.MvcSample/obj/Debug/netcoreapp3.1/Razor/Areas/BankIdAuthentication/Views/BankId/_Login.cshtml.g.cs’. [/Users/danielkvist/development/ActiveLogin.Authentication/samples/Standalone.MvcSample/Standalone.MvcSample.csproj] 0 Warning(s) 1 Error(s)

NuGet package version 3-beta-1, 2.0.1

Runtime version .net core 2.2 and 3.1

Additional context Perhaps it is related to the IncludeRazorContentInPack variable in the build pipeline.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
PeterOrneholmcommented, Dec 20, 2019

I’ve been digging around without finding any answer to this. Maybe it will be solved if we move to Razor pages? I can see that the package Microsoft.AspNetCore.Identity.UI uses Razor class library with the same convention as us, but they do Razor pages instead of Controllers. Maybe that will solve it? We do consider moving to Razor pages as part of the refactoring that will be done in 4.0.0.

Microsoft.AspNetCore.Identity.UI does some scary magic things with the build pipeline in their csproj file, but I don’t think that will solve it either. Looks like stuff to handle booth bootstrap 3 and bootstrap 4.

0reactions
PeterOrneholmcommented, Mar 21, 2022

This seems to be solved now. Let me know if you disagree @span 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

CS0436: Type conflicts with the imported type
I started seeing this as a warning, but the solution would still compile. There were no circular references, and cleaning the solution and ......
Read more >
Compiler Warning (level 2) CS0436
This warning is issued when a type in a source file (file_2) conflicts with an imported type in file_1. The compiler uses the...
Read more >
Compiler Warning (level 1) CS0672
The compiler found an override to a method marked as obsolete . However, the overriding method was not itself marked as obsolete. The...
Read more >
trying to get around missing reference types
In my app I have a file browser and on windows phone platform many used methods are missing. In the generated VS solution...
Read more >
StronglyTypedId.Attributes 1.0.0-beta04
Helper library for StronglyTypedId generator containg attributes only. See README for when to use this package.
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