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

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;

Related

Visual Studio 15.8.0 Preview 2.0 - MVC - Core 2.1 - Adding SOAP as Connected Service - Version for package dotnet-svcutil could not be resolved

I am working with the following: Visual Studio 15.8.0 Preview 2.0, ASP.NET Web Application, with Target of .NET Core 2.1. I am trying to add a SOAP service as a Connected Service. (I had the same problem with VS 15.7.4, so I thought going to the preview version might find this issue fixed)
I chose Microsoft WCF Web Service Reference Provider.
When I try to add the SOAP service, I get:
Version for package dotnet-svcutil could not be resolved
...
I went the following route without success (mlacouture - mentioned changing nuget.config in directory svcutil_starter to fix the location of the svcutil package, then doing dotnet restore on the Nuget package. With this preview version of VS, the location of svcutil in nuget.config is already correct (C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\EXTENSIONS\MICROSOFT\WCF CONNECTED SERVICE\svcutil\dotnet-svcutil.1.0.0-preview-20406-879.nupkg).
I continue to still get:
C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets(114,5): error : The local source 'C:\Users\medwa163\AppData\Local\Temp\WCFConnectedService\2018_Jun_22_08_01_15\svcutil_starter\dotnet-svcutil.1.0.0-preview-20406-879.nupkg' doesn't exist. [C:\Users\medwa163\AppData\Local\Temp\WCFConnectedService\2018_Jun_22_08_01_15\svcutil_starter\svcutil_starter.csproj]. It definitely does exist.
If I copy the package to the same directory at the Nuget.config, and change Nuget.config to point to it, I get the same error. Cleared the nuget cache and same error.
GitHub Info on Potential Workaround
...
Any insight into this would be greatly appreciated.
I was finally able to find a solution for this.
I temporarily changed the target of the project from .NET Core 2.1 to .NET Core 2.0. Then I was able to add the service.
After that, I changed the target back to .NET Core 2.1 and tested. I was able to call the service successfully.

Creating web application using VS 2015 Update 3 creates with references 1.0.0-rc2-final

Creating a web application as ASP.NET Core Web Applicaiton (.NET Framework) creates with most of the references as 1.0.0-rc2-final.
I am using the RTM version of VS 2015 Update 3. Hoping the references to be full version rather than rc2-final.
Are the templates updated properly? Do I need an update for the tools? If needed, where will I get it?
Thanks
ASP.Net Core tooling isn't included in Update 3 so apart from Update 3 you also need to install Web tooling. Go to: https://www.microsoft.com/net/download and download ".NET Core Tooling Preview 2 for Visual Studio 2015" (at the bottom of the page).
Probably going to have to update the project with nuget or by hand this assumes you have installed the SDK Core Preview2 Tooling located here.
NET Core 1.0 for Visual Studio
NB: while the framework has RTM'd the tooling is still in preview status since they are still working on it, hence Preview2 status.
if you have a Global.json file I would also suggest clearing out the entry that says "sdk": {}

EntityFrameWork version 6.1.3 installed but it still shows version 6.0.0

I have just started my journey in MVC and EntityFrameWork. I am following a tutorial. When I try to add using option "MVC 5 Controller with views, using Entity Framework" the Visual Studio gives me error,
"There was an error running selected code generator.
Exception has been thrown by the target of an invocation"
I have searched for this error and found different solutions for the same problem. I have tried few and I am now trying to upgrade the Entity FrameWork to version 6.1.3 through Nuget. When I remove the existing package 6.0.0 and install the new one and restart Visual Studio then it still is showing version 6.0.0 both in Web.config file and in the EntityFrameWork reference property window. I have tried to uninstall and install it various times but the result is same.
I have created just one Model and DBContext Class and apart from this whole project is empty. I am using Visual Studio 2013 Update 4.

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 .

how can i use Entity Framework 4.1 in Visual Studio 2012?

I have a web application on a web farm and i use .NET 4 and entity data model 4.1.
when i started working on this web application i used visual studio 2010, and today i have uninstalled it and installed new version (Visual Studio 2012).
Due to some reasons, i have deleted my ado.net entity data model to recreate it, but i
pay attention that visual studio 2012 use entity framework 5 not 4.1. I have updated it but in old model i can context constructor to change my connection string but in this new model have no constructor, is that true?
I have installed EF 4.1 but it doesn't works and I've added version 5 to my project.
Background info: my web application is on a shared host and i can not update it to EF 5.
How can i use entity framework 4.1 in visual studio 2012 ?
is that possible? if yes, how?
Remove Existing (Entity framework 5)
Remove the existing reference (to Entity framework 5) under the References section in your Project in Solution explorer.
Remove the corresponding entry from your packages.config file. If you open the packages.config file, you will see an xml structure and you will see an element with id EntityFramework with version attribute value as 5.0.0. Remove that line( that package element).
Add Again (Entity framework 4.1)
Now go to the package manager window(View->Other Windows -> Package Manager Console) and execute the following command there.
Install-Package EntityFramework -Version 4.1.10331.0
This will download EF 4.1 to your project and you will see the success message like below.
Reference : http://nuget.org/packages/EntityFramework/4.1.10331.0
Always keep in mind that there are a lot of improvements made in EF 5. So consider to consume all those as possible as you can.

Resources