C# 项目拉完代码引用全是黄色感叹号的处理(附:C#项目提交Git的ignore配置)

这篇具有很好参考价值的文章主要介绍了C# 项目拉完代码引用全是黄色感叹号的处理(附:C#项目提交Git的ignore配置)。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

一、现象

提交完代码后,其他人拉代码引用全是黄色感叹号,如图:

c#引用有感叹号,C#,c#,开发语言

二、处理方案 

右击 -> 在文件资源管理器中打开文件夹 -> 找到.csproj文件 -> 用txt打开 -> 删除Target标签 -> 全部重新加载即可

c#引用有感叹号,C#,c#,开发语言c#引用有感叹号,C#,c#,开发语言

 <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
    <PropertyGroup>
      <ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
    </PropertyGroup>
    <Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0
    \build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')"
    Text="$([System.String]::Format('$(ErrorText)', 
    '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0
    \build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
  </Target>

 如果无效,需要重启电脑或者VS(因为可能是VS抽风了。。。)文章来源地址https://www.toymoban.com/news/detail-720181.html

 三、附:C#项目提交Git的ignore配置

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
 
# User-specific files
*.suo
*.user
*.docstates
*.cache
*.userprefs
project.lock.json
.vs/
[Ii]ndex.dat
[Ss]torage.dat
 
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
[Aa]rtifacts/
 
# Roslyn cache directories
*.ide/
 
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
 
#NUNIT
*.VisualState.xml
TestResult.xml
 
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
 
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
 
# Chutzpah Test files
_Chutzpah*
 
# Visual C++ cache files
ipch/
*.aps
*.ipch
*.ncb
*.opensdf
*.sdf
*.cachefile
 
# Visual Studio profiler
*.psess
*.vsp
*.vspx
 
# TFS 2012 Local Workspace
$tf/
 
# Guidance Automation Toolkit
*.gpState
 
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
 
# JustCode is a .NET coding addin-in
.JustCode
 
# TeamCity is a build add-in
_TeamCity*
 
# DotCover is a Code Coverage Tool
*.dotCover
 
# NCrunch
_NCrunch_*
.*crunch*.local.xml
*.ncrunchsolution
 
# MightyMoose
*.mm.*
AutoTest.Net/
 
# Web workbench (sass)
.sass-cache/
 
# Installshield output folder
[Ee]xpress/
 
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
[Pp]ublish[Pp]rofiles/
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Don't check in NuGet proper
.nuget/
nuget.exe
# If using the old MSBuild-Integrated Package Restore, uncomment this:
#!**/packages/repositories.config
# Local filesystem/test NuGet
local-nuget/
 
# Windows Azure Build Output
csx/
*.build.csdef
 
# Windows Store app package directory
AppPackages/
 
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.publishsettings
node_modules/
 
# RIA/Silverlight projects
Generated_Code/
 
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
 
# SQL Server files
*.mdf
*.ldf
 
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
 
# Microsoft Fakes
FakesAssemblies/
 
# Mac OS
*DS_Store

到了这里,关于C# 项目拉完代码引用全是黄色感叹号的处理(附:C#项目提交Git的ignore配置)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包