I have tu publish a windows form application in c#.
The problem is that I have a folder named "dati" in project folder
In code, when I try to read from folder I use this instruction
string projectDirectory = Directory.GetParent(Environment.CurrentDirectory).Parent.FullName;
and when I try to read an xls inside this folder I have this instruction
string path = projectDirectory + "\\dati\\dati.xlsx";
string constr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=\"Excel 12.0 Xml;HDR=NO;\"";
In debug all works perfectly, also if I execute the .exe inside bin/Debug or bin/Release folder.
When I publish the application, and put it in another folder like C:\ProjectPublished I get this error because it is trying to read the dati folder from another path.
What I have to do?
Thanks
The simplest way to work with data files is to include them in the project as a content item. Use the right click your *.xlsx file in the Solution Explorer and set Build Action to Content and Copy to the output directory to Always.
It will make the build engine include the data file to the /bin directory.
Then you may need to set up your deploy engine to include this file in the deployable package. For instance, if you are using ClickOnce, you may need to include this file in Publish tab of your project
Use this:
string projectDirectory = AppDomain.CurrentDomain.BaseDirectory ;
This will give you the directory where your executable is residing.
Related
By default indexes download to %user%/AppData/Local/Temp and placed in user folder in windows os. Where is the property to setup destination folder? I not found this on maven configs or idea setup
For move maven index from temp folder and c disk completely you need to specify idea system folder in idea.properties file. For this action select in ide help-> edit custom properties. When file empty copy it content from c:\Program Files\JetBrains\IntelliJ IDEA 2017.1.3\bin\idea.properties file. Uncomment idea.system.path property and put complete path to new place in filesystem idea.system.path=D:\\new_system_patch. After that move content of old system folder to new destination.
Try edit mvn.bat. At beginning
set TTT=%TMP%
set TMP=c:/Temp
At the end revert back variable value
set TMP=%TTT%
I am using Openshift to allocate a Java application. This app contains a method that needs to download a xml file inside the project to explore it later.
So, the thing is that I need the path for the directory where I want to download the file.
And that is the trouble, I don't know how to call the path I want.
For example:
String filePath = "webapps/downloads/file.xml";
But Openshift tells me the error:
/var/lib/openshift/56e18fa***********0029/jbossews/webapps/downloads/file.xml
(No such file or directory)
The structure of my project is:
Project
src > main
java
resources
webapp
webapps > downloads
I Hope I have explained well. Thanks in advance!
I have a build that needs to zip a website project. I am using TfsBuildExtensions.Activities.Compression.Zip to do this.
Unfortunately, it puts the deployed files into ..\_PublishedWebsites\ProjectName\.
So, I have tried to play around with the RemoveRoot property, in the ZIP extension.
If I use the following value:
(New DirectoryInfo(BinariesDirectory & "\_PublishedWebsites")).FullName my zip file contains the ProjectName folder and it then contains the website. Working as intended.
If I use the following value:
(New DirectoryInfo(BinariesDirectory & "\_PublishedWebsites")).GetDirectories().FirstOrDefault().FullName my zip file contains the ENTIRE folder structure, from C:\Builds\... This is definitely not what I expected.
All I want, is that instead of having a folder in my zip, I want the deployed files directly in the zip files root.
How do I do this?
Web Deploy should be your first choice for packaging web sites.
It has a built-in option for zipping the artifacts so you don't need any third-party libraries for this.
I have a scorm package that works in Moodle. However, if unzip it to a folder and then rezip it and try to use it I get the following in Moodle:
"Incorrect file package - missing imsmanifest.xml or AICC structure"
Note, I'm doing this because I was trying to debug it and drilled down to this simple test:
Start with working scorm .zip package "TestCourse.zip"
On mac os x, I double click to extract it to the current folder.
I cmd click on it and selected decompress which makes "TestCourse2.zip"
I try to use "TestCourse2.zip" on Moodle as a scorm package and get the error above.
I tried using a different program to re-zip the folder and got the same results.
What am I missing here?
It's because you rezip the folder itself. You shouldn't do this. You should go into the folder root and then rezip all the contents to generate a new valid package.
imsmanifest.xml must be in the root of the zip file, not inside any folder (and do not change structure in any other way because the imsmanifest have dependencies with the other files).
I'm new to Ruby and how projects are set up. I am using Netbeans IDE and in the GUI there is a "Source Folder" but this resides at ~/NetBeansWorkspace/ProjectName/lib rather than a src folder. Is this the convention in Ruby? If not how do I get Netbeans to put my files under a src folder?
I know that in Rails all the applications are put in a folder that is named whatever you name the project. Inside the folder is all the resources for the application. The lib folder should contain "additional" code for your application.