none
Daily "Rebuild Solution" required

    Question

  • I've a (annoying) problem. To be able to work on my WPF application, I need to "Rebuild Solution". The symptoms (what I get in the output window) are listed below. And of course everything is going well after a "Rebuild Solution". But this still means that there is a trouble somewhere!
    Any ideas guys to make my day? 

    // The output window -------------------------------------------------------------------------------------------------

    A first chance exception of type 'System.IO.IOException' occurred in PresentationFramework.dll

    Additional information: Cannot locate resource 'images/dartfish.ico'.

    A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll

    Additional information: Cannot convert string 'pack://application:,,,/Dartfish.Applications.Application;component/images/Dartfish.ico' in attribute 'Icon' to object of type 'System.Windows.Media.ImageSource'. Cannot locate resource 'images/dartfish.ico'. Error at object 'Dartfish.Applications.Application.Window1' in markup file 'Dartfish.Applications.Application;component/window1.xaml' Line 13 Position 18.

    A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll

    Additional information: Cannot convert string 'pack://application:,,,/Dartfish.Applications.Application;component/images/Dartfish.ico' in attribute 'Icon' to object of type 'System.Windows.Media.ImageSource'. Cannot locate resource 'images/dartfish.ico'. Error at object 'Dartfish.Applications.Application.Window1' in markup file 'Dartfish.Applications.Application;component/window1.xaml' Line 13 Position 18.

    A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll

    Additional information: Cannot convert string 'pack://application:,,,/Dartfish.Applications.Application;component/images/Dartfish.ico' in attribute 'Icon' to object of type 'System.Windows.Media.ImageSource'. Cannot locate resource 'images/dartfish.ico'. Error at object 'Dartfish.Applications.Application.Window1' in markup file 'Dartfish.Applications.Application;component/window1.xaml' Line 13 Position 18.

    A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll

    Additional information: Cannot convert string 'pack://application:,,,/Dartfish.Applications.Application;component/images/Dartfish.ico' in attribute 'Icon' to object of type 'System.Windows.Media.ImageSource'. Cannot locate resource 'images/dartfish.ico'. Error at object 'Dartfish.Applications.Application.Window1' in markup file 'Dartfish.Applications.Application;component/window1.xaml' Line 13 Position 18.

    Cannot initialize Application
    System.Windows.Markup.XamlParseException: Cannot convert string 'pack://application:,,,/Dartfish.Applications.Application;component/images/Dartfish.ico' in attribute 'Icon' to object of type 'System.Windows.Media.ImageSource'. Cannot locate resource 'images/dartfish.ico'. Error at object 'Dartfish.Applications.Application.Window1' in markup file 'Dartfish.Applications.Application;component/window1.xaml' Line 13 Position 18. ---> System.IO.IOException: Cannot locate resource 'images/dartfish.ico'.
    at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
    at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
    at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
    at System.IO.Packaging.PackWebResponse.GetResponseStream()
    at System.IO.Packaging.PackWebResponse.get_ContentType()
    at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri, Stream stream, BitmapCacheOption cacheOption, Guid& clsId, Boolean& isOriginalWritable, Stream& uriStream, UnmanagedMemoryStream& unmanagedMemoryStream, SafeFileHandle& safeFilehandle)
    at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)
    at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy)
    at System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
    at System.ComponentModel.TypeConverter.ConvertFromString(ITypeDescriptorContext context, CultureInfo culture, String text)
    at System.Windows.Markup.XamlTypeMapper.ParseProperty(Object targetObject, Type propType, String propName, Object dpOrPiOrFi, ITypeDescriptorContext typeContext, ParserContext parserContext, String value, Int16 converterTypeId)
    --- End of inner exception stack trace ---
    at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
    at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
    at System.Windows.Markup.XamlTypeMapper.ParseProperty(Object targetObject, Type propType, String propName, Object dpOrPiOrFi, ITypeDescriptorContext typeContext, ParserContext parserContext, String value, Int16 converterTypeId)
    at System.Windows.Markup.BamlRecordReader.ParseProperty(Object element, Type propertyType, String propertyName, Object dpOrPi, String attribValue, Int16 converterTypeId)
    at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
    at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
    at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
    at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
    at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
    at System.Windows.Markup.TreeBuilder.Parse()
    at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
    at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
    at Dartfish.Applications.Application.Window1.InitializeComponent() in c:\Dartfish\Dartfish Software 5.0\Source\Applications\Application\Window1.xaml:line 1
    at Dartfish.Applications.Application.Window1..ctor(ApplicationHost host) in C:\Dartfish\Dartfish Software 5.0\Source\Applications\Application\Window1.xaml.cs:line 31'Dartfish.Applications.Player.exe' (Managed): Loaded 'C:\Dartfish\Dartfish Software 5.0\Bin\Debug\Dartfish.Components.ChannelIOLib.dll', Symbols loaded.
    Tuesday, February 24, 2009 7:56 AM

