To download the .NET SDKs for application build and deployment navigate to the Download .NET SDKs for Visual Studio Microsoft web site
Tag Archives: .NET
Return values to the controller in the model from the ASP.NET MVC view
When we create an ASP.NET MVC web application, the model (an object) is the easiest way to return values from the view to the controller. For the view to be able to return the values in the model, make sure the model contains properties, not fields, for every value with { get; set; } public class MyViewModel { public …
Continue reading “Return values to the controller in the model from the ASP.NET MVC view”
.NET Framework Detection in the Windows Registry
To determine which .NET framework is installed on the Windows computer check the values in the registry. The HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full key contains two values you can check: Release Version You can use InSpec, part of the Chef DK, to check the values: describe registry_key(‘HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full’) do it { should have_property ‘Release’ } it { …
Continue reading “.NET Framework Detection in the Windows Registry”
Block comment in ASP.NET MVC Razor file
To comment out a block of lines in the ASP.NET MVC Razor file, enclose them in @* and *@ @* Commented out instructions, including HTML and Extension methods *@
Procedure or function ‘`…_Insert`’ cannot be found in database …
When you use the Microsoft .NET Entity framework to access a MySql database, the autogenerated code throws an error when you try to insert a row into the database with context.MY_TABLE.Add(MY_OBJECT); Server Error in ‘/’ Application. Procedure or function ‘`…_Insert`’ cannot be found in database ‘`…`’. Description: An unhandled exception occurred during the execution of …
Continue reading “Procedure or function ‘`…_Insert`’ cannot be found in database …”
No connection string named ‘…’ could be found in the application config file.
Two-tier applications separate the presentation layer and the data layer, and all database access related objects are located in the data-tier. When the application runs, the config file of the main project is read. In web applications, it is the web.config, in console applications the app.config file. When you get the following runtime exception Exception thrown: ‘System.InvalidOperationException’ in …
Continue reading “No connection string named ‘…’ could be found in the application config file.”
NotSupportedException: Unable to determine the provider name for provider factory of type ‘MySql.Data.MySqlClient.MySqlClientFactory’. Make sure that the ADO.NET provider is installed or registered in the application config
In a two-tier web application, the data layer is in a separate project. This allows better separation between the presentation layer and the data layer. This way you can reuse the data project in another application that targets the same database. To access a MySql database you need to add the MySql.Data and MySql.Data.Entity NuGet packages to …
Create an ASP.NET MVC 5 Web Application with user authentication
To create a new ASP .NET MVC web application that contains user authentication code In the File menu of Visual Studio select New, Project… On the left select Visual C#, Web, and in the middle select ASP.NET Web Application (.NET Framework) Enter the Name, select the solution folder location and click OK. The solution name …
Continue reading “Create an ASP.NET MVC 5 Web Application with user authentication”
The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
When I made changes to the web.config file of an ASP.Net C# application, I have accidentally deleted a comma, and I started to get the runtime error message: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047) Make sure all necessary commas are there in the config files, Visual Studio does not …
No mapping specified for instances of the EntitySet and AssociationSet in the EntityContainer
When you move your Visual Studio solution to another workstation you may encounter the following error message: System.Data.Entity.Core.MappingException was unhandled by user code HResult=-2146232032 Message=Schema specified is not valid. Errors: : error 2062: No mapping specified for instances of the EntitySet and AssociationSet in the EntityContainer … Source=EntityFramework In this case it may help if …