我尝试构建我的项目然而突然我在visual studio 2013上收到错误这里是我遇到的问题.自从昨晚以来我没有改变任何东西,但是当我今天跳起来时,似乎这突然出现了https://gyazo.com/d170bdfc18f9896003978ced330a1c71
这是我在VS中获得的错误日志
错误2无法使用其输入参数初始化"VsTsc"任务.阿雷西博
错误1"VsTsc"任务不支持"ToolsVersion"参数.验证该任务上是否存在该参数,它是一个可设置的公共实例属性.
这里也是我的项目文件,这是有道理的.起初它抱怨没有正确的打字稿版本.
这是我的cs proj文件http://pastebin.com/kA1yiwPQ,clipoverflow不允许我超过一定数量的字符所以我不得不求助于pastebin
我一直在关注PostgreSQL与EF6一起使用的帖子http://www.jasoncavett.com/blog/postgresql-and-entity-framework-6-code-first/。
我已经启动了一个全新的MVC5项目,希望在我的后端应用程序中使用Postgres。该应用程序启动正常,但是当您注册用户时(我选择了个人身份验证),我收到以下错误消息
错误:42P01:关系“ public.AspNetUsers”不存在
我不确定如何解决此问题。
错误发生在第155行,可以在此处看到
如果需要,可以提供更多信息。
我看过这篇文章并尝试这样做
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid CompanyID { set; get; }
Run Code Online (Sandbox Code Playgroud)
但是我仍然得到错误
Identity column 'CompanyID' must be of data type int, bigint, smallint, tinyint, or decimal or numeric with a scale of 0, and constrained to be nonnullable.
Run Code Online (Sandbox Code Playgroud)
这是我在包管理器控制台上运行Update-Database命令的时候.
我正在尝试将一些数据发布到作为副本集的远程mongodb实例中,但是却收到超时异常消息,提示找不到主机?我也阅读并?connect=replicaSet在连接字符串的末尾添加了内容,但这没有帮助。
这是我的连接字符串
private MongoClient client = new MongoClient("mongodb://10.250.8.1:27017,10.250.8.2:27017,10.250.8.3:27017?connect=replicaSet");
Run Code Online (Sandbox Code Playgroud)
这是抛出的异常:
{"A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : \"1\", ConnectionMode : \"ReplicaSet\", Type : \"ReplicaSet\", State : \"Disconnected\", Servers : [{ ServerId: \"{ ClusterId : 1, EndPoint : \"Unspecified/wsmongodb001:27017\" }\", EndPoint: \"Unspecified/wsmongodb001:27017\", State: \"Disconnected\", Type: \"Unknown\", HeartbeatException: \"MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> …Run Code Online (Sandbox Code Playgroud) 我正在尝试将表单发布到控制器,其中控制器接受FormCollection作为参数。当我尝试访问dsCollection中的项目时,我得到了null。FormCollection中的唯一项目是"__RequestVerificationToken"和"dsCollection"。另一件事是,我正在使用javascript动态生成表单HTML,并同时为其分配值。
这是我的ajax将数据发布到服务器端:
$(document).ready(function () {
$('#postEditDatasource').click(function (event) {
alert(JSON.stringify(deletedDatapoints));
//serialise and assign json data to hidden field
$('#dsDeletedDP').val(JSON.stringify(deletedDatapoints));
//anti forgery token
//get the form
var form = $('#__dsAjaxAntiForgeryForm');
//from the form get the antiforgerytoken
var token = $('input[name="__RequestVerificationToken"]', form).val();
var URL = '/Settings/EditDatasource';
console.log(form);
//we make an ajax call to the controller on click
//because the controller has a AntiForgeryToken attribute
//we need to get the token from the form and pass it with the ajax …Run Code Online (Sandbox Code Playgroud) 我试图使用C#EF6调用存储过程来恢复数据.我试图在SQL管理工作室中运行存储过程,它似乎工作正常,但是当我尝试在我的应用程序中运行它时,我得到一个错误说"Must declare the scalar variable "@devID"
这是我的应用程序中调用存储过程的方法的一部分
public IHttpActionResult GetMetrics(int deviceID, string attribute, string startDate)
{
if (deviceID == 0)
{
return NotFound();
}
var metrics = db.Database.SqlQuery<Metrics>("GetMetrics @devID, @MetricType, @startTime", deviceID, attribute, startDate).ToList();
Run Code Online (Sandbox Code Playgroud)
这是我的存储过程:
ALTER PROCEDURE [dbo].[GetMetrics]
-- Add the parameters for the stored procedure here
@devID int,
@MetricType nvarchar(20),
@startTime nvarchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure …Run Code Online (Sandbox Code Playgroud) 我可能会以错误的方式解决这个问题,但是可以在一个reactjs组件中添加样式和外部CSS文件吗?我试图用传统的方式做到这一点但是这似乎不起作用,你在外部css中引用类或id并在那里做你所有的样式.
var ProfilePanel = React.createClass({
render: function() {
return (
<div>
<p class="profile-text">{this.props.text}{this.props.children}</p>
</div>
);
}
});
Run Code Online (Sandbox Code Playgroud)
在我的CSS中我有:
.profile-text{
font-size: 10px;
}
Run Code Online (Sandbox Code Playgroud) 我想知道是否有一种方法可以获取模板标记中元素的内容并将其作为字符串返回?目前,似乎正在沿线返回一些[object document fragment]内容,但只需要其中的html内容。
function CreateWidget(widget) {
//Check if browser supports templates
if ('content' in document.createElement('template')) {
//Grab the template's content and assign it to a variable so we only have the gut of the template
var widgetContent = document.querySelector('#panel-template').content //('#panel-template').get(1).setAttribute('id', widget.WidgetCode);
widgetContent.querySelector('#chart').setAttribute('id', widget.WidgetCode);
//get the overlay toolbar
var widgetOverlay = widgetContent.querySelector('.overlayed');
widgetOverlay.setAttribute('data-render', widget.WidgetCode);
widgetOverlay.setAttribute('data-chartType', widget.chartType);
widgetOverlay.setAttribute('data-devID', widget.deviceID);
widgetOverlay.setAttribute('data-metricType', widget.metricType);
widgetOverlay.setAttribute('data-title', widget.WidgetName);
var el = document.importNode(widgetContent, true);
alert(el);
}
}
Run Code Online (Sandbox Code Playgroud) 我正在关注这里的帖子,将一个字形添加到一个字形到ActionLink但是我得到"/ Dashboard%20class ="这个作为我的URL,当我想要的所有内容被重定向到我指定的没有%20class的动作时给我错误
这是我在@ Html.ActionLink mvc asp.net中关注插入Glyphicons引导程序的帖子
我的HTML如下:
<li><a href="@Url.Action("Index", "Dashboard") class="btn btn-warning">
Dashboard
<span class="glyphicon glyphicon-home" />
</a>
</li>
Run Code Online (Sandbox Code Playgroud) 我循环一个json对象并在对象中获取一个包含逗号分隔字符串的项目,然后我拆分该字符串并检查它是否在数组中,如果不是它应该将它推入数组.问题是,它从不推入阵列
for (var item = 0; item < rules.length; item++) {
//we now need to split the item by its delimiter which is a comma ','
var treeSplit = rules[item].tree.split(',');
if (treeSplit.length - 1 != childCount) {
if (isInArray(treeSplit[childCount], aliasGroup)) {
aliasGroup.push(treeSplit[childCount]);
}
} else {
//do something
}
Run Code Online (Sandbox Code Playgroud)
这是我的isInArray函数,它需要一个值和数组
function isInArray(value, array) {
return array.indexOf(value) > -1;
}
Run Code Online (Sandbox Code Playgroud) c# ×6
javascript ×4
asp.net ×2
html ×2
jquery ×2
asp.net-mvc ×1
css ×1
dom ×1
html5 ×1
mongodb ×1
postgresql ×1
reactjs ×1
reactjs.net ×1
sql-server ×1
typescript ×1