Namespace Reference in inline aspx page issue

Posted on 2010-01-06
Last Modified: 2013-12-17
Afternoon all i was hoping someone would be able to help me with this issue:

I have an in-line aspx page that i have written to be a status page for an F5 Load Balancer which needs to reference the system.messaging namespace to do status checks on an MSMQ server i constantly receive the error: CS0234: The type or namespace name 'Messaging' does not exist in the namespace 'System' (are you missing an assembly reference?).

Would much appreciate any assistance if possible thanks.
Question by:Grant Spiteri
    LVL 9

    Expert Comment

    In your project, Add Reference, Find System.Messaging, add it, compile again.
    The System.Messaging is not included for web application by default, that's why you need to add it.
    LVL 9

    Author Comment

    by:Grant Spiteri
    My apologies i didn't make it clear that this needs to be a stand alone web page
    LVL 9

    Author Comment

    by:Grant Spiteri
    I have looked at the following also but still to no avail
    LVL 9

    Accepted Solution

    The only work around i could find was the following:

    - Create a web.config for the single aspx file that looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
        <compilation debug="true">
            <add assembly="System.Core, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="System.Data.DataSetExtensions, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Xml.Linq, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="System.Messaging, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

    - ensure that <%@ Import Namespace="System.Messaging" %> is above the page directive.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now