Upgrade Entity Framework 4.0 to 6.0 not working - entity-framework-4

net MVC 2 to asp.net MVC 4 without any problem.
And then, I tried to upgrade entity framework 4.0 to entity framework 6.
The result is not good. I have about 15000 error.
I have this error appear several times
The type or namespace name 'ComplexObject' could not be found
An other error
Error 14331 The type or namespace name 'EdmComplexTypeAttribute' could
not be found (are you missing a using directive or an assembly
reference?)
Error 5460 The type or namespace name 'EdmEntityTypeAttribute' could
not be found (are you missing a using directive or an assembly
reference?)
I don't know where to begin.
Any Idea ?

You need to update templates too. In EF6 some types were moved to different namespaces and the code that is being generated is using namespaces from EF4/5. You can get T4 templates for ObjectContext on VS Gallery. Also take a look at this article about moving your app to EF6 from an earlier EF version.

Related

Add reference to netNamedPipeBinding in .Net 5

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

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

Team Foundation Server: References Issue

I am very new to TFS and I am having trouble with references after checking out a solution and trying to build it. When I build the solution it gives me several error messages such as
"The type or namespace 'AspNet' does not exist in the 'Microsoft' namespace..."
I have tried using NuGet to manage the packages, but I still have 6 errors similar to the one above.
Error 1 The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Error 2 The type or namespace name 'FriendlyUrls' does not exist in the namespace 'Microsoft.AspNet' (are you missing an assembly reference?)
Error 3 The type or namespace name 'IAppBuilder' could not be found (are you missing a using directive or an assembly reference?)
(Errors 4 and 5 reference Optimization and IAppBuilder again.)
Error 6 The type or namespace name 'BundleCollection' could not be found (are you missing a using directive or an assembly reference?)
I cannot figure out how to get the last few errors out, and I need to find a way to avoid having to update my solution every time I check it out of my TFS.
We were dealing with a web site and when we attempted to add this web site to our TFS it was losing our references to all DLL's (including basic web DLL's). We created a shared folder location for our DLL's, copied the DLL's into the shared folder, and then converted our website to a web application using the following tutorial:
Converting a web site to a web application.
After we converted we added the project to our TFS and it worked without any issues.

Attempted a roll back from .Net 4.5 to 4.0 now getting missing assembly errors even though they are there

I attempted a roll back of an Asp.Net MVC project from .Net 4.5 to .Net 4.0 to accommodate older servers in the hosting environment.
Now I am getting many similar errors:
Error 69 The type or namespace name 'Mvc' does not exist in the
namespace 'System.Web' (are you missing an assembly reference?)
I have removed the references in the project and re-added the references several times. Intellisense shows everything as being valid but when I go to compile I still get the above errors.
What is the proper way to rollback a project from 4.5 to 4?
Just off the top of my head, did you try cleaning the solution and/or deleting the contents of the "OBJ" folder?

MVC3 .Net precompile issue in IIS 6

I have an MVC3 C# .Net web app and I am running aspnet_compiler on my app in order to precompile. I am running this command:
aspnet_compiler -v /dev/boe
Boe is the app in the dev structure under "Default Web Site". The above command is producing this error.
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\dev_boe\25d5f53a\2ad742fc\App_Web_vujir5mm.0.cs(29): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'BOE' (are you missing an assembly reference?)
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\dev_boe\25d5f53a\2ad742fc\App_Web_vujir5mm.2.cs(29): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'BOE' (are you missing an assembly reference?)
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\dev_boe\25d5f53a\2ad742fc\App_Web_vujir5mm.3.cs(29): error CS0234: The type or namespace name 'Models' does not exist in the namespace 'BOE' (are you missing an assembly reference?)
However, Models isn't in our solution. We have our Model objects in a Domain project that is referenced by our web app. It appears that the compiler is expecting a Models reference in our MVC app. Is this true? Or is something else causing this error?
Thanks to David Hirst's suggestion to look at the line of code in the temp file I found the issue:
Basically, there were files that were not included in the Visual Studio solution BUT were still in the file structure on my machine. There were 3 .cshtml files referencing Models. Since the files were not included in the solution, they were not included in a Build using VS. And also, since they were not in the solution, when I did a search for Models, I didn't get any results...but the compiler sweeps the entire directory structure and therefore tried to compile the files with the bad references.
Outstanding lesson in being sure to remove legacy code, and make sure the code base and file structures are in snyc.
I have had a similar error when trying to use the Razor engine on IIS 7.5 (even though .NET 4 was installed!)
If you have a reference in your project as you suggest you may need to go into references, highlight it, go properties and under Copy Local, set this to true. Re-Publish and hopefully this will solve your problem as it did mine.

Resources