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. [...]
ASP.NET MVC3 Razor Error CS0012: The type is defined in an assembly that is not referenced
Injecting Conditional HTML and Content Blocks with ASP.NET MVC Razor
I have been working recently with ASP.NET MVC 3 and the Razor view engine. For part of the work I’m doing, I need to send some content to the browser based upon certain conditions. I described a couple of ways to do this before in this post and this post and I wanted to share [...]
Use the .NET HtmlString Class to Output Raw HTML
I posted recently about sending raw unencoded HTML to the client using the Html.Raw() method with MVC 3 and the Razor view engine. I wanted to extend a bit on that post regarding the magic underlying the Html.Raw() method, the HtmlString class in the System.Web namespace of the .NET framework class library. You can use the [...]
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 [...]
Dynamically Inject HTML into an ASP.NET MVC View
Our software products display a licensing message at the top of the page if the software is in an evaluation/trial phase or if the software license is not valid. To insert the message into the page using MVC 3 and the Razor view engine, we use a simple, elegant method to add content in a [...]
ASP.NET MVC Razor and Ternary/Conditional Operators or Other Compound Expressions
Many times we have areas of an MVC Razor view that displays based upon some condition. For example, we may want show a placeholder message if we have a blank string. In this example, we use the C# ternary/conditional operator to test the message length and display a placeholder message if the original message has [...]
MVC 3 Beta Fun with Visual Studio 2010
We are using the release candidate (RC2) of the Microsoft ASP.NET MVC 3 Model-View-Controller framework for a project we’ve been working on for a while. You can find more info for MVC 3 RC2 here: http://weblogs.asp.net/scottgu/archive/2010/12/10/announcing-asp-net-mvc-3-release-candidate-2.aspx. Another developer in our organization set up the initial project using Visual Studio 2010 and then checked the project [...]
- Office 365 and BlackBerry Calendar Synchronization: A Replacement for BlackBerry Enterprise Server Functionality July 7, 2011
- Office 365 and BlackBerry Enterprise Server Express July 8, 2011
- Windows Active Directory Cached User Credentials June 9, 2011
- RIM Gets Closer to Cloud-Based BlackBerry Enterprise Service (BES) for Office 365 August 15, 2011
- Efficient Queries with LDAP Search Filters March 30, 2012
- System.Security.SecurityException Writing to the Application Event Log on Windows Server 2008 with ASP.NET 4.0 April 6, 2012
- Redirect HTTP to HTTPS on Microsoft IIS 7 and 7.5 April 2, 2012
- Efficient Queries with LDAP Search Filters March 30, 2012
- Create a Code Signing Certificate on Windows Server 2008 with OpenSSL and pvkimprt March 29, 2012
- Configure ASP.NET with Load Balancing on a Web Farm to Avoid ViewState Errors March 23, 2012
-
Jason Cox: We work with Microsoft Active Directory and the AD...
-
Engin: Great article. thanks for posting....
-
Feruza: If you set the port for OpenDS to 389, it means th...
-
Jason Cox: This doesn't sound like a SQL Server engine issue...
-
vic: Advise isn't helpful. Still get the same error me...
Blogroll
- Active Directory Powershell Blog
- Active Directory Tools Review
- Brian Desmond’s Blog
- Brian Desmond’s Blog
- Dirk Adamsky’s Scripting Blog
- Florian’s Blog
- IT Geared
- JFRMilner’s Tech Blog
- Mark Parris’s blog
- Microsoft Active Directory resources for Server 2008 R2
- Mike Kline’s AD is Fun Blog
- Mike Kline’s AD is Fun Blog
- Stuart Coney’s Blog
- Tim Springston’s Active Directory Blog
- Ulf B. Simon-Weidner’s Blog – Directory Services/Active Directory






