I'm going to run the ASP.net website on Visual Studio 2019
It used the ASP.NET MVC framework With NHibernate.
The solution has 5 projects including Domain, UI, Media, Resources, ...
When building the solution, gets these errors.
CS0234 The type or namespace name 'MediaServices' does not exist in the namespace 'ESK.Business' (are you missing an assembly reference?) Pazar.Domain E:\project\esk\src\Domain\ESK.Domain\Subscribers\MoveMediaCommand.cs
CS0234 The type or namespace name 'Resources' does not exist in the namespace 'ESK' (are you missing an assembly reference?) ESK.Domain E:\project\esk\src\Domain\ESK.Domain\BackgroundTasks\BetterTask\Commands\TaskNotifyGalleryOnCreateEmailCommand.cs
The first error is concerned soap service but I can't resolve it.
The second error is concerned the Resources project that has the App_GlobalResources package.
Please help me to fix these errors. I think it's ABC in programming.
Related
I have a SharePoint Provider Hosted app developed with Visual Studio (MVC 5, C#) 2015 and hosted in SharePoint 2013. Recently, I have upgraded Visual Studio to 2017.
I have the below namespaces on TokenHelper.cs class, but get error "The type or namespace name 'EventReceivers' does not exist in the namespace 'Microsoft.SharePoint.Client' (are you missing an assembly reference?)".
It would be a great help if someone can help resolving it.
Thanks in advance.
I have an existing ASP.NET core 2.2 (SDK version 2.2.108) Web API and I'm now adding MVC to host a web page with a controller. I've added:
- the new controller
- the new .cshtml view
- made sure my startup.cs contains services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
I'm using Http.Sys and I get 500 [Microsoft.AspNetCore.Server.HttpSys.MessagePump] ProcessRequestAsync.
If I enable exceptions in VS 2017 (15.9.13) I see:
Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException: 'One or more compilation failures occurred:
310z1p4f.mzl(4,41): error CS0234: The type or namespace name 'Razor' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
310z1p4f.mzl(5,40): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)
310z1p4f.mzl(4,82): error CS0518: Predefined type 'System.Type' is not defined or imported
310z1p4f.mzl(4,122): error CS0518: Predefined type 'System.String' is not defined or imported
and it continues.
I see in the build output:
Microsoft.AspNetCore.Razor.dll
Microsoft.AspNetCore.Razor.Language.dll
Microsoft.AspNetCore.Razor.Runtime.dll
I followed several different discussions on SO and github:
https://stackoverflow.com/a/51908353/5048049
https://github.com/dotnet/standard/issues/542
The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
The type or namespace name 'Hosting' does not exist in the namespace 'Microsoft.AspNetCore.Razor'
https://github.com/aspnet/AspNetCore.Docs/issues/8880
but no luck. Ideas?
Ok, I found the issue. Basically, there are two projects:
a console app which can be also run as a Windows service . This instantiate the web server
a library which contains the Web API
Both were targeting <Project Sdk="Microsoft.NET.Sdk">, once I've changed 2 to use <Project Sdk="Microsoft.NET.Sdk.Web"> and to be a library not console app, everything started working.
It took me a long time to figure this out, since the Web API was working fine before with that (wrong) configuration. meh!
Ok, Try this right click your project and edit your project file.
under project reference you should see
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0"
PrivateAssets="All" />
if you do not add it.
I am trying to host the asp.net core application and for that I tried Nowin as it is given in Documentation, But even Nowin creates the another process names MyProject.exe.
I want to install IIS in In proccess of app pool instead of creating the different process(Kestrel). Second thing is I use default project template of aspnet core and commented use Kestrel and added Nowin as given in samples. It still creates the new process. The reason I need it to be in same process because Performance monitoring tool I use (NewRelic) does not yet support Kestrel. If I create new project in mvc 5, Empty template and then add aspnewcore nuget packages, It comes till controller, But when It goes to razor it gives error(It works perfect with return Json). Can you help me to know whether it is issue or not? If it is not issue, How can I achieve it? Which type of project I should create?
Error in old website project with aspnet core nuget.
One or more compilation failures occurred:
4nut20vs.g5q(10,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
4nut20vs.g5q(11,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
4nut20vs.g5q(12,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
4nut20vs.g5q(15,36): error CS0234: The type or namespace name 'ViewFeatures' does not exist in the namespace 'Microsoft.AspNetCore.Mvc' (are you missing an assembly reference?)
4nut20vs.g5q(16,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
4nut20vs.g5q(18,86): error CS1980: Cannot define a class or member that utilizes 'dynamic' because the compiler required type 'System.Runtime.CompilerServices.DynamicAttribute' cannot be found. Are you missing a reference?
4nut20vs.g5q(18,86): error CS0518: Predefined type 'System.Boolean' is not defined or imported
4nut20vs.g5q(18,45): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
4nut20vs.g5q(43,16): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'..........
It's not possible to host ASP.NET Core in process with IIS. See https://learn.microsoft.com/en-us/aspnet/core/publishing/iis for more details.
The reason I need it to be in same process because Performance monitoring tool I use (NewRelic) does not yet support Kestrel.
Sounds like the NewRelic support you're using is for System.Web based applications. Does it support profiling a managed exe?
My project is hosted on github. Everything gets compiled fine on my local machine, but AppVeyor reports some weird errors like:
Properties\AssemblyInfo.cs(9,12): error CS0246: The type or namespace
name 'AssemblyTitle' could not be found (are you missing a using
directive or an assembly reference?)
It looks like some base references are not recognized. Is PCL supported on AppVeyor? I could not find any info.
What can I do to fix errors?
I am trying to build iConf.NET demo for video conferencing SDK.
The projects have references to assemblies named:
iConfClient.NET.dll
iConfServer.NET.dll
The references are ok.
In code there are following lines:
using iConfServer.NET.HelperClasses;
..etc, which are causing the errors of type
The type or namespace name 'iConfServer' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Администратор\Desktop\iConfNetSDKDemos\PictureInPictureVideoPhone\MainForm.cs
Any help will be appreciated