locked
Cannot find System.Windows.Media.Imaging namespace RRS feed

  • Question

  •  

    I cannot seem to find the dll or namespace. I have searched my drive and have not found it. I have added other dlls in the hopes that I might bring in the right dll that gets this namespace with no luck!

     

    I stumbled on this forum after trying to the use the COM version of the WIC library. So now that I have moved onto the the NET version, I still am not having any luck. I have NET Framework 3.0 and WIC but somehow do not "see" the NET framework versions of the library.

     

    Any ideas out there?

     

    Regards,

    Nick Diaz

     

    Tuesday, October 30, 2007 7:39 PM

Answers

  • The System.Windows.Media.Imaging namespace is part of PresentationCore.dll (if you are using Visual Studio 2008 then the WPF application template will automatically add this reference). Note that this namespace is not a direct wrapping of the WIC library, although a large proportion of the more common uses are still available and it is relatively obvious how these map to the WIC versions. For more information on the classes in this namespace check out http://msdn2.microsoft.com/en-us/library/system.windows.media.imaging.aspx

     

    Andrew

    Tuesday, October 30, 2007 10:25 PM

All replies

  • The System.Windows.Media.Imaging namespace is part of PresentationCore.dll (if you are using Visual Studio 2008 then the WPF application template will automatically add this reference). Note that this namespace is not a direct wrapping of the WIC library, although a large proportion of the more common uses are still available and it is relatively obvious how these map to the WIC versions. For more information on the classes in this namespace check out http://msdn2.microsoft.com/en-us/library/system.windows.media.imaging.aspx

     

    Andrew

    Tuesday, October 30, 2007 10:25 PM
  • While this is useful to know, this did not quite solve my problem. I believe I have solved it and am now duplicating the "fix". The problem was several components needed to be installed before the proper assemblies were introduced (PresentationCore and WindowsBase).

     

    It would be nice if there was a comprehensive installer for developers using Windows XP.

     

    Nick

     

     

    Tuesday, October 30, 2007 11:21 PM
  • You say you solved the problem Big Smile How exactly did you do this? could anyone help me? pls
    Thursday, January 10, 2008 8:39 PM
  •  

    Yes, please, can anyone provide some answers here?  There was no extra step in the install, and i did a complete install.  The media namespace is simply not there.    If you enter "using System.Windows" the only option to select is "Forms".
    Monday, January 14, 2008 2:25 AM
  •  David The Lost wrote:

    Yes, please, can anyone provide some answers here?  There was no extra step in the install, and i did a complete install.  The media namespace is simply not there.    If you enter "using System.Windows" the only option to select is "Forms".

    It is not clear from your question what environment you are developing with, however I had a similar issue with VS2005 on XP SP2. Not sure why, but I ended up removing .Net 3.5, 3.0, and Windows Imaging Components (Can't remember exactly how it appeared in the Add/Remove Programs). Then reinstalled the Frameworks. (If I remember correctly that was actually due to an unrelated problem, but it appears to do no harm.)

     

    Then the only issue was finding the assemblies to reference. I found Presentation.Code.dll in "C:\Program Files\Reference Assemblies\Microsofr\Framework\v3.0". Added the reference to it into my project and it works from there

     

    --

    David

    Monday, January 14, 2008 10:07 AM
  •  

    Sorry.  I am using Visual Stuido 2008.  What I don't understand is, after having used VS 2003 and VS 2005, where all the assemblies were readily available, and installing the product allowed easy use of all needed class libraries, why do i now have to hunt for the "System.Windows.Media" namespace?
    Monday, January 14, 2008 3:57 PM
  •  

    Okay, for those hunting like I did, i right clicked "references" and added a reference to "PresentationCore", then added the "Using System.Windows.Media" in my code.  All is well.

     

    Thanks for the pointer.  By the by, i still don't think i should have had to do this......

    • Proposed as answer by YoHarmonica Monday, December 9, 2013 6:12 AM
    Monday, January 14, 2008 5:04 PM
  •  David The Lost wrote:

    Thanks for the pointer.  By the by, i still don't think i should have had to do this......

    You should not ... If you create a new project from a WPF template.

     

    These templates should include a reference to the assemble and hence namespace automatically. But, you may still need a using.

     

    --

    David

    Monday, January 14, 2008 5:08 PM
  • Just to clarify for anyone who needs it. To get System.Windows.Media and the others you do NOT reference "System.Windows.Presentation" you must reference "PresentationCore" and that should fix your problems.

    -Eforen

    P.s. i am just saying
    David The Lost's solution in a different way that clears a little confusion there mite be for some users that do not read things totally literally. Hope this helps someone. by the way why are you still here? get back to programming!  Stick out tongue
    • Proposed as answer by YoHarmonica Monday, December 9, 2013 6:13 AM
    Thursday, October 30, 2008 7:34 PM
  • Ok so I am trying to write a program in C# using VS2008.  I am trying to use System.Windows.Forms as I need Application.Exit in my code, but when ever I tried to compile it stuck on *.Windows.* saying it couldn't find it, so I did the referencing as suggested to "PresentationCore" and bingo, sorted, except it's not sorted.  Now it's stuck on *.*.Forms.

     

    Any advice?

    Friday, November 19, 2010 2:55 AM
  • Hi to all, here's my answer to the previous question. I’m running XP sp3 and all the .Net Frameworks upto 4.

     

    I like many had a problem with 'using System.Windows.Forms' in a VWD 2010 code behind page. It didn't have a ref to .Windows.

     

    I too tried adding a reference to 'PresentationCore.dll' (found in C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0 - on my pc), this sorted out the not seeing System.Windows part, but as above it was now complaining about not seeing .Forms part.

     

    This I thought I’d fixed by adding a reference to 'WindowsFormsIntegration.dll' in the same v3.0 folder as the previous dll. Great had no complaints about missing references on Windows.Forms. BUT still my MessageBoxButtons was complaining about missing references??

     

    What I did was start a new website in VWD 2010 and copied my MessageBoxButtons code into the Page_load of the code behind And nothing else.

    Then I added a Reference to System.Windows.Forms in my Solution Explorer (right-click 'C:\...\Website' select 'Add Reference', .NET tab, scroll down and select 'System.Windows.Forms').

    And great, I was able to type 'using System.Windows.Forms' and it was fine, including my MessageBoxButtons :) . So I did have the dll on my PC all along, so why did it work now but not in my other website also running?

     

    The answer I think was in my Web.config file, there was too many references to various System.blah.blah's, and one was conflicting with another and stopping my Website seeing 'System.Windows.Forms'.

     

    Easiest answer. I now Copied the new Web.config file to my original Website directory AFTER renaming original Web.config to something like WebOld.config, and Exclude from project 1st! (you may need to copy over some settings like connectionStrings, etc. later).

     

    Now on Checking 'using System.Windows.Forms' I found it was now fine. Also worth checking you have a reference to System.Windows.Forms in your 'Add Reference', if not add it now to be safe.

     

    Or you could delete all your '<add assembly="......> from your Web.Config file and then add a reference to 'System.Windows.Forms' in your Website 'Add Reference' section. Not sure on this working as not tried though.

     

    Hope this helps someone.

    Monday, March 28, 2011 10:14 AM
  • I would point out that their are useful classes in WPF that a developer may wish to use outside of a WPF application.  

    Thinking outside the scope of your own frame of reference, you might find that someone wants to do some back-end imaging work with bitmaps.  Sure they could use the legacy GDI+ in System.Drawing.  But there are a lot more useful new types in the System.Windows.Media.Imaging library that handle these tasks with far less code.  

    I point that use case out to say, there are uses for WPF libraries outside WPF application templates as well.

    Red Pill / Blue Pill -- I say to heck with it... take them both!

    Wednesday, April 23, 2014 11:05 PM
  • thank you man, you saved my day
    Friday, March 20, 2020 4:47 PM