Changing output directory in MVC Application - asp.net-mvc

I am having a problem with my MVC application after I set a different output folder instead of the default Bin folder . I also deleted the bin folder .
This resulted in Global.asax file exception "Cannot load the type Global.Mvc application" during application runtime.
I am trying to get rid of all the bin folders to have just one output folder for my application . I would like to know if it is possible at all to get rid of the bin folder completely . Am I missing some setting here or is it a must to have bin folder ?

I find a way to change bin folder.
Just like you say, When we change the default output folder:"bin\", then it will display some exception, Maybe that's a bug from visual studio.
Actually a lot people want to change the default bin folder to some RAM disk position, then it will save HDD life(don't let the HDD always write again and again), also very fast for read and write.
We can't change the default address, but we can change it use this way(delete bin folder before):
Open CMD.exe(administrator mode), put this code and execute:
mklink /d "Your project folder\bin" "new address(like RAM disk address)\bin"
mlink can redirect the original folder position to new position. Then, all fine such like you need.

Related

Using backslash (\) to indicate subfolder in ios

Please bear with me while I try to explain my problem
Suppose the folder structure of my download container's Document folder is represented /A/B/C/, which I have obtained through the proper API's in ViewController.m. I am porting a PC C++ project to ios, where, at one point the program decodes it's input to get the name and full path of a file, for example, as images\background.png. Since my program automatically locates the Document folder through API's, it is supposed to create the folder structure /A/B/C/images\background.png. The program I am porting to ios also contains a directory creator function, which detects the locations of / in the pathname string, checks whether a directory by that name is already present or not (for example, it would detect /A as being present, but /A/B/C/images would be detected as absent, as images has not been created yet). The function creates all the subfolders in this tree if they do not exist already. After the directory structure has been created (/A/B/C/images), the program does something like this to create the file (background.png in this example):
.
.
.
Create directory structure
fid = fopen(`/A/B/C/images\background.png`, "wb"); // note that full path `/A/B/C/images\background.png` is automatically determined by the program by the time it reaches this point
.
.
file writing code
fclose(fid)
.
.
My problem is that after creating the folder images, it creates the png file as images\background.png, instead of creating a background.png inside the images folder. I have already ported this program to android NDK and it creates the png file inside the images folder as expected, so I can only assume that android considers \ to indicate a subfolder while ios doesn't.
What can be done in order to get background.png created inside the images subfolder? Any idea will be appreciated.

Indy FTP - Navigating to a certain folder from current folder

You never upload files in the root of an FTP folder. You always have a 'base' or 'remote' folder in which you work. In most cases this is 'public_html/domain.com'.
How to navigate to a specific folder from a random current folder without navigating all the way down to FTP root? Some kind of FTP.NavigateTo('downloads') which will always start the navigation from 'base' folder no matter where you are now.
I am asking this because navigating through few folders takes more time that uploading a HTML file!
What would be the most efficient way (navigation through as few folders as possible) of navigating?
You never upload files in the root of an FTP folder. You always have a 'base' or 'remote' folder in which you work. In most cases this is 'public_html/domain.com'.
That is entirely dependent on the server's particular configuration. I've connected to (and written) FTP servers where the "root" folder is mapped to the logged in user's home directory on the server's filesystem, and thus uploading directly to the "root" is perfectly acceptable.
How to navigate to a specific folder from a random current folder without navigating all the way down to FTP root?
Simply provide an absolute path (relative to root) to TIdFTP.ChangeDir(). FTP allows both absolute and relative navigations.
Some kind of FTP.NavigateTo('downloads') which will always start the navigation from 'base' folder no matter where you are now.
FTP.ChangeDir('/downloads');

Installshield skip custom action if an application is already installed

I have created a basic MSI project which will install few applications on the machine. My first step is to copy few folders and files to the destination machine. Then I have created two custom actions to run the exe files. I would like to skip custom action if that particular application is already installed on the machine. Also while copying the folders and files, I would like to skip if the folder or file already exists on the machine. I tried using install conditions, condition builder, system search but i am unable to resolve it.
Please provide any ideas to resolve these issues. Your answers would be greatly appreciated.
All this can be resolved by using System Search.Refer (http://helpnet.flexerasoftware.com/isxhelp22/helplibrary/NewLaunchCondition.htm)
1) To check if file exists select (File path, by searching folders),enter file name, select directory and assign depth depending on the directory mentioned.
Suppose A.txt is present inside \B\C folder and you are selecting B while searching then depth should be >=2. The property mentioned in this process will get set with the file path if file exists.
2) To check if folder exists select (Folder path, by searching in a specific folder), follow the above procedure and mention folder name instead of filename.
3) To check if application is installed you can check by following one the above processes and find application specific folders/files.
Lastly use the public properties as a condition for your custom actions and components. Suppose you are checking for a file and setting a property ASONFILEFOUND, just mention this in component/custom action condition and those wont run if file exists.
If you still face issues enable windows logging and view the log to check whether properties used in System Search are getting set or not.
Execute-MSI -Action Install -Path 'AcroRead.msi' -Transform 'Settings.mst' -Parameters '/q /norestart' -SkipMSIAlreadyInstalledCheck
use this command. if you are using Powershell for installation.
This will skip the MSI file check.

Conflict between relative and absolute path while using two exe file in delphi

I have one exe say myApp.exe in C:\MyProject folder. It writes logs in logfile say tracefile.log which is also there in C:\MyProject.
Now I have to make a schedule task say Schedule1.exe which will also write in logfile tracefile.log located in C:\MyProject.
Ok, I created Schedule1.exe and kept it in same folder C:\MyProject folder and made schedule taks using this exe.
Problem: Schedule1.exe cannot pick the path of logfile when I give relative path of logfile as ".\tracefile.log". But when I give full path like "C:\MyProject", it picks the logfile path and writes on it.
Please suggest what could be the problem?
Relative paths are relative to the working directory of the process. The working directory of the process is determined at process startup, and may not be the directory that contains the executable. What's more, the working directory can change during the processes life.
It seems to me that you should be giving a full path to these files. You need to get hold of the directory in which the executable lives. That is
ExtractFilePath(ParamStr(0));
So you should be using this code to name your file:
ExtractFilePath(ParamStr(0)) + 'tracefile.log'

Searching up from a root directory when using SelectDirectory in delphi

I am using the SelectDirectory function in delphi in order to select a folder. I set the root to a default directory where the items a user is looking for should be. However if I want to be able navigate "above" where I am then I am unable to.
For example:
Lets say the default folder is C:\Program files\Default folder and when I am in there I can view all folders and select the one I want. However if I want to return to program file to look for another folder then I do not know how I do that.
Also I had considered using TOpenDialog but I found I wan unable to select a folder and see the files that are present in the folder (a setting which is important in SelectDirectory).
Is there a way to navigate above the root folder or possibly open the window cascaded down to the folder, as in it will display as though someone has navigated from computer to the root folder already?
Code:
SelectDirectory('Please select a directory', RootSearchLocation, ChosenDirectory,
[sdShowEdit, sdNewUI, sdShowFiles, sdValidateDir], self);
Where RootSearchLocation is C:\Program files\Default folder and ChosenDirectory is the directory the user chooses.
Any more information needed let me know.
It is not possible to navigate upwards from the specified 'root' folder in the browse for folder dialog. But you can specify an empty 'root', and fill in the 'directory' parameter with the directory you want the dialog to initially navigate.

Resources