index > Windows Presentation Foundation ("Avalon") > XBAP application not picking relative path

XBAP application not picking relative path

i have created a full trust xbap application, that make use of some xml files which i have refered as relative path from bin folder. Problem is, i have to copy those xml file explicitly to root c:\ to make xbap run explicitly. Why it does not refer to the path i have mentioned in my programming and always pick c:\ .

i am storing xml file in Data folder that is located where the bin folder of my project is , that is bin/Data/abc.xml , so i have mentioned ../../Data/abc.xml

Xbap file is located as bin/xbapdebug/proj.xbap

when i use this type of relative path in an exe application it picks xml file from the folder mentioned. i want that application should pick path of those files relativly , from the coding.

trun_gup

A full trust XBAP is not equivalent to an exe. Do you see the same thing with a ClickOnce-deployed standalone app?

Also, are you declaring the XML file in your app's project as Content with the appropriate CopyToOutputDirectory metadata value? If you do that, the XML file will be placed in the right location by the build system and you can use relative URIs to access it. You shouldn't need to dot out (..\..) of your dir. In fact, you can use a leading slash in a relative Uri to denote the reference as relative to the application root.




Ashish Shetty, Program Manager, Microsoft | http://nerddawg.blogspot.com
Ashish Shetty - MSFT
reply 2

You can use google to search for other answers

 

More Articles

• XBAP's and firewalls
• XBAPs = This application type has been disabled.
• Vista style blur?
• How to get DependencyProperty by its name?
• How to ignore subsequent mouse clicks without using code
• Intellisense Problem in XAML
• Multiple background images
• XamlWriter, MarkupObject How to ?
• Strange flicker on window display ...
• about WindowsFormsHost
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Dynamic Gridview columns Update
• export to image with black block
• Design and Generics
• PageFunction Template
• FindItemWithText in the new ListView??
• Freezable changes in June CTP
• Newest Interactive Designer xaml code co
• When will MDI be supported?
• How to resize the font based on the wind
• Stretching Frame Content
• Tearing in WPF
• getting the june ctp
• how to get selected area of text in an e
• Session ID in XBAP
• WPF application template....

Hot Articles

• Dockable windows tool for WPF
• attaching events with a polyline
• Providing alternate styles for a control
• How to get the screen resolution in wpf
• Persistent Window state
• Disabled (grayed) image in button
• XBAPs = This application type has been d
• DataTemplate vs. ControlTemplate
• Using web services with xbap application
• New XBAP and Code @ xamlXaml.com: Scroll
• C# / Object Experts - Why Does this Code
• Elements wrapping in Panel
• How: Menu with predefined items AND boun
• TextBox wrapping inside a StackPanel...
• How to apply control template in externa

Recommend Articles

• New Window and STA problem....
• load xaml dynamically in to a parent obj
• BindingContext in WPF
• Problem:"Cannot locate resource 'wi
• ToolBar - OverflowGrid style?
• Textblock animation in RC1
• Accesskey on ComboBox?
• Determining height and width of an image
• Help search problem
• Xaml Help with ResourceDictonary (MenuIt
• Activated event raised on minimize
• DropShadowBitmapEffect on a Popup
• TextBlock Style in a Grid
• BitmapImage is not raising the DownloadC
• AtlasControlToolkit controls in WPF!!