Asked by:
Is it possible to reference Identity.Model library in an ASP.NET WebForms project with .Net framework 3.5?

Question
-
User-345719443 posted
I have a project in an ASP.NET WebForms VB.NET on .NET framework 3.5. I can't reference the Identity<g class="gr_ gr_6 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" id="6" data-gr-id="6">.Model</g> library, as I got this error message:
Could not install package 'IdentityModel 3.7.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v3.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Is there a way to integrate this application WebForms with IdentityServer4 ?? I found a lot of ways to do it in MVC with C# but I don't know how to do it in VB.Net.
Thursday, June 28, 2018 4:09 PM
All replies
-
User409696431 posted
As the error says, IdentityModel 3.7.1 is not compatible with Net Framework 3.5. It is compatible with Net Framework 4.5.2 (See the dependencies at https://www.nuget.org/packages/IdentityModel/)
Assuming you upgrade your project to 4.5.2, here is an example of using IdentityServer3 with webforms: https://github.com/IdentityServer/IdentityServer3.Samples/tree/master/source/Clients/WebFormsClient
As for IdentityServer4, use the above sample. "We have a web forms sample client using IdSvr3, but the client code would look the same regardless which one you're using. " from https://github.com/IdentityServer/IdentityServer4/issues/78
Thursday, June 28, 2018 4:22 PM -
User-345719443 posted
First of all, Thanks a lot @KathyW !!!
I can't upgrade to 4.5.2 because of I have a lot of dependencies that can't be upgraded. Is it IdentityModel the only way to get integrated with IdentityServer ?? Thanks again.
Thursday, June 28, 2018 4:38 PM -
User409696431 posted
Are you sure you can't upgrade? See the discussion here, for example: https://stackoverflow.com/questions/13804219/mixing-net-3-5-with-4-4-5-assemblies-in-the-same-process and https://docs.microsoft.com/en-us/aspnet/whitepapers/aspnet4/breaking-changes
Thursday, June 28, 2018 5:01 PM -
User-345719443 posted
I don't mean that I can't upgrade in the way of refactoring the code. I mean that it is too large and tedious in that way, for that I just ask for a one way in that I don't <g class="gr_ gr_234 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" id="234" data-gr-id="234">refactoring</g> too much.
By the way, Thanks again !!
Thursday, June 28, 2018 6:03 PM -
User409696431 posted
You may be overestimating the work involved. I've converted 3.5 applications, with third party libraries targeting 3.5, to 4.5.2 simply with changes to the web.config. Recompiled my code, targeting 4.5.2, and everything continued to work, including the 3rd party libraries, no coding changes required. Obviously, I'm not taking advantage of anything new in 4.5.2 doing it that way, but I am running under a 4.5.2 application pool and can use new libraries that require that.
Thursday, June 28, 2018 9:13 PM