简体   繁体   English

为什么发布解决方案时csproj文件会更改?

[英]Why is my csproj File Changing When I Publish a Solution?

I am using Visual Studio 2015 with Team Foundation Server and Git. 我将Visual Studio 2015与Team Foundation Server和Git一起使用。

Whenever I publish my project with alt + b + h I am told that there has been one change in the repo: 每当我用alt + b + h发布项目时,都会告诉我仓库中有一个更改:

在此处输入图片说明

When I investigate, I can see that the file that changed is MyProject.csproj . 当我调查时,可以看到更改的文件是MyProject.csproj

However, upon viewing the changes, I can see that there is literally no difference between the old and new files: 但是,查看更改后,我可以看到新旧文件之间实际上没有区别:

在此处输入图片说明

However there does appear to be 2 warnings on this line: 但是,此行上确实有2条警告:

<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

Where MSBuildToolsVersion is highlighted but there is no message. MSBuildToolsVersion突出显示但没有消息的地方。

I would like to .gitignore the .csproj file, but I have read that this should not be done as it may actually change in future. 我想.gitignore .csproj文件,但我读到不要这样做,因为它将来可能会发生实际变化。 Is this true, and is what I am experiencing normal or is this some kind of bug? 这是真的吗?我正在经历正常现象吗?还是某种错误?

number of factors can be: 因素数量可以是:

1) you might have changed the published location path 1)您可能已更改了发布的位置路径

2) you might just build your solution to new or different version than before 2)您可能只是将解决方案构建为比以前更高的版本或新版本

3) you might have published and due to not checked those changes to TFS it is showing you that you have pending check out 3)您可能已经发布,并且由于未检查对TFS所做的更改,因此表明您有待签出

you can always do one thing: go to solution>>source control>>undo pending changes 您总是可以做一件事:前往解决方案>>源代码管理>>撤消未决的更改

after you do this , get latest from TFS and build it 完成此操作后,请从TFS获取最新信息并进行构建

Now see if there is any changes if yes you can always compare what are the changes you made. 现在查看是否有任何更改(如果是),您可以随时比较所做的更改。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我找不到我的 .csproj 文件 - Why cant I find my .csproj file .csproj 文件在构建解决方案时自动更改? - .csproj file automatically changing on building Solution? 当我在.csproj文件中使用通配符时,为什么Intellisense在VS2010中不起作用? - Why doesn't Intellisense work in VS2010 when I use wildcards in my .csproj file? 我想发布项目时无法恢复 csproj 文件 - Failed to restore csproj file while i want to publish project 解决方案中的docx文件未发布到IIS - docx file in my solution does not publish to IIS 更改为时出错<targetframeworks> (复数)在 .NET 核心 csproj 文件中</targetframeworks> - Error when changing to <TargetFrameworks> (plural) in .NET Core csproj file 如果我在解决方案中添加了基于服务的数据库,那么发布应用程序该怎么办? - If I added a Service Based database to my solution, what do I do when I publish the application? 当我发布解决方案时,ConnectionStrings 不起作用 - ConnectionStrings not working when I publish solution 当我使用管道在azure devop上构建csproj文件时,为什么没有创建bin和obj文件夹? - Why are bin and obj folders not getting created when I am building a csproj file on azure devops using pipeline? 当我在Visual Studio 2012中使用文件系统发布方法发布网站项目时,解决方案文件出现在目标文件夹中 - Solution file appears in Target Folder when I publish a website project using File System publish method , in Visual studio 2012
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM