Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPagedList not extending IEnumerable #49

Closed
Jecoms opened this issue Aug 26, 2016 · 5 comments
Closed

IPagedList not extending IEnumerable #49

Jecoms opened this issue Aug 26, 2016 · 5 comments

Comments

@Jecoms
Copy link

Jecoms commented Aug 26, 2016

IEnumerable extensions no longer work using current version.

@Mardoxx
Copy link

Mardoxx commented Aug 30, 2016

Can you provide more detail?

I would assume you mean it is kicking off in your Views saying something along the lines of The type 'IEnumerable<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0?

@Jecoms
Copy link
Author

Jecoms commented Aug 30, 2016

Yes. The exposed namespace is now also X.PagedList in the current version. None of the IEnumerable extensions are available in version 5.x. Is the only current solution to patch my .config files or is the current version targeting a different version of .NET MVC? I have no problem sticking with the <5 PagedList and PagedList.Mvc for the time being.

@Mardoxx
Copy link

Mardoxx commented Aug 30, 2016

I had the same issue today upgrading from an old version. I believe this has something to do with including a PCL in your project. Not entirely sure. To fix it I updated X.PagedList, manually added the assembly reference to System.Runtime to the project's web.config', which allowed it to build succesfully, closed Visual Studio, deleted (renamed) the hidden.vsfolder in the soluton directory, then opened the project, deleted the entry inweb.configand it was back to compiling fine. I would guess you can just get away with deleting the.vs` folder.

The namespace has changed to X.PagedList somewhere down the line (you can always do a case sensitive find and replace using PagedList for using X.PagedList). The info page on GitHub hasn't been updated yet. The demo project uses X.PagedList

@Jecoms
Copy link
Author

Jecoms commented Aug 30, 2016

Well, just like the error suggested, I only needed to add the assembly reference to the compilation XML tag in the project web.config file. I still would like to know why this patch is needed. Is it something that VS will handle in the future or is it an issue with how the PCL was configured/targeted?

This is all I added (besides updating refs to X.PagedList) and it builds/runs fine now. This should be in a FAQ or the readme.

<assemblies>
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>

@Jecoms Jecoms closed this as completed Aug 30, 2016
@Mardoxx
Copy link

Mardoxx commented Aug 30, 2016

That works, but also deleting the .vs folder does too. Unsure about the internals so don't know why it does. Perhaps it's a bug in VS? Be nice to have some insight!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants