vs in Bin and obj files problems caused by project accumulation

Source: Internet
Author: User
Tags svn

This is usually the problem when knocking at the computer room billing system: "The file or assembly" DAL "or one of its dependencies could not be loaded. The system could not find the specified file.

Solution:

Modify the output directory of the Dal to Ui/bin/debug.


One, the reference path problem:

The default output directory for the DAL is under the Dal/bin/debug directory, and why do you want to modify its output directory? When it comes to this question, we have to take a look at what a reference relationship is.




In the traditional three layer, the reference relationship: Ui->bll->dal, the reference is the equivalent of their own. For example, the UI layer references the BLL layer, so the UI layer is available to the public in the BLL layer, so the DLL files produced by the BLL layer should be included in the UI layer when the catalog is generated. Similarly, the DAL layer is included in the UI layer by reference.

As we can see from the above diagram, the UI layer does not indirectly refer to the DAL layer, so when the assembly is generated, the DAL assembly does not exist under the bin file directory of the UI layer.


Second, bin directory & obj directory

Overall: Bin is the file that puts the final code, and obj is the intermediate code (temp) file.

The 1.bin directory holds the result of the final compilation, which is the initials of the binary binary.

Bin is the default output file directory, which is the result of your project compilation (DLL or EXE), but also the other you set the need to output files, such as: Configuration, resource files and so on.

The bin file has two versions of Debug and release two versions, the corresponding folders are Bin/debug and Bin/release, this folder is the default output path, we can modify the build output path through the project Properties-> compilation->.


The 2.obj directory is used to store the temporary files generated during compilation, which is the English abbreviation for object.  

The obj directory is used to save the results of each module compilation, in. NET, the compilation is done in a module, and the compilation is merged into one. The DLL or EXE is saved to the bin directory.


When you add a reference,. NET records the added reference absolute path, which is saved in the Per user file, (Solution.csproj.user), and can be opened for viewing in Notepad. You can also view the-> reference path in the project Properties-> Common Properties. If the setting replicates to true locally, the DLL is automatically copied to the Project Build folder (the Bin directory) when the project is built, otherwise it will not be copied. When you build the project, the reference to the added is an absolute path, and the assembly defaults to the current path at run time. To modify the path of a reference, you must implement it programmatically. Use the References object.


The obj file is a compile-time intermediate directory, that is, before the contents of the bin appear, the compiler is here to do some file creation, modification, and so on. Before copying to the bin directory when all is complete. (Note that the contents of obj are not cleared at this time.)


third, SVN management issues

Project development If it is layered development, each person is responsible for one layer (b, U, D) and so on. and assign permissions to each layer. If you don't pay attention to SVN's use, SVN will have the following symptoms:


Every morning you come to open the VS project will be the following results:

The main reason for this is that we previously said two files in the-> obj and bin files are with the system, with the individual real-time updates. So we update the time, due to the issue of permissions, we can not submit updated files, so svn icon will appear red phenomenon.

Programme to address the phenomenon:

Modify SVN Project Permission issues: Project leader to modify their permissions (Allow access to all tiers) The leader is responsible for removing the bin files and obj files for each layer from the project. (method: Click to display all folder icons-> respectively right key obj and bin-> select Exclude from Project) update entire project file reclaim permissions change code-> update file when the problem arises, do not think that this is a normal phenomenon. For example, in the use of SVN in the process, found that some of the project icon Yellow, should be proactive to ask why. The initiative to find problems, ask questions, so that the next time you encounter the same things, can be a good advance to plan the problem, so that their own less detours.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.