All replies

  • For more detailed information, can you paste your demo code here? Or send the full version of your project to my email:

    liangtom@gmail.com

    Wednesday, February 25, 2009 8:52 AM

  • I'm trying to produce a simple... And it is not that easy. Starting from scratch with a brand new project (see attached zip), the problem isn't present. Or stripping the code I don't want to share, the problem disappeared. Too bad.

    Another Output snapshot that is (for me) closely related to my problem:
    System.IO.IOException: Cannot locate resource 'presenterribbonbarlauncher.xaml'.
       at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
       at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
       at System.IO.Packaging.PackagePart.GetStream()
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at Dartfish.Packages.PresenterPack.PresenterRibbonBarLauncher.InitializeComponent() in c:\Dartfish\Dartfish Software 5.0\Source\Packages\PresenterPack\PresenterRibbonBarLauncher.xaml:line 1
       at Dartfish.Packages.PresenterPack.PresenterRibbonBarLauncher..ctor() in C:\Dartfish\Dartfish Software 5.0\Source\Packages\PresenterPack\PresenterRibbonBarLauncher.xaml.cs:line 26


    Simple that simulates the launching procedure of my application:

    - A Launcher which is compiled/linked in 1 EXE
    namespace Launcher 
      public static class LauncherMain 
      { 
        [STAThreadAttribute()] 
        public static void Main() 
        { 
          WpfApplication2.App app = new WpfApplication2.App(); 
          app.Run(); 
        } 
      } 
     


    - Then the App (in a DLL)
    namespace WpfApplication2 
      public class App : System.Windows.Application, 
        System.IDisposable 
      { 
        public App() 
        { 
          Startup += new System.Windows.StartupEventHandler(Application_Startup); 
          Exit += new System.Windows.ExitEventHandler(Application_Exit); 
        } 
        #region IDisposable Members 
        public void Dispose() 
        { 
          Dispose(true); 
          GC.SuppressFinalize(this); 
        } 
     
        protected virtual void Dispose(bool disposing) 
        { 
          if (disposing) 
          { 
          } 
        } 
        #endregion 
        #region Handlers 
        void Application_Startup(object sender, System.Windows.StartupEventArgs e) 
        { 
          Window1 window = new Window1(); 
          window.Show(); 
        } 
     
        void Application_Exit(object sender, System.Windows.ExitEventArgs e) 
        { 
          Dispose(); 
        } 
        #endregion 
      } 


    - And finally the window where resources are missing (without recompilation) (in the same DLL as App)
    <Window x:Class="WpfApplication2.Window1" 
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
            Title="Window1" Height="300" Width="300" 
            Icon="pack://application:,,,/WpfApplication2;component/images/Dartfish.ico"
        <Grid> 
             
        </Grid> 
    </Window> 
     




    Thursday, February 26, 2009 8:00 AM
  • You know what? I'm feeling (less) alone...

    After googling a bit I found few threads with people like me having trouble with System.IO.Packaging.PackagePart.GetStream! All the following threads are describing different problems, but with the same System.IO.IOException and the same tail of the stack.

    Thursday, February 26, 2009 1:47 PM
  • I have the same issue. PBOC, did you find the solution?
    I feel that this bug can be related to ClickOnce publishing
    Tuesday, July 14, 2009 10:18 AM
  • Yeah....
    I am next in Line.

    It really is unbelivable......

    This really is a major issue but noooo no fix in sight, even after 2 years... sign really greate.

     

    Here is my Code:

    C#

     

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    
    namespace Test1
    {
     /// <summary>
     /// Interaction logic for MainWindow.xaml
     /// </summary>
     public partial class MainWindow : Window
     {
     public MainWindow()
     {
     InitializeComponent();
     WebProxy prox = new WebProxy("88.191.73.48:80", true, new String[1], null);
     }
     }
    }
    

    and xaml

     

     

    <Window x:Class="Test1.MainWindow"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     Title="MainWindow" Height="350" Width="525">
     <Grid>
     
     </Grid>
    </Window>
    
    

     


    This truely STINKS.

    This isn't a feature it is a F****** BUG FIX IT.
    and it doesn't even complain upon compilation, it complains upon running. the code,inside of VS2010


    //edit

    Just to be thorow(The Exception):

    A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
    
    Additional information: 'The invocation of the constructor on type 'Test1.MainWindow' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'.


    Friday, August 19, 2011 4:22 PM
  • A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll Additional information: 'The invocation of the constructor on type 'Test1.MainWindow' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'. 

    The invocation of the constructor <<--------------

    This is your constructor:

     public MainWindow()
     {
     InitializeComponent();
     WebProxy prox = new WebProxy("88.191.73.48:80", true, new String[1], null);
     }

    So... I would guess that WebProxy is throwing an exception.

    If you look at the inner exception you'll see:

    {"Value cannot be null.\r\nParameter name: pattern"}

    So it's a problem with a null in the parameters.  Try this:

    WebProxy prox = new WebProxy("88.191.73.48:80"truenew String[1]{""}, null);
    

    In the future, when you get that error I would recommend putting a break point in the constructor and stepping through it till the error occurs.

    The OPs problem was a resource that was not being found. 

    Icon="pack://application:,,,/WpfApplication2;component/images/Dartfish.ico">

    Not sure what the correct path would have been.


    John Fenton, MCC
    Wordmasters Direct Mail and Data Processing Services
    • Proposed as answer by sicktwist Tuesday, September 13, 2011 11:53 AM
    Friday, August 19, 2011 6:57 PM
  • Thanks for the answer.

    And appollogies on my behave of my outbursts up there.

    sincerely

     

    sicktwist

    Tuesday, September 13, 2011 11:53 AM
  • You're welcome, glad you got it handled.
    John Fenton, MCC
    Wordmasters Direct Mail and Data Processing Services
    Tuesday, September 13, 2011 4:08 PM