c# - How to access to file that have been added as content in a separated assembly? -


i have project put reports files it,now want refrence them in ptoject,i tried code:

stireport.load(new uri("pack://application:,,,/goldaccountingsystem.reports;component/stimulreports/tbank.mrt")                     .localpath);   

but error:

could not find part of path 'e:\goldaccountingsystem.reports;component\stimulreports\tbank.mrt'. 

goldaccountingsystem.reports assembly name of reports,but don't know why it's lookin in e assembly although right address e:\projects\goldaccountingsystem\goldaccountingsystem.reports.

and think it's because reports added project content not resource.any idea?

you should try relative uri :

stireport.load(new uri("/goldaccountingsystem.reports;component/stimulreports/tbank.mrt")                     .localpath); 

and absolute uri should work:

stireport.load(new uri("pack://application:,,,/goldaccountingsystem.reports;component/stimulreports/tbank.mrt", urikind.absolute)                     .localpath);  

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -