Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Support on MVC5 (.Net 4.5.1) #18

Closed
rposener opened this issue Oct 21, 2015 · 22 comments
Closed

Support on MVC5 (.Net 4.5.1) #18

rposener opened this issue Oct 21, 2015 · 22 comments

Comments

@rposener
Copy link
Contributor

When adding the required dependency to a .Net 4.6. MVC5 project, the Nuget package Microsoft.AspNet.DataProtection fails to add reporting
"Failed to add reference to 'System.IO'. Please make sure that it is in the Global Assembly Cache."

Not sure how to determine the best way to resolve since this occurs at the nuget package add. Any tips would be appreciated, or confirmation that this is a current bug in the build? Maybe is there a nightly build that I could get which would resolve?

@rposener
Copy link
Contributor Author

Just and update - this works with Beta6, not sure what is up with Beta8? Hopefully this will get resolved with RC1, but would be good to know the fix once it's addressed.

@HenrikFrystykNielsen
Copy link
Contributor

It's a weird issue (and I think a bug in how references are resolved). If you manually add an assembly reference to your project to System.IO then it will work. That is, open the project manually and add a line like this "<Reference Include="System.IO" />" .

@Eilon
Copy link
Member

Eilon commented Oct 27, 2015

@rposener it sounds like you're using MVC 6 on ASP.NET 5, not MVC 5 on ASP.NET 4.6. Are you sure which one it is?

@rposener
Copy link
Contributor Author

Yes, its an new branch of an old project. Actually found that installing beta 6 instead of the beta 8 build eliminates the issue. It is the data.protection package which will not resolve the system.io reference. Where would you get system.io anyway? I thought that was a nuget thing for .net 5 runtime? System.io as i understood was just a namespace within system for .net 4.5.1.

@Eilon
Copy link
Member

Eilon commented Oct 28, 2015

I'm still confused - are you using MVC 6 on ASP.NET 5, or MVC 5 on ASP.NET 4.x? They cannot be mixed and matched - only those two configurations are supported.

@rposener
Copy link
Contributor Author

I am using MVC 5 on asp.net 4 - have not upgraded or changed my asp.net project.

@Eilon
Copy link
Member

Eilon commented Oct 28, 2015

Oh, sorry, my bad - I completely forgot that WebHooks uses the new configuration and data protection APIs.

@rposener
Copy link
Contributor Author

So does that mean support for it ends with beta 6, or is that dependency expected to be fixed or changed?

@Eilon
Copy link
Member

Eilon commented Nov 2, 2015

I just tried reproducing this issue and I couldn't see any errors. I created a new .NET 4.6 ASP.NET MVC 5 project (using all the defaults). Then I tried installing each of these packages:

  • Microsoft.AspNet.WebHooks.Common
  • Microsoft.AspNet.WebHooks.Custom
  • Microsoft.AspNet.WebHooks.Custom.AzureStorage
  • Microsoft.AspNet.WebHooks.Receivers
  • Microsoft.AspNet.WebHooks.Receivers.Bitbucket
  • Microsoft.AspNet.WebHooks.Receivers.Custom

And I had no issues compiling and running the app.

Do you have more specific repro steps for this issue?

@Eilon
Copy link
Member

Eilon commented Nov 2, 2015

BTW I should add that I can't think of any reason why DataProtection 1.0.0-beta6 would be the last version that works, so this is quite odd.

@rposener
Copy link
Contributor Author

rposener commented Nov 3, 2015

It is the AzureStorage package. Looking at the Dependencies for https://www.nuget.org/packages/Microsoft.AspNet.WebHooks.Custom.AzureStorage/1.2.0-beta3a shows "beta6" and "beta5" dependencies which I believe are just not updated. When using the "Lowest" dependency match option in nuget it would create the dependency back to "System.IO" package. Can we get that package updated to point to all the current beta versions?

@HenrikFrystykNielsen
Copy link
Contributor

The latest packages point all to beta 8, see a072ebf

@vindberg
Copy link

Hi, Im still getting this System.IO error with beta 8 dependencies trying to add Microsoft.AspNet.WebHooks.Custom.SqlStorage.

The manual reference in the project file works though.

Thanks.

@HenrikFrystykNielsen
Copy link
Contributor

@vindberg Quick question: Did you try and add an assembly reference like this <Reference Include="System.IO" /> to your project?

@vindberg
Copy link

@HenrikFrystykNielsen Yes it works if the reference is added manually to the project file. Just thought it was fixed with the beta 8 update :)

@jabbera
Copy link

jabbera commented Nov 19, 2015

I'm still having the System.IO issue with rc1.

@ghost
Copy link

ghost commented Nov 25, 2015

Had the same System.IO issue and adding it manually to the project worked for me.

@alhardy
Copy link

alhardy commented May 30, 2016

Still the same issue, System.IO doesn't exist in the .net framework installed locally. Tried referencing the nuget package https://www.nuget.org/packages/System.IO/4.1.0-rc2-24027 and the .net 4.5 folder contains no dll??

@HenrikFrystykNielsen
Copy link
Contributor

Did you try and add this manually to the csproj file:

Btw, this issue has been fixed with the upcoming RC2 drop of .NET core which we use a component from.

@alhardy
Copy link

alhardy commented May 30, 2016

Yeah I did try manually added a reference to the csproj. However System.IO doesn't seem to exist for .NET 4.5.*

Does Microsoft.AspNet.WebHooks.Custom.AzureStorage need the reference?

@HenrikFrystykNielsen
Copy link
Contributor

It isn't a real dll -- it's what's called a façade assembly which shouldn't be referenced under normal conditions. However, there is a bug in the ASP.NET DataProtection nugget package explicitly referencing it (see aspnet/DataProtection#117 for details).

Regardless, if you just add the reference to your project then it will work on .NET 4.5.*

@alhardy
Copy link

alhardy commented May 31, 2016

That's new to me. Thanks for the info!

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

No branches or pull requests

6 participants