I'm building my first ASP.NET 5 application. I've added my references to my project.json file, but when I added the latest 7.0.0-rc1-final SQL references it broke my DbContextOptionsBuilder class. I get the following error:
The type 'DbContextOptionsBuilder' is defined in an assembly that is not referenced. You must add a reference to assembly 'EntityFramework.Core'
Here's what my project.json file originally looked like after I updated several of the SQL references to 7.0.0-rc1-final. The EntityFramework.SqlServer didn't have a 7.0.0-rc1-final version:
"dependencies": {
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"EntityFramework.Core": "7.0.0-rc1-final",
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.SqlServer": "7.0.0-beta8"
}
Fix: It turned out that theEntityFramework.SqlServer got renamed to EntityFramework.MicrosoftSqlServer. Once I referenced the new name, my errors went away. Here's my updated dependency list.
"dependencies": {
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"EntityFramework.Core": "7.0.0-rc1-final",
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final"
}
Friday, May 13, 2016
Monday, March 28, 2016
The dependency Microsoft.AspNet.Mvc >= 6.0.0-rc1-final could not be resolved.
I got this error when adding MVC to my ASP.NET 5 project. My project.json contained the following dependencies, and I was getting an error that it couldn't resolve the second one.
"dependencies": {
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final"
},
The error I was getting was:
The dependency Microsoft.AspNet.Mvc >= 6.0.0-rc1-final could not be resolved.
Fix:
It turned out that I just needed to run "dnvm upgrade " from my command prompt with VS closed.
Once I'd run this command, VS then resolved the dependency correctly.
"dependencies": {
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final"
},
The error I was getting was:
The dependency Microsoft.AspNet.Mvc >= 6.0.0-rc1-final could not be resolved.
Fix:
It turned out that I just needed to run "dnvm upgrade " from my command prompt with VS closed.
Once I'd run this command, VS then resolved the dependency correctly.
Monday, November 30, 2015
Your Are Not Authorized to access visualstudio.com
I can't login to Team Foundation Server from within Visual Studio, I get the following error:
"Your Are Not Authorized to access visualstudio.com"
Invalid Configuration Files for locally hosted applications
After moving to a new PC and re-hosting my applications in local IIS, I was getting errors that the configuration file was invalid or couldn't be read.
Wednesday, September 2, 2015
Error occurred during a cryptographic operation. System.Security.Cryptography.CryptographicException: Error occurred during a cryptographic operation.
I build a web application that worked in Dev and QA, but then demonstrated some unpredictable behavior in production, where it was load balanced between 2 servers. The error log reported the following error:
Error occurred during a cryptographic operation.
System.Security.Cryptography.CryptographicException: Error occurred during a cryptographic operation.
at System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.HomogenizeErrors(Func`2 func, Byte[] input)
This has to do with the Machine Key, which is used for decrypting and encrypting resources. By default, the machine key is auto-generated by IIS. The default works fine if your application is only running on one server. But if the application is hosted across multiple servers, the application needs to be configured to use the same Machine Key across all servers.
I found a bunch of posts about this error. I then populated a web.config section for my application that looked like this:
<machineKey
decryptionKey="ABCDEFGH....."
validationKey="ABCDEFGHIJKLMNOPQRSTUVWXY....."
validation="SHA1"
decryption="Auto"
/>
This key belongs in the <system.web> section.
I generated the keys using IIS:
http://docs.orchardproject.net/Documentation/Setting-up-a-machine-key
Here is the post related to this issue:
http://stackoverflow.com/questions/3855666/adding-machinekey-to-web-config-on-web-farm-sites
Error occurred during a cryptographic operation.
System.Security.Cryptography.CryptographicException: Error occurred during a cryptographic operation.
at System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.HomogenizeErrors(Func`2 func, Byte[] input)
This has to do with the Machine Key, which is used for decrypting and encrypting resources. By default, the machine key is auto-generated by IIS. The default works fine if your application is only running on one server. But if the application is hosted across multiple servers, the application needs to be configured to use the same Machine Key across all servers.
I found a bunch of posts about this error. I then populated a web.config section for my application that looked like this:
<machineKey
decryptionKey="ABCDEFGH....."
validationKey="ABCDEFGHIJKLMNOPQRSTUVWXY....."
validation="SHA1"
decryption="Auto"
/>
This key belongs in the <system.web> section.
I generated the keys using IIS:
http://docs.orchardproject.net/Documentation/Setting-up-a-machine-key
Here is the post related to this issue:
http://stackoverflow.com/questions/3855666/adding-machinekey-to-web-config-on-web-farm-sites
Friday, June 19, 2015
Github error through proxy: Failed connect to github.com:443
I was trying to clone a Github repository from behind a proxy. I kept getting connection errors,
fatal: unable to access 'https://github.com/Netflix/ice.git/': Failed connect to
github.com:443; No error
This is how I fixed it.
fatal: unable to access 'https://github.com/Netflix/ice.git/': Failed connect to
github.com:443; No error
This is how I fixed it.
Tuesday, April 7, 2015
405 Method Not Allowed in my Web API
Today I went back to an existing project that I spend my time on and I started getting errors when doing PUTs to my Web API. The errors didn't happen before, but I've now pulled down the latest code so something's changed.
Subscribe to:
Posts (Atom)