What does the .csproj file do?

2019-01-23 00:49发布

Usually a C# project has a .csproj file associated with it. What is that file for? What data does it contain?

4条回答
对你真心纯属浪费
2楼-- · 2019-01-23 01:01

It contains information about all the files used in the project, assemblies used(including the path for other then provided assemblies), output type, assembly name and much more.So, by opening this xml, you can find all the info in under one roof.

查看更多
我命由我不由天
3楼-- · 2019-01-23 01:04

The file contains a list of all the files to be compiled as part of the project, as well as other options like the project name, release and debug configurations, compilation options, and so on.

查看更多
欢心
4楼-- · 2019-01-23 01:08

Basically the .csproj file contains the list of files in your project, plus the references to system assemblies etc.

There are a whole bunch of settings - Visual Studio version, project type, Assembly name, Application Icon, Target Culture, Installation Url,...

Everything you need to build your project. While you could assume that you need everything in the current folder, having an explicit list allows you to organise them logically both on the disk and in the project so you can more easily find the files you want.

It's just XML so you can open it in your favourite text editor and take a look.

You get one .csproj file per assembly and the .sln (solution file) ties together all the assemblies that make up your project.

查看更多
冷血范
5楼-- · 2019-01-23 01:12

Taken From What is .csproj file

".csproj" is a Visual Studio .NET C# Project file extension. This file will have information about the files included in that project, assemblies used in that project, project GUID and project version etc. This file is related to your project. It will be automatically generated when we create

".sln" is a structure for organizing projects in Visual Studio. It contains the state information for projects in .sln (text-based, shared) and .suo (binary, user-specific solution options) files. We can add multiple projects inside one solution.

查看更多
登录 后发表回答