使用nUnit,如果在测试中添加Debug.Print语句,它们将出现在测试输出中.(至少他们在Resharper单元测试窗口中)
使用执行相同测试的nant构建文件时,不会显示那些Debug.Print语句.
如何在单元测试中添加消息,该消息将出现在nUnit输出和nant的构建日志输出中?
我们使用构建脚本来自动化我们的发布过程,它正在使用SVN但现在我们正在使用Git并且需要执行一些命令行操作以从我们的远程存储库中提取.
我能够在这里遵循指南并使用Git bash它很棒.但是,我需要从Windows命令行执行这些任务,以便脚本可以执行这些任务.
git pull origin master 适用于Git bash.
cd "c:\program files (x86)\git\bin
git --git-dir=path\to\.git pull origin master
Run Code Online (Sandbox Code Playgroud)
失败并出错
权限被拒绝(publickey).
致命:远程端意外挂断
显然我的SSH密钥没有正确使用或其他东西.我是新来的,我真的不知道该怎么做.
我想基于一个变量加载不同的属性文件.
基本上,如果执行dev构建使用此属性文件,如果执行测试构建使用此其他属性文件,并且如果执行生成构建,则使用第三个属性文件.
任何人都可以解释使用像MSBuild(或NAnt)这样的工具构建项目集合与从命令行运行DevEnv.exe有什么优势?
我过去曾与之合作过的一位同事解释说(至少使用较旧版本的Visual Studio)使用DevEnv.exe比其他技术慢得多,但我还没有看到任何证据,或者现在是现在,从2005年开始,Visual Studio使用了MSBuild.
我知道使用MSBuild的一个优点是允许您构建项目而无需在构建计算机上安装Visual Studio,但我不确定是否还有其他人.
我已经将几个不同的VS2008项目升级到VS2010,并且在转换时发现了VB.Net项目的问题.
转换后,VS2008中的.vbproj文件已从此更改:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>CustomerManager.xml</DocumentationFile>
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
在VS2010中:
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>bin\Debug\</OutputPath>
<DocumentationFile>CustomerManager.xml</DocumentationFile>
<NoWarn>42353,42354,42355</NoWarn>
<WarningsAsErrors>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036</WarningsAsErrors>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
主要区别在于VS2010版本中添加了42353,42354,42355的值; 在IDE内部,它在Project Properties中显示为以下设置 编译部分为:
"函数返回没有返回值的内部值类型"=无
在Visual Studio 2010中构建代码时,这不是问题,但是当尝试通过我们的持续集成脚本构建代码时,它会因以下错误而失败:
[msbuild] vbc:命令行错误BC2026:选项'nowarn'的警告编号'42353'不可配置或无效
[msbuild] vbc:命令行错误BC2026:选项'nowarn'的警告号''42354'不可配置或无效
[msbuild] vbc:命令行错误BC2026:选项'nowarn'的警告号''42355'不可配置或无效
我在Google上找不到任何关于这些消息的内容,这很奇怪,因为我试图找出为什么会发生这种情况.
有关为什么Visual Studio 2010的转换向导正在执行此操作的任何建议?
有没有人知道如何使用带有新行字符的echo输出消息,在ant世界中我使用了$ {line.seperator},但我没有看到Nant中的任何相关属性,也没有提供此信息的任何函数.我也尝试了\n转义字符,但它是按原样打印的.下面是一个例子
<echo message="spool \n off \n quit" file="${scripts.list}" append="true"/>
Run Code Online (Sandbox Code Playgroud) 我有一个基于NAnt的脚本,我在连接到SQL Server 2008 Express的本地PC上运行,也在我的本地PC上运行,使用.sql文件删除和重新创建数据库 - 这很好用,这里没问题.
当我在另一台PC上重新创建相同的设置时出现问题,我在我的NAnt脚本中得到错误说:
System.InvalidOperationException: The 'SQLNCLI' provider is not registered on the local machine.
at System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper)
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at NAnt.Contrib.Util.SqlHelper..ctor(String connectionString, Boolean useTransaction)
at NAnt.Contrib.Tasks.SqlTask.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()
Run Code Online (Sandbox Code Playgroud)
我在网上搜索过,发现在论坛中有人建议我需要安装Microsoft SQL Server Native Client,并从此URL获取.(不可否认,我只安装了Native Client部分) …
我很好奇是否可以使用Nant来使用C#5.0编译器来定位.NET 4.5.截至目前,最新版本仅表示支持.NET 4.0.
我尝试在安装.net 4.5框架后下载源代码并使用msbuild构建.sln,但这会产生大量错误.
我正在尝试让MSBuild 2010将Web应用程序发布到特定位置.我可以将部署包发布到特定路径,但部署包然后添加自己的路径更改.
例如:如果我告诉它发布到C:\dev\build\Output\Debug那时实际的web文件最终在C:\dev\build\Output\Debug\Archive\Content\C_C\code\app\Source\ControllersViews\obj\Debug\Package\PackageTmp
和C_C路径的一部分改变(不确定它如何选择路径的这一部分).
这意味着我不能只从发布位置编写副本.
我现在正在使用这个nant/msbuild命令:
<target name="compile" description="Compiles">
<msbuild project="${name}.sln">
<property name="Platform" value="Any CPU"/>
<property name="Configuration" value="Debug"/>
<property name="DeployOnBuild" value="true"/>
<property name="DeployTarget" value="Package"/>
<property name="PackageLocation" value="C:\dev\build\Output\Debug\"/>
<property name="AutoParameterizationWebConfigConnectionStrings" value="false"/>
<property name="PackageAsSingleFile" value="false"/>
</msbuild>
Run Code Online (Sandbox Code Playgroud)
有关如何将Web文件直接发送到特定位置的任何想法?
总新手问题.我试图在构建服务器上运行Nant脚本(非常基本的脚本,没有做任何事情),并且它失败并出现错误
System.Security.SecurityException:请求类型为'System.Security.Permissions.FileIOPermission,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'的权限失败.
我该怎么办才能让它运转起来?
nant ×10
msbuild ×2
.net ×1
.net-4.5 ×1
automation ×1
build ×1
c#-5.0 ×1
command-line ×1
git ×1
github ×1
logging ×1
msbuild-task ×1
nant-task ×1
nantcontrib ×1
nunit ×1
sql-server ×1
ssh ×1