command line program doesn't run!

C

CSharper

Please tell me what am I doing wrong in the following;

I have a WPF program that I build it in IDE and ran it, it runs fine.
I wanted to make it an exe through command line compiler(why, I need
to do some additional work) to I did a build in IDE and took the
compiler parameters and wrote a batch program to create the exe. It
compiled successfully and created the exe. But when try to run it I
get the error that Window1.xaml not found.

I have 2 part question;
1. What is the correct way to create single exe that I can distribute
it to the client, without giving all the xaml files?
2. I did find couple of tools from some blogs like ac.exe or xamlc.exe
to convert the xaml to baml. But even if I convert it to baml how can
I add it to the exe file?

Thanks.
 
C

CSharper

Please tell me what am I doing wrong in the following;

I have a WPF program that I build it in IDE and ran it, it runs fine.
I wanted to make it an exe through command line compiler(why, I need
to do some additional work) to I did a build in IDE and took the
compiler parameters and wrote a batch program to create the exe. It
compiled successfully and created the exe. But when try to run it I
get the error that Window1.xaml not found.

I have 2 part question;
1. What is the correct way to create single exe that I can distribute
it to the client, without giving all the xaml files?
2. I did find couple of tools from some blogs like ac.exe or xamlc.exe
to convert the xaml to baml. But even if I convert it to baml how can
I add it to the exe file?

Thanks.

For time being I converted the app to WinForm and everything works,
hopefully someone will shed some light into XAML into binary.
 
W

Willy Denoyette [MVP]

CSharper said:
Please tell me what am I doing wrong in the following;

I have a WPF program that I build it in IDE and ran it, it runs fine.
I wanted to make it an exe through command line compiler(why, I need
to do some additional work) to I did a build in IDE and took the
compiler parameters and wrote a batch program to create the exe. It
compiled successfully and created the exe. But when try to run it I
get the error that Window1.xaml not found.

I have 2 part question;
1. What is the correct way to create single exe that I can distribute
it to the client, without giving all the xaml files?
2. I did find couple of tools from some blogs like ac.exe or xamlc.exe
to convert the xaml to baml. But even if I convert it to baml how can
I add it to the exe file?

Thanks.



The exe doesn't need xaml file at run time. IMO you are dynamically loading
Windows1.xaml in code, but it's hard to tell for sure without seeing any
code.


Willy.
 
C

CSharper

The exe doesn't need xaml file at run time. IMO you are dynamically loading
Windows1.xaml in code, but it's hard to tell for sure without seeing any
code.

Willy.- Hide quoted text -

- Show quoted text -

I created a simple WPF project nothing in it and then I took the
compiler command from the output tab and try to build the exe from the
command line. It compiled properly but when Ran the exe, it is looking
for xaml. I did read some more and found out that if I use MSBuild to
build the wpf application then the XAML is converted and put it in the
exe otherwise you need xaml.
Thanks.
 
W

Willy Denoyette [MVP]

The exe doesn't need xaml file at run time. IMO you are dynamically
loading
Windows1.xaml in code, but it's hard to tell for sure without seeing any
code.

Willy.- Hide quoted text -

- Show quoted text -

I created a simple WPF project nothing in it and then I took the
compiler command from the output tab and try to build the exe from the
command line. It compiled properly but when Ran the exe, it is looking
for xaml. I did read some more and found out that if I use MSBuild to
build the wpf application then the XAML is converted and put it in the
exe otherwise you need xaml.
Thanks.


Yep, you need to convert the xaml to a cs file, before you can compile the
project, this translation is done by an msbuild step.

Willy.
 
C

CSharper

I created a simple WPF project nothing in it and then I took the
compiler command from the output tab and try to build the exe from the
command line. It compiled properly but when Ran the exe, it is looking
for xaml. I did read some more and found out that if I use MSBuild to
build the wpf application then the XAML is converted and put it in the
exe otherwise you need xaml.
Thanks.

Yep, you need to convert the xaml to a cs file, before you can compile the
project, this translation is done by an msbuild step.

Willy.- Hide quoted text -

- Show quoted text -

Thanks. We use NAnt and we do not use MSBuild so I am kind of stuck.
But it is ok. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top