When I am trying to go to Umbraco admin page I am getting this 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: CS0234: The type or namespace name 'Mvc' does
not exist in the namespace 'ClientDependency.Core' (are you missing an
assembly reference?)
Source Error:
I've tried to uninstall and install nuget package again , restarted visual studio (13) , restarted the workstation , removed reference and added again. Nothing help.
Have anyone faced with this kind of problem ?
Related
I have a mvc3 application in. net framework 4.7.2.
This is a solution that was upgraded from mvc2 and build with out issue in visual studio 2019.
I do not have any nuget package.
My source code is in git azure devops.
I try to create a asp.net build in azure devops and I receive the following errors
List item Error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Error CS0246: The type or namespace name 'HtmlHelper' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246: The type or namespace name 'UrlHelper' could not be found (are you missing a using directive or an assembly reference?)**
Please note I have system.web.mvc and system.web.webpages added to my references in MVC project and it complies ok in Visual Studio 2019.
here is content of my yml file:
You need to first restore NuGet packages so please enable these steps:
- task: NuGetToolInstaller#1
- task: NuGetCommand#2
inputs:
restoreSolution: '$(solution)'
I figured out the issue . I did not have any package.config in my solution . I added that and installed asp.net MVC package and it works now
I have updated our ASP.NET Web API solution to include the Microsoft.Azure.NotificationHubs Nuget package as I want to be able to send push notifications to our mobile clients. I have written a new controller that does this. Everything works fine.
When I check-in the code changes to our on-premise TFS build server I am getting the error:
Error CS0234: The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
I have updated the build server to the latest VS2017 build tools but am still getting the error. I can't determine if this is an MSBUILD or VS error.
I am using Visual Studio 2017 15.9.4. The project uses .NET Framework 4.6.1.
UPDATE
After some further investigation I can see that the TFS build server is NOT restoring the Nuget package for Microsoft.Azure.NotificationHubs but restores all the other Nuget packages. So the problem seems to be due to the Nuget package not being restored during the build
Here is a screenshot showing that the package.config correctly references the nuget package. But for some reason this nuget package is NOT getting restored during the build.
I've eventually managed to fix this by adding a commandline nuget restore task to the build pipeline.
NuGet.exe restore MySolution.sln
I resolved it by uninstalling and installing the nuget package back again.
I downloaded Umbraco 7.7.2, unzipped folder and opened in VS2015 as website. When i compile or run project i get error
The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?) C:\Projects\CMS\UmbracoCms.7.7.2\Umbraco\PartialViewMacros\Templates\Gallery.cshtml
This is code that is throwing error
Question: How do I create a new project without this (authentication-related) error?
Symptoms: The new (completely unaltered) project does not build (see Build Errors image).
Error replication steps:
Open Visual Studio (my version = 2015)
File
New
Project (see Project image for settings)
OK
Error (see Error image for alert)
OK
Build
Build Errors (see Build Errors image)
Note: the error only appears when authentication is included in the new project and appears to be related to authentication because I receive several warnings and errors concerning authentication-related dependencies (see Dependencies image for warnings).
I've tried...
Closing and re-opening Visual Studio
Uninstalling and re-installing Visual Studio
Project
Error
Dependencies
Build Errors
Some errors (if the image is hard to read)
CS0246 The type or namespace name 'SignInManager' could not be found (are you missing a using directive or an assembly reference?)
CS0246 The type or namespace name 'OwinStartupAttribute' could not be found (are you missing a using directive or an assembly reference?)
CS0246 The type or namespace name 'IdentityUser' could not be found (are you missing a using directive or an assembly reference?)
CS0246 The type or namespace name 'IAuthenticationManager' could not be found (are you missing a using directive or an assembly reference?)
The screenshots you attached are clearly showing that you have broken references for asp.net identity framework.
You can try removing those references and install the nuget package again.
Here is the package name : Microsoft.AspNet.Identity.Owin
https://www.nuget.org/packages/Microsoft.AspNet.Identity.Owin/
I am trying to get an MVC solution to build on a test server without having visual studio or MVC 4 installed on the machine.
The solution refers to all the required MVC assemblies as nuget packages. In the projects all of the MVC assemblies are marked as copy local. Of course, on my dev machine the solution builds fine in visual studio.
On the build machine I have installed the .net sdk and I am trying to use MSBuild to build the solution. All of the nuget packages are under source control and when I do an SVN update on the server it gets all of the packages.
When I run the build I am getting a broken reference to the MVC DLLs. I don't get why this is happening since in the solution the DLLs are referenced and are present for the build to use.
Here is a sample of the error returned by MSBuild...
DataAnnotations\RunDataAnnotationsFromModelPropertyAttribute.cs(5,18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
DataAnnotations\RunDataAnnotationsFromModelPropertyAttribute.cs(12,93): error CS0246: The type or namespace name 'IClientValidatable' could not be found (are you missing a using directive or an assembly reference?)
Security\MyAuthenticateAttribute.cs(6,18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Security\MyAuthenticateAttribute.cs(12,48): error CS0246: The type or namespace name 'AuthorizeAttribute' could not be found (are you missing a using directive or an assembly reference?)
Security\MyAuthorizeAttribute.cs(5,18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Security\MyAuthorizeAttribute.cs(13,45): error CS0246: The type or namespace name 'AuthorizeAttribute' could not be found (are you missing a using directive or an assembly reference?)
Web\Mvc\MyLoginController.cs(7,18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Web\Mvc\MyLoginController.cs(44,62): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) ...
I have spend hours on this. It frustrates me that it builds in visual studio on my machine but not on the server using msbuild.
Seth
Right click on the project and click "Unload" and then again and click "Edit".
Find the <Reference> for System.Web.Mvc. If the <HintPath> doesn't refer to the "packages" directory (or is missing), then that's your problem. Just remove the package and all references and start again.
NuGet package restore only restores the files on disk, it doesn't update the project references.
"Copy local" just means it'll copy the assemblies from your MVC3 installation which you haven't installed on your remote machine.
Did you try to copy the MVC dlls to a folder (which you commit to your VCS repository) in your project and reference all of them from there instead from the default installation directory?? That should work just fine.
Try running nuget install on the solution prior to running your msbuild command? If you are running VS2010 or later and have updated the nuget extension to the latest version, there is an option on the Project menu to "Enable Nuget Package Restore." This will configure your solution and project files to that they run nuget install as part of the build process.