Tag Archives

ASP.NET MVC3 Razor Error CS0012: The type is defined in an assembly that is not referenced

I came across an interesting compiler error message when working on an MVC3 Razor view the other day. I needed to bind model data from a type in the .NET System.DirectoryServices.AccountManagement namespace but received the following error when the View rendered. Compiler Error Message: CS0012: The type ‘System.DirectoryServices.AccountManagement.ContextType’ is defined in an assembly that is not referenced.

Comments Off on ASP.NET MVC3 Razor Error CS0012: The type is defined in an assembly that is not referenced

ASP.NET: Use Url.Content() from Razor to Resolve Relative URLs

You often need to resolve a relative URL to the proper absolute URL when using server-side programming platforms. Differences between development, test and production environments often mean the web server configuration for the application changes from one environment to another. Linking to resources can become nightmarish when moving from a virtual directory in dev to

MVC Razor Tip: Output Raw Unencoded HTML

I’m working on an MVC Razor project and need to output some raw HTML to disable an HTML text box if the text box is populated with a value. I realized, though, that my initial attempt didn’t render quite the output I expected. My original code to output the  disabled=”disabled” attribute (gotta love XHTML compliance!) was

The controller for path ‘/favicon.ico’ was not found or does not implement IController

I was working on an ASP.NET MVC project today and ran across some favicon.ico errors while troubleshooting another issue. When reviewing my event logs, I kept seeing the following error. The controller for path ‘/favicon.ico’ was not found or does not implement IController. Thankfully, this error is easy to address by adding a route constraint

Comments Off on The controller for path ‘/favicon.ico’ was not found or does not implement IController

IIS 5.1 (Windows XP) and ASP.NET MVC Application Extension Mapping Bug

I often use a Windows XP box for development (yes, I know I need to upgrade but it still works pretty darn well for me) and I ran into an issue I’ve seen before when setting up a test MVC application recently. To run an MVC application on IIS 5.1—the version of IIS on XP—you

Comments Off on IIS 5.1 (Windows XP) and ASP.NET MVC Application Extension Mapping Bug
Sign in
classic
Forgot password?
×
Sign up

(*) Required fields

I agree with OptimaSales Terms & Privacy Policy

×