Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Including an Excel spreadsheet in a C# Express WinForms application install...
 

Including an Excel spreadsheet in a C# Express WinForms application install...

...is there some way to do this?

I can deploy the application just fine. The problem arises when I try to do anything with the application. Specifically, I have a button that, when clicked on, will open a file dialog so, I can find the Excel spreadsheet I need to use. This, however, is not occurring; and I am getting the below error instead:


"9/25/2009 12:19:46 PMSystem.IO.FileNotFoundException: Could not find file 'C:\Documents and Settings\wm101b\Local Settings\Apps\2.0\LKYXJ54A.13X\03B7W0L0.WPX\dmat..tion_f515c9447fd99336_0001.0000_19417796a528647b\Content Item Report- 07092009.xlsx'.
File name: 'C:\Documents and Settings\wm101b\Local Settings\Apps\2.0\LKYXJ54A.13X\03B7W0L0.WPX\dmat..tion_f515c9447fd99336_0001.0000_19417796a528647b\Content Item Report- 07092009.xlsx'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
at MS.Internal.IO.Zip.ZipArchive.OpenOnFile(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming)
at System.IO.Packaging.ZipPackage..ctor(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming)
at System.IO.Packaging.Package.Open(String path, FileMode packageMode, FileAccess packageAccess, FileShare packageShare, Boolean streaming)
at System.IO.Packaging.Package.Open(String path, FileMode packageMode, FileAccess packageAccess)
at DMA_Tool.frmDMATool.XLGetCellValue(String fileName, String sheetName, String addressName)
at DMA_Tool.frmDMATool.btnRunTests_Click(Object sender, EventArgs e)."

I know why the exception is being thrown - it cannot find the file. I just don't know how to include the file in the deployment process to avoid it. It is NOT an elegant solution to have to copy this file to the 'Locals' folder just to get it to work initially.

Any help is appreciated.

Thanks!

--Brian
  • Moved byHarry ZhuMSFTTuesday, September 29, 2009 9:12 AMrelating to deployment (From:Visual C# Express Edition)
  •  
WaffleMan  Friday, September 25, 2009 7:26 PM
try setup and deployment forum for this issue, you will get better responses http://social.msdn.microsoft.com/Forums/en-US/winformssetup/threads

kaymaf
I hope this helps, if that is what you want, just mark it as answer so that we can move on
  • Marked As Answer byWaffleMan Tuesday, September 29, 2009 5:55 PM
  •  
kaymaf  Friday, September 25, 2009 9:41 PM
try setup and deployment forum for this issue, you will get better responses http://social.msdn.microsoft.com/Forums/en-US/winformssetup/threads

kaymaf
I hope this helps, if that is what you want, just mark it as answer so that we can move on
  • Marked As Answer byWaffleMan Tuesday, September 29, 2009 5:55 PM
  •  
kaymaf  Friday, September 25, 2009 9:41 PM
Thanks for the help kaymaf! My setup is built and the files are where they need to be for the app to run.
WaffleMan  Tuesday, September 29, 2009 5:55 PM

You can use google to search for other answers

Custom Search

More Threads

• WSuS Deployment Problem
• Urgent project. I really need help here on making a deployment project
• Visual Studio - question about Primary Outputs of a project
• Can I throttle DownloadFileGroupAsynch()?
• Un-registered DLLs?
• VS 2005 not publishing
• Deployment related problems Plz help. quite urgent
• How to include non-project file in deployment?
• Deploy Application and Crystal report
• Deploy