The Type or namespace "Filters" does not exists in the current context Error in MVC4 - model-view-controller

As I'm using Visual studio 2012 I'm getting this error while using Microsoft.Filters.AuthenticationFilters
I have installed microsoft.filters in my project.

As you are using Visual Studio 2012, You have access to 4 types of filters.
Authorization filters.
Action filters.
Result filters.
Exception filters.
Authentication filter is a new filter added in the new version of ASP.Net.
Go through the link for more information.
https://www.tutorialsteacher.com/mvc/filters-in-asp.net-mvc

Related

Entity Framework not appearing in Add New Item list in Visual Studio 2017

I created a new MVC project in Visual Studio 2017. I wanted to add an EDMX file (I will be doing database-first) so right clicked on the project and selected Add|New Item.
However, I cannot find the Entity Framework components that were available in the previous versions of Visual Studio. Does anyone know where they went?
I had a similar issue today after i updated my VS to the latest 2017 version. I tried to open an .edmx file in VS2017 and it didn't show the designer view. So i realised i forgot to select Entity Framework tools during the installation:
Everything is back to normal :)
In .NET Framework-based projects, the Entity Framework 6 templates are still there. However, for .NET Core-based projects, I believe you're expected to use the dotnet ef commands. This includes a means of scaffolding a code-first DbContext from an existing database. See ASP.NET Core - Existing Database.
To verify this, I setup a demo project with the following structure:
The New Item/Data dialog for the .NET Framework project:
Note that there is also an EF POCO Generator template available in the Online templates section that may be of interest to you:
I know this is late, but I ran into the same exact issue. After reading some of the other answers, I realized I had created a .Net project with Standard library instead of the Framework library.
I faced this issue, while creating an MVC application on my latest installation of VS2017.
Failed:
Tried installing Entity Framework using Nuget package manager[Install-Package EntityFramework], but failed to show Ado.NET Entity data model
Success:
1. open programs under control panel and select Visual Studio 2017
2. select Change the installation
3. Select Modify installation
4. Select Individual components
5. If SQL server data tools already installed, deselect/uninstall this component and reinstall the same again.
6. uninstall and reinstall SQL Server Data tools
Note: with one component change, other components may also be deleted. You have to recheck while reinstalling

The custom tool 'DataServicesCoreClientGenerator' failed. ... error 0005: The 'OpenType' attribute is not allowed

When I add a service reference in Visual Studio 2013 Community Edition to a OData service for code generation, I get a schema error; error 0005 Open Type attribute is not supported. See images below.
The service is a OData v3-service. I'm using a Windows Forms project, .NET 4.5.1.
Does anybody know what's the problem?
I took look at the service $metadata. It seems that the namespace of the csdl is of version 1 which is "http://schemas.microsoft.com/ado/2006/04/edm"
<Schema xmlns="http://schemas.microsoft.com/ado/2006/04/edm" Namespace="Cbs.OData">
But OpenType is not supported in version 1. if you changed it to version 3 http://schemas.microsoft.com/ado/2009/11/edm, the client proxy code will be successfully generated.
So you should check your service to make sure your secsdl version is version 3.

Microsoft.AspNet.Odata vs Microsoft.AspNet.WebApi.Odata while adding new web api 2 odata controller

The issue is same for both: VS 2013 and VS 2015 (community edition).
Although I have installed Microsoft.AspNet.Odata via nuget, each time I added new controller it installs Microsoft.AspNet.WebApi.Odata
Then I should switch back to namespaces given below each time.
Is there way to solve this dependency issue?
Additional information:
Microsoft.AspNet.Odata refers to: OData v4.0
Microsoft.AspNet.WebApi.Odata refers to: OData v1-3
Namespaces for Microsoft.AspNet.WebApi.Odata:
using System.Web.Http.OData;
using System.Web.Http.OData.Routing;
and
using System.Web.OData;
using System.Web.OData.Routing;

Where is the EDM tool in Visual Studio 2013 Ultimate Trial?

I just installed VS 2013 Ultimate Trial and I noticed there is no EDM option as shown in the following figure.
Why?
According to ADO.NET Blog, the tool should be available out of the box.
From Visual Studio 2013 onwards we will no longer include the extension that enables configuring an "EDM" data source in this way, e.g. if you add an .MDF file to a project you will no longer see the option to create an EF model, and the option of creating an "EDM" data source based on an existing EDMX model as well as the ability to drag and drop to create data-bound controls automatically in WPF application based on those "EDM" data sources are no longer included.
The recommended ways to create an EF model are either creating the classes,manually (Code First) or adding a new "ADO.NET Entity Data Model" using Add New Item.
The recommended way to do data binding against EF models in WPF applications is through use regular object data sources as explained in this walkthrough.

Cannot Import Asmx web service reference in vs 2010

I have web site built in visual studio 2008 using .net framework 3.5.Now i want to migrate the web site code to visual studio 2010 but want to keep the target framework to same i.e 3.5. The web site is built using vb.Net.MY problem is when i am importing the reference of web service in visual studio 2010 it show error as "NameSpace or type specified in imports 'WebReference' does not contain any public methods".My service name is "WebReference" . I thought may be .net has built in System.web.services.Description.Webreference ,may be it shows conflict ,so i tried to rename it to "WebReference1" or some other name but it does not have any effect,yhe error is still there.What am i missing?
probably it is because you cannot use importer :
ServiceDescriptionImporter importer = new ServiceDescriptionImporter();
in vs 2010....you need vs 2012 because that only has support for .net framework 4.5 which in turn has assembly references to ServiceDescriptionImporter .

Resources