Tag: MVC
-
DbSet does not contain a definition for ‘FromSQL’ and no extension method ‘FromSql’ accepting an argument of type ‘DbSet’ could be found.
Hi everyone, I ran into the following error while attempting to use a custom query with EntityFramework: DbSet does not contain a definition for ‘FromSQL’ and no extension method ‘FromSql’ accepting an argument of type ‘DbSet’ could be found. This one’s pretty straight forward: // Install the following package via nuget Install-package Microsoft.EntityFrameworkCore.Relational //Add the…
-
Include UserId in Login Response (Token) – Web API 2
Hi everyone, A quick post on how to include the user’s id in your login response when using Web API 2. The default response to the /Token request is as follows: { “access_token”: “xxxxxxxxxxxxx_xxxx”, “token_type”: “bearer”, “expires_in”: 1209599, “userName”: “test@test.com”, “.issued”: “Mon, 23 Apr 2018 06:08:03 GMT”, “.expires”: “Mon, 07 May 2018 06:08:03 GMT” }…
-
Could not find part of the path ‘C:xlib’ – Adding new Web API Project
Hey everyone, I ran into the following error when I tried to add a new Web API project in Visual Studio Express 2015 for Web: Could not find part of the path ‘C:xlib’ The workaround for this was to temporarily unbind the project from TFS: File > Source Control > Advanced > Change Source Control…
-
Culture Info Codes
Hey everyone, Just posting a link to this list of culture info codes etc. I was looking for the en-AU one but had a bit of trouble tracking it down. Language Culture Name Display Name Culture Code ISO 639x Value af-ZA Afrikaans – South Africa 0x0436 AFK sq-AL Albanian – Albania 0x041C SQI ar-DZ Arabic…
-
TF30063: You are not authorized to access asxproject – TFS Online/Visual Studio
Hey everyone, I ran into the following issue while trying to install the HTML Agility Pack via Nuget today: TF30063: You are not authorized to access asxproject… This fixed it for me: – Go to “Team Explorer” – Up the very top click on the “Connect to Team Projects” button (power cable looking icon next…
-
The installer has encountered an unexpected error installing this package.This may indicate a problem with this package.The error code is 29506 – SQL Server Management Studio
Hey everyone, I ran into the following error while trying to install Sql Server Management Studio on Windows 8: The installer has encountered an unexpected error installing this package.This may indicate a problem with this package.The error code is 29506 To fix it, all you need to do is run the exe with administrative privileges.
-
No Entity Framework provider found for the ADO.NET provider with invariant name ‘System.Data.SqlClient’ – MVC5
Hey everyone, Just an error I came across while trying to use a new solution project: No Entity Framework provider found for the ADO.NET provider with invariant name ‘System.Data.SqlClient’ The fix for this was simply to run the following command in the package manager console: PM> Install-Package EntityFramework Thanks to StackOverflow for the details: http://stackoverflow.com/a/18642452/522859
-
Change Default MVC5 Password Complexity Requirements – Passwords must have at least one non letter or digit character. Passwords must have at least one digit (‘0’-‘9’). Passwords must have at least one uppercase (‘A’-‘Z’)
Hey everyone, I’ve started on a new MVC5 project and came across the following error message while trying to register a new user: Passwords must have at least one non letter or digit character. Passwords must have at least one digit (‘0’-‘9’). Passwords must have at least one uppercase (‘A’-‘Z’) While having a secure password…
-
Unescape String in Watch Window – Visual Studio
Hey everyone, Just a quick post on how to remove the escape characters from a string in the watch window. All you’ve got to do is append “,nq” (short for no quotes) to the watch variable name. MyLongString becomes MyLongString,nq This removes all of the quotes and line breaks. Pretty handy for when you’ve got…
-
How to Open the Same File Twice in Visual Studio
Hey everyone, Today I was working on a fairly large class and needed to compare two different areas of code. I’m used to using text editors such as notepad++ and sublime where I would normally just open the file multiple times. It turns out that Visual Studio has a similar feature, although it’s admittedly a…