Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

deployment - Deploying c# application issues -


i have application 1 folder added right clicking project, selecting add folder. inside folder have xml files set build action:content, copy output directory: copy if newer (i have tried setting embedded resource) have few text files , on.

in bin/debug output directory have exe, folder xml, stand alone .txt files , on. problem is, if send exe friend try gets exception thrown.

say puts exe on desktop, programme @ point reads filenames of xml files in folder. uses following code

string[] filepaths = directory.getfiles(@"datasources\"); 

i assume because of this, when exe runs desktop, expect folder of .xml files in same place? have same type of exception when trying read .txt files too. doing wrong here?

thanks time

when reading files using relative paths 1 relative applications current directory. tip: in c# can see directory using environment.currentdirectory.

so if create shortcut on desktop, need make sure right click shortcut , set "start in"-folder directory of application. way current directory set when started , relative paths relative path , not path of shortcut.

if moved exe file desktop need move resources needs, if wants folder named "datasources" have move folder well, or set current directory when start application.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -