Add reference to netNamedPipeBinding in .Net 5 - migrate

i have class library project in .net framework 4.6.1. i have to migrate that project into .net 5.
while doing so I am facing error for netNamedPipeBinding.
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'NetNamedPipeBinding' could not be found (are you missing a using directive or an assembly reference?)
following nuget package already installed.
System.ServiceModel.Duplex
System.ServiceModel.Http
System.ServiceModel.NetTcp
System.ServiceModel.Primitives
Any way to to make it work?

Looks like it is not supported.
Named pipes
WCF provided a named pipes binding for communication between processes on the same physical machine. The first release of
ASP.NET Core gRPC does not support named pipes. Adding client and
server support for named pipes (and Unix domain sockets) is a goal for
a future release.
https://learn.microsoft.com/en-us/dotnet/architecture/grpc-for-wcf-developers/wcf-bindings#named-pipes
Also, the documentation page for NamedPipeBinding is resolved to .NET 4.8 section and does not exist for .NET 5
https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.netnamedpipebinding
HttpBinding documentation page is there for .NET 5
https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.nethttpbinding

Related

how to use EF6.0 in .netframework 4.6.2 class library project referenced inside ASPNET Core 2.0 project

I am trying to use EF6.0 in Class Library Project .Net Framework 4.6.2 (Repository project) where the DBContext live next to the repository and the Entities have been created in different project(.NET framework 4.6.2) using Reverse Code First POCO,
The Repository will be called thru another (framework 4.6.2) Manager Project referenced inside ASPNET Core 2.0 SPA Project, where StructureMap used as IoC.
The first thing I faced was the issue of passing the connectionstring to the DBContext inside Repository Project, as I want to Register the services (DBContext,Repository) inside the Repository Project not from the ASPNET Core Startup.cs, the reason to that is to avoid exposing the DBContext to the frontend project, anyway I ended up hard-coding the connection string in Repo Project temporarily, "appreciate if there is another way!"
The main issue that I am facing with this design comes when the request send to collect the list of "Products", it reaches to the Repository Project where the Linq statement use _dbcontext.Product , then error message thrown
NotSupportedException: Unable to determine the provider name for provider factory of type 'System.Data.SqlClient.SqlClientFactory'. Make sure that the ADO.NET provider is installed or registered in the application config.
The Entityframework is registered inside Repository project, but not inside ASPNET Core 2.0 Project as it will show Nuget conflict error when its installed in ASPNET Core 2.0.
also I tried to install "System.Data.SqlClient" from Nuget in ASPNET Core2.0 but the error still throwing.
Any Idea on how to use EF6.0 in .netframework 4.6.2 class library project referenced inside ASPNET Core 2.0 project.
The Microsoft article Get Started with ASP.NET Core and Entity Framework 6 has the steps necessary for using Entity Framework 6 from a ASP.NET Core project.
Regarding the NotSupportedException, I would refer to the related question System.NotSupportedException: Unable to determine the provider name for provider factory of type 'System.Data.SqlClient.SqlClientFactory'.
I ran into the same issue because I failed to change the Core .csproj file from <TargetFramework>netcoreapp2.2</TargetFramework> to <TargetFramework>net471</TargetFramework> (which the article told me to do, but for some reason I thought wasn't necessary in Core 2.2).
I provided more explanation and details in the posted explanation/answer to the question I referenced above.

Cannot create a new controller for my new project

So I'm trying to start up a new project following a tutorial.
I'm using visual studio and writing in .net core.
When I try to create a controller i get the following error:
There was an error running the template
C:\Users\dyl.nuget\packages\microsoft.visualstudio.web.codegenerators.mvc\2.1.0\Templates\ControllerGenerator\EmptyController.cshtml:
Template Processing Failed:(4,47): error CS0234: The type or namespace
name 'Hosting' does not exist in the namespace
'Microsoft.AspNetCore.Razor' (are you missing an assembly reference?)
This may be a newbie question but I can't seem to find the cause of this problem.
I've tried separately installing the microsoft.aspnetcore.razor package to my project (which is now installed). But that didn't help.
If there is some information missing, please let me know.
The reason is assembly Razor version is for Asp.net Core 2.1 not 2.0, this goes for Design, SqlServer and Web.CodeGeneration.Utils Anything that was marked version 2.1. Either complete the migration from 2.0 to 2.1 or downgrade those 5 assemblies back to Asp.net Core 2.0
Or start over targeting 2.1 with the drop down at the top of the dialog for project creation

The type or namespace name 'IClientValidatable' could not be found - in .NET 4.7

I'm building an ASP.NET MVC app with VS 2017, targeting .NET 4.7, and I'm trying to build my models inside of business library being referenced by the web application. So I'm trying to get many of the same classes that come with an MVC project by default into a brand new class library.
Particularly, I'm getting the following error:
This is very different from the previous times this question was posted:
The type or namespace name 'IClientValidatable' could not be found
The type or namespace name 'IClientValidatable' could not be found (are you missing a using directive or an assembly reference?)
Namely, in that they both are solved simply by including the using statement for System.Web.Mvc where IClientValidatable lives.
But I've definitely already done that... Here's the reference manager for the class library with the reference included available for .NET 4.7
As further proof, here's a side by side example of where I can pull in some classes from System.Web.Mvc, but not IClientValidatable
For reference sake, here's the configuration on the class library itself
So did this class move somewhere? Is it available with .NET 4.7?
So the real question seems to be not where did it go, but why the most recent framework is targeting such an old version.
When trying to add a reference to System.Web.MVC while targeting .NET Framework 4.7, the only available option is MVC v2.0.0.0 which is incredibly old. When seeding a new MVC app, it'll come with v5.2.3.0
Here's the Assembly Explorer with both libraries loaded. Common items will be highlighted in each, but IClientValidatable wasn't added until later.
And here's the VS 2017 Reference Manager where you can add references based on your current framework, showing the old MVC library for the new .NET version.
So the question then becomes....
Q: How can I add a reference that is not available in the list of assemblies for my framework?
A: Same way you'd add any other reference - you can browse to a dll or grab it from nuget.
DLL If you already have a web app, there are good odds you can find the dll in your existing packages directory at something like:
\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll
If you prefer Nuget, some minor annoyances are that nuget package names don't exactly sync up with the assemblies they install, it's not easy to browse or search which assemblies come with which packages, and they libraries and frameworks often come bundled with other things you might not need. All that said, you'll be looking for the package called:
Microsoft.AspNet.Mvc on Nuget
Which will install the following libraries:

Visual Studio 2012 can't resolve namespace even though DLL reference seems fine

I have attempted to create an MVC 5 project by creating an MVC 4 project in Visual Studio 2012 and installing MVC 5 through Nuget.
I can build this fine.
I attempt to add a reference to another DLL, Sitecore.Mvc.DLL, which I can see was built against MVC 5.1.0. The DLL reference is added fine, and there seems to be no .NET framework conflict (which is where I've seen this issue in the past).
I'm trying to add a using statement to my code:-
using Sitecore.Mvc.Presentation;
IntelliSense picks this up fine....even allowing me to auto-complete 'Presentation'.
However when I build I get the following error:-
The type or namespace name 'Sitecore' could not be found (are you missing a using directive or an assembly reference?)
What could be the issue here?
I'm using:-
Visual Studio 2012 - Update 4
MVC 4 Web Application (initially)
MVC 5.1.0 Nuget Package
Sitecore 7.2 - Update 2 (where Sitecore.Mvc.DLL comes from)
.NET 4.5.2 installed on my machine.
Turns out I'm using a different version of Sitecore.Mvc.DLL, which IS targeted to .NET 4.5.1. Seems like the mscorelib reference in Reflector doesn't quite tell all the details.
Now I need to target my Web App to .NET 4.5.1, which means I need to follow the steps here to be able to select it.
http://blogs.msdn.com/b/dotnet/archive/2013/08/08/building-apps-with-the-net-framework-4-5-1-preview-in-visual-studio-2012.aspx
Thanks, and sorry to #Khanh TO, and everyone else for helping out.

Using Microsoft Data Entity Framework with Microsoft MVC on Mono 2.4

I'm using Mono 2.4 on the Ubiquity web hosting service.
I created a simple MVC tutioal applciation, linked here, and verified that it worked using all Microsoft tools.
Next, the application was updated to point to a MySQL server database running on my Ubiquity host. The application works great on a Microsoft based machine.
Now, I am trying to deploy the application to the mono server on Ubiquity.
I set System.Web.MVC so it will CopyLocal=true.
I deployed the application to the mono server.
I get this error:
Description: Error parsing a resource required to service this request. Review your source file and modify it to fix this error.
Parser Error Message: Assembly System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 not found
Version information: Mono Version: 2.0.50727.1433; ASP.NET Version: 2.0.50727.1433
I am guessing the problem could be...
A) The Entity framework is not supported in mono. I need to use something other than the Microsoft Data Entity Framework.
B) The public key token for the mono version of System.Data.Entity is not "b77a5c561934e089".
C) There is something else going on.
I tried setting CopyLocal=true for the System.Entity.Data dll. Thus, the Microsoft version of the DLL deployed to my mono server. I have doubts that this is legal. At any rate, that only produced the following error:
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
Question
Can somebody confirm that it is possible to use the Microsoft Entity Framework on Mono? I am probably going to migrate away from the Microsoft Entity Framework, per this comment in the Microsoft MVC tutorial linked above..
"The ASP.NET MVC framework is not tied to the Microsoft Entity Framework. You can create >your database model classes by taking advantage of a variety of Object Relational Mapping >(OR/M) tools including LINQ to SQL, Subsonic, and NHibernate."
However, for the sake of consistency, I would like to use the Microsoft Entity Framework on mono if that is possible.
I can confirm that EntityFramework, Microsoft Chart Controls, and Microsoft Sync Framework do NOT work on mono on Linux, despite different claims from Microsoft and/or MS-employees.
That is because Sync Framwork uses pinvoke with a COM interop component, Microsoft Chart Controls has DirectorySeparator issues, and the EntityFramwork namespace is not ported to mono, yet.
So note that when Microsoft says "works with mono", they mean "with mono on Windows".
It is estimated that the EntityFramwork port will take 1 year at least, until it reaches alpha/beta stage, that is, if somebody would decide to do that.
But there are no official plans to port EntityFramework.
EntityFramwork might work/s on the windows version of mono, as long as you set localcopy to true.
I advise you to use nhibernate instead.
Update:
As of Mono 2.11.3, Microsoft has open sourced EntityFramework.
Hence, it is now a part of Mono's distribution.
This version comes with 349 commits, with around 514 file changes.
It includes 15553 insertions
and 3717 deletions.
Two down, one to go.
I guess this means:
BIG THANKS TO MICROSOFT, THAT 'S TERRIFIC ! ! !
You should set CopyLocal = true for the System.Data.Entity assembly as well. You noted that you copied System.Web.MVC local, but never mentioned that you copied System.Data.Entity locally. You might also need to copy local any of the assemblies that System.Data.Entity depends upon that are not part of Mono.
It looks like there is no support in Mono for EDF at the moment, but someone is working on it.

Resources