如何将焦点设置到 Blazor 中的文本框?到目前为止,我们找到的唯一方法是使用 JavaScript。
我使用空的Web应用程序和nuget服务器包设置了一个私有nuget feed.这一切都正常,我可以从Feed中检索,我可以使用Nuget Package Explorer发布到私有Feed.但是我无法通过命令行发布 - 它会提示输入凭据.我已经在Appsettings中将Web应用程序中的ApiKey设置为一个简单的密码,我尝试将ApiKey添加到push命令.这会提示我输入用户名和密码.我也尝试过SetApiKey命令但是我得到了相同的行为.在构建服务器上,我尝试相同的结果.
以下是构建日志中的错误消息(标识信息x出来)
nuget pack "C:\Builds\2\OE Phase II\Common\src\WebApi\Web.Http\Bxxxxxxxs.Web.Http.csproj" -IncludeReferencedProjects -Properties Configuration=Release
nuget SetApiKey Bxxxxxxx1 -Source http://tfs12.xxxxxxxrps.com/Nuget
nuget push *.nupkg -s http://tfs12.xxxxxxxrps.com/Nuget/
C:\Builds\2\OE Phase II\Common\bin\xxxxxxx.Web.Http.dll
1 File(s) copied
Attempting to build package from 'xxxxxxx.Web.Http.csproj'.
Packing files from 'C:\Builds\2\OE Phase II\Common\src\WebApi\Web.Http\bin\Release'.
Using 'xxxxxxxs.Web.Http.nuspec' for metadata.
Found packages.config. Using packages listed as dependencies
Successfully created package 'C:\Builds\2\OE Phase II\Common\bin\xxxxxxxs.Web.Http.1.0.0.0.nupkg'.
The API Key 'xxxxxxx' was saved for 'http://tfs12.xxxxxxxrps.com/Nuget'.
Pushing Bxxxxxxxrs.Data 1.0.0.0 to 'http://tfs12.xxxxxxxrps.com/Nuget/'...
Please provide credentials for: http://tfs12.xxxxxxxrps.com/Nuget/
Object reference …Run Code Online (Sandbox Code Playgroud) 我正在尝试在构建过程中设置网站的自动部署.我可以通过Visual Studio 2012发布,但是当我尝试使用TFS构建自动部署时,我收到超时错误.
这是我对TFS构建过程的命令:
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True
/p:MSDeployPublishMethod=WMSVC /p:MSDeployServiceUrl=http://<MyServer>
/p:DeployIisAppPath="InitiationTool" /p:UserName=BGRSDEV\admin /p:Password=<mypassword>
Run Code Online (Sandbox Code Playgroud)
这是错误消息:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets (4193): Web deployment task failed. (Could not complete the request to remote agent URL 'http://:8172/msdeploy.axd?site=InitiationTool'.) Could not complete the request to remote agent URL 'http://:8172/msdeploy.axd?site=InitiationTool'. The operation has timed out
我已经尝试运行msdeploy.exe dump命令并获得相同的行为.
这有效:
msdeploy.exe -verb:dump -source:iisapp="InitiationTool",computername=http://<MyServer>/MSDEPLOYAGENTSERVICE,username=BGRSDEV\admin,password=<mypassword>
Run Code Online (Sandbox Code Playgroud)
这次超时:
msdeploy.exe -verb:dump -source:iisapp="InitiationTool",computername="http://<MyServer>:8172/msdeploy.axd?site=InitiationTool",username=BGRSDEV\admin,password=<mypassword>,authType=basic -allowUntrusted
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
谢谢
我尝试按照示例,使用Using语句打开实例,创建会话,附加到数据库,打开它,然后执行一些操作,如打开事务和保存记录.但是当我为每个操作使用这个模式时.像Save一样的每个操作需要大约0.5秒.所以我觉得我做错了.但我不确定我该怎么做.
我应该只有一个实例吗?如果他们的名字不同,我可以拥有更多吗?
如果我有多个线程,我可以/我应该有更多吗?
我看到我可以同时打开多个会话,我认为没关系但每个会话都需要附加吗?应该为每个会话打开数据库吗?当我测试这些不同的场景时,我得到了不一致的结果.有时我的测试通过,有时我会遇到异常,比如尝试使用已处置的对象,或者是EsentTempPathInUseException.
那么有关如何使用它的指导吗?
我有一些单元测试在WebApi项目中测试帖子它是WebApi 1.0版本,我已经升级到webapi 2.0,现在在尝试构建响应时,并添加新资源的位置ApiController.Url返回null .在升级之前,这些单元测试正在通过.这是控制器的设置
var config = new HttpConfiguration();
SetDependencyResolver(config, type);
var request = new HttpRequestMessage(method, url);
var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}");
var routeData =
new HttpRouteData(
route,
new HttpRouteValueDictionary { { "controller", controllerName } });
request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config;
request.Properties[HttpPropertyKeys.HttpRouteDataKey] = routeData;
controller.Configuration = config;
controller.ControllerContext = new HttpControllerContext(config, routeData, request);
controller.Request = request;
Run Code Online (Sandbox Code Playgroud)
这是失败的电话.请注意,返回null的Url对象
response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = claimsCommand.Id }));
Run Code Online (Sandbox Code Playgroud)
那我现在做错了什么我升级到了最新版本?
我写了这段代码,但它让我开始思考如何使用MSMQ:我应该使用"using"语句来获取消息队列吗?当我完成它时,Using语句将处理删除队列,但是什么时候我完成它?我应该保存我的MessageQueue对象以供重用.可以说这是在ASP.Net应用程序中,我想从同一个动作向同一队列发送3条消息.保存对象并重新使用或创建和处理我现在的情况?
using (MessageQueue msgQueue = new MessageQueue(this.queueName))
{
using (MessageQueueTransaction msgTx = new MessageQueueTransaction())
{
Message recoverableMessage = null;
msgTx.Begin();
try
{
recoverableMessage = new Message();
recoverableMessage.Body = message;
recoverableMessage.Formatter = new BinaryMessageFormatter(System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple, System.Runtime.Serialization.Formatters.FormatterTypeStyle.TypesAlways);
recoverableMessage.Recoverable = true;
msgQueue.Send(recoverableMessage, msgTx);
////this.msgQ.Send(recoverableMessage, msgTx); //whats up here??? this will teach me for taking time off. not sure whuc I shuold use
msgTx.Commit();
result = recoverableMessage.Id;
//recoverableMessage.Dispose();
}
catch (Exception)
{
msgTx.Abort();
////recoverableMessage.Dispose();
}
finally
{
if (recoverableMessage != null)
{
recoverableMessage.Dispose();
}
} …Run Code Online (Sandbox Code Playgroud) 如何从WebApi中的控制器方法访问JSON?例如,我想要访问作为参数传入的反序列化客户和序列化客户.
public HttpResponseMessage PostCustomer(Customer customer)
{
if (ModelState.IsValid)
{
HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, customer);
response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = customer.Id }));
return response;
}
else
{
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
}
}
Run Code Online (Sandbox Code Playgroud) 我在 SQLProject 中得到一个未解析的引用,错误发生在创建行上。所有对象都是导致它的原因,因为它们都是在特定模式中创建的。例如,我有在特定模式“win”创建表 [win].[DataSource] 中创建的表。发生错误是因为尝试在“win”模式中创建它 如果我从 create 语句中删除模式,错误就会消失。数据库项目是一个复合项目,包括来自 win 模式的所有工件(存储的过程、表、视图...)。这是我看到的错误示例。
严重性代码描述项目文件行抑制状态错误 SQL71501:过程:[win].[SelectCandidateExamSearch] 有一个未解析的对架构 [win] 的引用。