The name 'viewbag' does not exist in the current context in mvc - asp.net-mvc-5

Im using visual studio 2017 and use asp.net mvc-5. My project have error "The name 'model' does not exist in the current context in mvc" at all views

Related

Visual studio 2017: Razor views- HtmlHelper doesn't contain methods

ASP.Net MVC 5 project is working fine in VS 2015.
If I open it in VS2017 from the same place on the same machine I got errors in Razor views like:
"'HtmlHelper' does not contain a definition for 'ActionLink' and no extension method 'ActionLink' accepting a first argument of type 'HtmlHelper' could be found"
"The name 'ViewBag' does not exist in the current context"
errors window
I looked for similar errors but cannot find anything about VS 2017.

How do I add a reference to my Model(s) to a unit test project for MVC 5 in Visual Studio 2015?

Background: learning about MVC, Bootstrap, etc. So, new to doing this in Visual Studio. More of a C# backend programmer / hand-rolled html/css/js fiddler.
I'm trying to add a unit test to an MVC project, and I get the uselessly generic "A reference to 'Your Project Name' could not be added." error when I try to reference my main project so I can test against my Model classes.
Visual Studio 2015 Professional
Created new Project with File -> New Project -> Templates -> Visual C# -> Web -> ASP.NET Web Application
Selected "Web Application" from ASP.NET 5 Preview Templates
Added some code, including a class to serve as a model for Code First.
Added a Unit Test project under the Solution folder by right-clicking and choosing Add -> New Project, under the Visual C# folder for the templates I picked Test -> Unit Test Project. The targeted framework at the top was set to .NET Framework 4.5.2
Googling around suggested that I had a target framework mismatch. I don't know how to check the target framework on a MVC project I guess, the Project Properties window lists Application and Solution DNX SDK version ( set to 1.0.0-beta5, platform .NET Framework ) but doesn't tell me what framework I'm targeting.
How I can utilize Microsoft's unit testing framework with this kind of project?
In Visual Studio, open the Package Manager Console (TOOLS > Nuget Package Manager > Package Manager Console) and type the following command:
Update-Package
This will update and 'level' all packages of both projects and any version mismatch should be fixed.

ASP.NET MVC Error on Creating a new project

I get this error when trying to create a new ASP.NET and ASP.NET MVC project in Visual Studio 2015 professional
Any one with a solution on how to fix this

IBM Worklight - "System.NotSupportedException" in Visual Studio

Hi I am using Worklight to develop application for Windows Phone 8. The application was working fine, however when I applied the Fix Patch for Worklight the Windows Phone Console started to give me below error :
An exception of type 'System.NotSupportedException' occurred in Microsoft.Phone.ni.dll and wasn't handled before a managed/native boundary
The other error is
Error:"Unable to get property 'content' of undefined or null reference file:x-wmapp0:/www/skinLoader.html Line:1"
Any one has any idea why these two errors started coming all of sudden?
Moreover, where can I change Worklight specific properties in Visual studio?
Moreover, where can I change Worklight specific properties in Visual
studio?
There are no "Worklight specific properties" in Visual Studio.
Once you build the Worklight project in Eclipse and open the result (in your case, the generated Windows Phone 8 project) in Visual Studio, that's it - it is a Windows Phone 8 project.
Error:"Unable to get property 'content' of undefined or null reference
file:x-wmapp0:/www/skinLoader.html Line:1"
Try to:
Delete the native folder in Eclipse from the your-project\apps\your-app\windowsphone8 folder
Re-build and deploy the application
Re-open it in Visual Studio
As for the SystemNotSupportedException message, this can be safely ignored.

Visual Studio InstallShield Project building error about localized resources

I created an InstallShield setup project in Visual Studio 2012. In the Application Files section of Project Assistan, I added "Primary output" and "Localized resources" files by using Add Project Outputs button after that completed all other sections. When I trying to build setup project, I'm getting an error like below.
Could not resolve Visual Studio .NET project output '{ProjectName}.Localized resources' from component {ProjectName}.Localized_resources
I have three different projects in my solution and I have got this error for two projects.
If there is no any localized resource in a project, InstallShield gives this error. To avoid this error (maybe you will complete all resources localization when project completed but you need to setup now) and complete setup project building, at least one resource file must be localized in project.

Resources