我正在尝试运行由参数/p:DeployOnBuild=True传递时由MSBuild生成的ProjectName.deply.cmd .其中一个参数"ComputerName"将被传递为https://WebServer01:8172/MSDeploy.axd?SiteName=MySiteName.我的命令行是
ProjectName.deploy.cmd /Y /M:https://WebServer01:8172/MSDeploy.axd?Site=MySiteName
-AllowUntrusted /U:DeployUserName /P:Password /A:Basic
Run Code Online (Sandbox Code Playgroud)
它回来了
Error: Unrecognized argument 'MySiteName'. All arguments must begin with "-".
Run Code Online (Sandbox Code Playgroud)
执行的实际命令是
"C:\Program Files\IIS\Microsoft Web Deploy V3\\msdeploy.exe"
-source:package='Y:\ProjectName.zip'
-dest:auto,computerName='https://WebServer01:8172/MSDeploy.axd?Site',userName='DeployUserName',password='Password',authtype='Basic',includeAcls='False'
-verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension
-disableLink:CertificateExtension
-setParamFile:"Y:\ProjectName.SetParameters.xml"
MySiteName
-AllowUntrusted
Run Code Online (Sandbox Code Playgroud)
请注意,/ M的参数https://WebServer01:8172/MSDeploy.axd?Site=MySiteName被拆分为两个参数,从而创建computerName='https://WebServer01:8172/MSDeploy.axd?Site'和附加参数MySiteName.
我已经完成运行带有引用参数的部署包在Visual Studio 2010 Service Pack 1中失败,但是只处理ArgMsDeployAdditionalFlags而不是参数,例如/M:ComputerName.
如果没有传递SiteName,我可以使用在服务器上具有管理员权限的用户进行部署,但是当使用标准IIS用户DeployUserName时,我得到401
ProjectName.deploy.cmd /Y /M:https://WebServer01:8172/MSDeploy.axd
-AllowUntrusted /U:DeployUserName /P:Password /A:Basic
Run Code Online (Sandbox Code Playgroud)
服务器返回401
Error Code: ERROR_USER_UNAUTHORIZED
More Information: Connected to the remote computer ("WebServer01") using …Run Code Online (Sandbox Code Playgroud) 我试图整理一个演示,使用knockout-es5插件来简化使用揭示模块模式的模型.ViewModel1是原始的Knockout模型,它工作正常.ViewModel2尝试使用knockout-es5插件.遇到一些事情
var NS = NS || {};
$(function () {
NS.ViewModel1 = function (first, last) {
var
firstName = ko.observable(first),
lastName = ko.observable(last),
fullName = ko.computed(function () {
return firstName() + " " + lastName();
}),
doSomething = function (n) {
lastName(lastName() + " " + n);
}
;
return {
firstName: firstName,
lastName: lastName,
fullName: fullName,
doSomething: doSomething
};
};
NS.ViewModel2 = function (first, last) {
var
firstName = first,
lastName = last,
fullName1 …Run Code Online (Sandbox Code Playgroud) 我们正在为基于REST的服务实现STS(基于声明的身份验证).当我们决定创建REST服务(使用JSON)时,许多原因之一就是网络占用空间小.使用STS,SAML令牌只有少数声称SAML大小变为几K字节.对于大多数REST调用,我们没有返回对象列表,响应大小低100s字节,对于那些调用,这个令牌似乎过多的开销.你如何在你的项目中处理这个问题?
我有一个带有数学表达式的变量。我想在 UNIX shell 中评估它并将结果存储在另一个变量中。我怎么做 ?
我尝试了以下但不起作用
var1="3+1"
var2=`expr "$var1"`
echo $var2
Run Code Online (Sandbox Code Playgroud)
var2 值应计算为 4。
我有点奇怪,我刚刚在我的fullCalendar实现中发现了.
基本上,我在数据库"28/04/2011 09:00:00"(dmy)中有一个日期,我将其转换为Unix时间戳,结果为1303981200.0.
我已经通过http://www.onlineconversion.com/unix_time.htm查看了,时间戳有效.
但是,当我将此JSON传递给fullCalendar时,它会在一小时后呈现该事件!
JSON是:
[{"id":"4a315750666d2f70675241544936762b632f514f51513d3d","title":"Blah blah blah","description":"","start":1303981200,"end":1303983000,"className":"A-16","allDay":false}]
Run Code Online (Sandbox Code Playgroud)
百思不得其解
谢谢.
我的WCF应用程序遇到了麻烦.当我运行客户端应用程序并尝试连接到服务器时,我得到以下异常:
无法从传输连接读取数据,远程主机强行关闭现有连接.
当我从托管服务的系统调试时,应用程序运行正常.当我试图从其他电脑调试它我得到这个错误.从这个其他PC我可以在浏览器中打开(服务器应用程序的)WSDL文件,以便找到服务器.
假设TFS 2010中有此文件夹结构
Main
Collection_A
Solution_A1
Solution_A2
Reference Assemblies
Collection_B
Solution_B1
Project_B1A
Run Code Online (Sandbox Code Playgroud)
Project_B1A引用在DLL Reference Assemblies的Collection_A通过使用相对路径(..\..\..\Collection_A\Reference Assemblies\Whatever.dll).在TFS中定义构建定义时,我们在"工作流"选项卡中遇到了问题.
Project_B1A => $(SourceDir)
Run Code Online (Sandbox Code Playgroud)
对于参考装配应该是
Reference Assemblies => $(SourceDir)\..\..\..\Collection_A\Reference Assemblies
Run Code Online (Sandbox Code Playgroud)
但是TFS会抛出错误
TF215083: The local path $(SourceDir)\..\..\Collection_A\Reference Assemblies for a
workspace mapping is not valid. (Detail Message: TF10202: The path '..' ends with a
character which is not allowed. Characters which are not allowed include '.' and ' '.)
Run Code Online (Sandbox Code Playgroud)
我们已经尝试过$(SourceDir)\Collection_A\Reference Assemblies,$(BuildDir)\Collection_A\Reference Assemblies但正如预期的那样没有成功 还有其他可以使用的变量吗?
有没有办法强制传递给属性的类型参数实现特定的接口?
public interface IExpectedInterface
{
void InterfaceMethod();
}
public class MyCustomAttribute : Attribute
{
public MyCustomAttribute(Type classType)
{
this.ConfirmAssignedClassType();
_classType = classType;
}
public void SomeMethod<T>() where T : IExpectedInterface, new()
{
//var expectedType = Activator.CreateInstance(this._classType) as IExpectedInterface;
var expectedType = Activator.CreateInstance(typeof(T)) as IExpectedInterface;
if (expectedType == null)
{
// Wrong type
throw new ArgumentException(string.Format("Wrong type: {0} could not be created or converted to IActionAuthorization", _classType.ToString()));
}
// Do something with expectedType
expectedType.InterfaceMethod();
}
private void ConfirmAssignedClassType()
{
if (!typeof(IExpectedInterface).IsAssignableFrom(_classType)) …Run Code Online (Sandbox Code Playgroud) 我有简单命令的结果:
cp -R SourceDir DestDir >out.txt
result="out.txt"
Run Code Online (Sandbox Code Playgroud)
但是如果脚本无法访问写入,我如何在变量结果中获得输出?
嗨我在我的一个模型中有一个属性是:
[Required(ErrorMessage = "Total (Exc. GST) is a required field.")]
[Display(Name = "Total (Exc. GST):")]
[DataType(DataType.Currency)]
public virtual decimal TotalExcludingGst { get; set; }
Run Code Online (Sandbox Code Playgroud)
它上面有货币注释.
问题是当它在验证期间发生问题时它会显示4个小数位,例如
57500.0000
无论如何都要添加一个注释,使得这两个小数位在验证消息中?
c# ×2
msbuild ×2
tfs2010 ×2
attributes ×1
bash ×1
connection ×1
copy ×1
deployment ×1
fullcalendar ×1
jquery ×1
knockout.js ×1
msdeploy ×1
saml ×1
shell ×1
unix ×1
wcf ×1
wif ×1