PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Error FileNotFoundException
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2757
Page 1 of 1

Author:  bloniak91 [ Wed Mar 05, 2014 1:54 pm ]
Post subject:  Error FileNotFoundException

Hello, i have a problem. I'm trying to start with hello world but i have error, i enclose a photo screen. Please help me.

Attachments:
error.jpg
error.jpg [ 91.67 KiB | Viewed 6529 times ]

Author:  Thomas Hoevel [ Wed Mar 05, 2014 1:59 pm ]
Post subject:  Re: Error FileNotFoundException

Hi!

Instead of uploading a bitmap, better click on Copy exception detail to the clipboard and paste the text.

A DLL (PdfSharp-WPF.DLL) cannot be found.
Maybe a deployment problem?

Please provide an SSCCE that allows to replicate the problem.

Author:  bloniak91 [ Thu Mar 06, 2014 6:45 am ]
Post subject:  Re: Error FileNotFoundException

Hi,
I'm using PDFSharp, WPF bulid in 1.32 version. I want to move from a basic Hello World - write text to pdf.

It's "my" code:
Code:
using System;

using System.Diagnostics;

using System.IO;

using PdfSharp;

using PdfSharp.Drawing;

using PdfSharp.Pdf;

using PdfSharp.Pdf.IO;

 

namespace HelloWorld

{

class Program

{

static void Main(string[] args)

{

// Create a new PDF document

PdfDocument document = new PdfDocument();

document.Info.Title = "Created with PDFsharp";

PdfPage page = document.AddPage();

XGraphics gfx = XGraphics.FromPdfPage(page);

 

// Create a font

XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic);

 

// Draw the text

gfx.DrawString("Hello, World!", font, XBrushes.Black,

new XRect(0, 0, page.Width, page.Height),

XStringFormats.Center);

 

// Save the document...

const string filename = "HelloWorld.pdf";

document.Save(filename);

// ...and start a viewer.

Process.Start(filename);

}

}
}

In REFERENCES i include PDFsharp-WPF.dll and WindowsBase.dll.
In build i don't have errors but i trying run program i have problem:

{"Nie można załadować pliku lub zestawu (beginning English: Error FileNotFoundException) 'PdfSharp-WPF, Version=1.31.1789.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb' lub jednej z jego zależności. Nie można odnaleźć określonego pliku.":"PdfSharp-WPF, Version=1.31.1789.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb"}

Author:  Thomas Hoevel [ Thu Mar 06, 2014 9:08 am ]
Post subject:  Re: Error FileNotFoundException

Most likely this is a deployment problem.

Where do you compile the program?
Where do you run it?
How do you deploy it?

The code snippet you are showing is irrelevant for the problem you have.

Author:  bloniak91 [ Thu Mar 06, 2014 11:15 am ]
Post subject:  Re: Error FileNotFoundException

Ok, succedded! 8)
My problem was bad deployment. I'm write programs microcontrollers in C, i never programs in C#, Visual Studio,further my english is very little and i have big problem when i'm starting with new thing.
Thank you very much 8)

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/