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
Related
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
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.
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?
I have been trying to add daypilot to my project.
I have added all the code I thought I needed but this error I'm getting is confusing me.
I'm guessing i have a incompatible version of daypilot??
My error is displayed in this photo.
http://imageshack.us/photo/my-images/854/mvc3r.png/
It seems you are using MVC 3.0 in your project while DayPilot uses MVC 4.0.
Change your usage of MVC package to 4.0
I've just started up on an old project, which was written with MVC2...
Only a small amount of the front end was started, so I decided to use MVC3 and Razor view engine. I created a simple controller and view and went to view the site within Cassini but it just keeps telling me:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 22: using System.Web.WebPages;
Line 23: using System.Web.WebPages.Html;
Line 24: using WebMatrix.Data;
Line 25: using WebMatrix.WebData;
Line 26:
Source File: c:\Users\XXXXXX\AppData\Local\Temp\Temporary ASP.NET Files\root\ecf08653\deea7194\App_Web_index.cshtml.e70a5900.x4np9ici.0.cs Line: 24
As far as im aware WebMatrix is just a bundle of IIS/Sql Server and some other gubbins that im not interested in. I have not explicitly installed WebMatrix (unless it was bundled within MVC3 installer, and even then I cant find it on my harddisk).
Ive gone through my project and removed any and all traces I could find of WebMatrix and cleared the ASP temp files, but it keeps complaining, so im wondering if they have made MVC reliant upon some web matrix functionality?
Razor is part of the WebMatrix package, and MVC 3 is totally dependent on the ASP.NET Web Pages framework. WebMatrix.WebData includes the SimpleMembershipProvider, and is dependent on WebMatrix.Data. What version of MVC3 are you using? Not RC2? If so, see this thread: asp.net MVC webmatrix membershipprovider kicking in
Also if you install the Visual Studio 11 Developer Preview it will kill MVC Razor in your VS2010.
The CTP seems to be the key factor as any version of the Async CTP also kills MVC Razor.
So any MS CTP preview needs to be in a VMWare or PC-VM session as getting back to where you were will tale longer than it did just to install Visual Studio 11 Developer Preview or Async CTP. Seeing that the error is consistent, it seems to be thatanything 4.5 .NET is going to be very different as you move from C# 4.0 to C# 5.0 and Visual Studio 11 is not likely to come out till Nov 2012.