小编Lui*_*cia的帖子

找不到具有以下功能的代理:msbuild,visualstudio,vstest

我有TFS On-Premises,在排队新版本时我有这个错误.

找不到具有以下功能的代理:msbuild,visualstudio,vstest

我找到了这个答案:没有找到具有以下功能的代理:msbuild,visualstudio,vstest?

但有没有办法在内部修复它而不在构建服务器上安装Visual Studio?

tfs tfsbuild tfs-2015 tfs2017

7
推荐指数
1
解决办法
5906
查看次数

当属性更改时如何重新渲染反应组件

所以我有这个反应组件,它的下拉属性(SPFx)有2个值,我需要当下拉列表更改时再次重新渲染反应,下拉列表定义从中检索值的数据源。

Webpart.ts

import * as React from 'react';
import * as ReactDom from 'react-dom';
import { Version } from '@microsoft/sp-core-library';
import {  
  BaseClientSideWebPart,
  IPropertyPaneConfiguration,
  PropertyPaneDropdown
} from "@microsoft/sp-webpart-base";

import * as strings from 'AbstractfactoryWebPartStrings';
import Abstractfactory from './components/Abstractfactory';
import { IAbstractFactoryProps } from './components/IAbstractFactoryProps';
import { IAbstractfactoryWebPartProps } from "./IAbstractfactoryWebPartProps";




export default class AbstractfactoryWebPart extends BaseClientSideWebPart<IAbstractfactoryWebPartProps> {

  public render(): void {
    const element: React.ReactElement<IAbstractFactoryProps > = React.createElement(
      Abstractfactory,
      {
        datasource: this.properties.datasource
      }
    );

    ReactDom.render(element, this.domElement);
  }

  protected get dataVersion(): Version …
Run Code Online (Sandbox Code Playgroud)

javascript sharepoint reactjs spfx

7
推荐指数
1
解决办法
3万
查看次数

antd上传控件需要动作功能,但我不需要

我正在使用ant设计组件,并且有一个上传输入:https : //ant.design/components/upload/

根据文档,需要对道具进行操作。

但是我不需要在上传时将文件发布到url,我需要将整个FORM提交到其他端点(检查handlesubmit函数)

尝试浏览文档时,我使用了handlechange事件将文件添加到状态,但是STATUS从未完成,因此该行从未被点击过。

我在这里想念什么?

import React, { Component } from 'react';
import { Input, Upload , Icon, message} from 'antd';
import Form from '../../components/uielements/form';
import Checkbox from '../../components/uielements/checkbox';
import Button from '../../components/uielements/button';
import Notification from '../../components/notification';
import { adalApiFetch } from '../../adalConfig';

const FormItem = Form.Item;

class RegisterTenantForm extends Component {
    constructor(props) {
        super(props);
        this.state = {TenantId: '', TenantUrl: '', CertificatePassword: '', confirmDirty: false, loading: false, buttondisabled: true};
        this.handleChangeTenantUrl = this.handleChangeTenantUrl.bind(this);
        this.handleChangeCertificatePassword = this.handleChangeCertificatePassword.bind(this);
        this.handleChangeTenantId= this.handleChangeTenantId.bind(this); …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs antd

7
推荐指数
3
解决办法
6159
查看次数

带有 REST Post 请求的 415(不支持的媒体类型)

我有一个反应组件,当按下复选框时,它会调用一个休息 api,使用单个参数发布请求。

我在 webapi 中放置了一个断点并且它从未命中,但我仍然在组件上获得了 415 unsopported 媒体类型

react js component (see onchange event)

import React, { Component } from 'react';
import {  Table, Radio} from 'antd';
import { adalApiFetch } from '../../adalConfig';
import Notification from '../../components/notification';

class ListTenants extends Component {

    constructor(props) {
        super(props);
        this.state = {
            data: []
        };
    }



    fetchData = () => {
        adalApiFetch(fetch, "/Tenant", {})
          .then(response => response.json())
          .then(responseJson => {
            if (!this.isCancelled) {
                const results= responseJson.map(row => ({
                    key: row.ClientId,
                    ClientId: row.ClientId,
                    ClientSecret: row.ClientSecret, …
Run Code Online (Sandbox Code Playgroud)

javascript jquery asp.net-web-api reactjs asp.net-web-api2

7
推荐指数
2
解决办法
1万
查看次数

如何在azure网站上的react app中替换%PUBLIC_URL%

我有一个在本地工作得很好的反应应用程序,当我将它部署到Azure时,我在index.html上有一些404错误

所有这些都带有标签%PUBLIC_URL%

根据文档,它们将在构建过程中被替换,但不确定如何完成,因此在部署时,正确的URL将被放置到位

<!doctype html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="theme-color" content="#000000">
    <!--
          manifest.json provides metadata used when your web app is added to the
          homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
    -->
    <link rel="manifest" href="%PUBLIC_URL%/manifest.json">
    <link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon.png">
    <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700" rel="stylesheet" async>
    <link async rel="stylesheet" href="%PUBLIC_URL%/css/ionicons.min.css">
    <link rel="stylesheet" href="https://unpkg.com/react-instantsearch-theme-algolia@4.0.0/style.min.css">
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css"
         integrity="sha512-M2wvCLH6DSRazYeZRIm1JnYyh22purTM+FDB5CsyxtQJYeKq83arPe5wgbNmcFXGqiSH2XR8dT/fJISVA1r/zQ=="
         crossorigin="" async/>
    <!--
          Notice the use of %PUBLIC_URL% in the tags above.
          It will be replaced with the …
Run Code Online (Sandbox Code Playgroud)

npm azure-web-sites reactjs azure-devops yarnpkg

7
推荐指数
2
解决办法
3385
查看次数

是否可以为我的所有对象创建一个通用的Repository类?

我有以下POCO类及其存储库模式实现.如果我的模型足够大,那么制作这个通用是有意义的,因此只需要完成一个实现.

这可能吗?你能告诉我怎么样吗?

 public class Position
    {
        [DatabaseGenerated(System.ComponentModel.DataAnnotations.DatabaseGeneratedOption.Identity)]   
        public int PositionID { get; set; }
        [StringLength(20, MinimumLength=3)]
        public string name { get; set; }
        public int yearsExperienceRequired { get; set; }
        public virtual ICollection<ApplicantPosition> applicantPosition { get; set; }
    }


public interface IPositionRepository
    {
        void CreateNewPosition(Position contactToCreate);
        void DeletePosition(int id);
        Position GetPositionByID(int id);
        IEnumerable<Position> GetAllPositions();
        int SaveChanges();
        IEnumerable<Position> GetPositionByCustomExpression(Expression<Func<Position, bool>> predicate);

    }

public class PositionRepository : IPositionRepository
    {

        private HRContext _db = new HRContext();

        public PositionRepository(HRContext context)
        {
            if (context == …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework entity-framework-4 entity-framework-4.1

6
推荐指数
1
解决办法
3765
查看次数

错误.在新的asp.net mvc4错误处理您的请求时发生错误,找不到sql server?

我创建了一个新的asp.net mvc4应用程序.我创建了一个控制器聊天和一个查看聊天.

 public class ChatController : Controller
    {
        //
        // GET: /Chat/

        public ActionResult Index()
        {
            return View();
        }

    }
Run Code Online (Sandbox Code Playgroud)

我不会粘贴聊天视图,因为我不认为它与错误无关.

在LoginPartial.cshtml中我有这个:

@if (Request.IsAuthenticated) {
    <text>
        Hello, @Html.ActionLink(User.Identity.Name, "Manage", "Account", routeValues: null, htmlAttributes: new { @class = "username", title = "Manage" })!
        @Html.ActionLink("Dashboard", "Index", "Dashboard", routeValues: null, htmlAttributes: new { id = "dashboard" })
        @Html.ActionLink("Chat", "Index", "Chat", routeValues: null, htmlAttributes: new { id = "chat" })

        @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" })) {
            @Html.AntiForgeryToken()
            <a href="javascript:document.getElementById('logoutForm').submit()">Log …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc asp.net-mvc-4

6
推荐指数
1
解决办法
4万
查看次数

SyntaxError:无法在'Document'上执行'querySelector':'[object HTMLDocument]'不是有效的选择器

我试图从显示模板上的sharepoint列表项获取所有字段值,ctx.CurrentItem只获取一些值,但不是我需要的全部值.

我尝试了以下代码,但我在标题上收到错误

SyntaxError:无法在'Document'上执行'querySelector':'[object HTMLDocument]'不是有效的选择器.

function GetListItemById_Success(sender, args) 
{ 
   var id = ListItem.get_id(); 
   var title = ListItem.get_item("Title"); 
   alert("Updated List Item: \n Id: " + id + " \n Title: " + title); 
}

// Display an appropriate error message 
function GetListItemById_Fail(sender, args) 
{ 
   alert("GetListItemById Failed. \n" + args.get_message() + "\n" + args.get_stackTrace());
}

$(document).ready(function () { ExecuteOrDelayUntilScriptLoaded(CustomAction, "sp.js"); });

function CustomAction(){
var clientContext =  new SP.ClientContext.get_current();
var web = clientContext .get_web(); 
var targetList = clientContext.get_web().get_lists().getByTitle('Test Document Library');
var list = web.get_lists().getByTitle('Test …
Run Code Online (Sandbox Code Playgroud)

javascript sharepoint jquery sharepoint-2010 csom

6
推荐指数
1
解决办法
2万
查看次数

如何在mac os上执行.net核心控制台应用程序

我刚安装了Visual Studio for MAC,并在底部窗口(应用程序输出)按下播放时创建了hello world console应用程序,我可以看到hello world.

但是,如何从命令/终端线执行该应用程序?

如果我尝试./myapp.dll,即使在sudo su之后我也被拒绝了.

所以,不知道如何运行它

这是我的json

{
  "version": "1.0.0-*",
  "buildOptions": {
    "debugType": "portable",
    "emitEntryPoint": true
  },
  "dependencies": {},
  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.0"
        }
      }
    }
  },
  "runtimes": {
    "win10-x64": {},
    "osx.10.10-x64": {}
  }
}
Run Code Online (Sandbox Code Playgroud)

更新

我已经运行了dotnet restore和dotnetrun,首先我得到了这个错误:无法找到与其中一个目标运行时兼容的框架'.NETCoreApp,Version = v1.0'的运行时目标:'osx.10.12-x64'.可能的原因:

然后我像这样改变了我的project.json:

{
  "version": "1.0.0-*",
  "buildOptions": {
    "debugType": "portable",
    "emitEntryPoint": true
  },
  "dependencies": {},
  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.0"
        }
      }
    }
  },
  "runtimes": { …
Run Code Online (Sandbox Code Playgroud)

c# macos .net-core asp.net-core

6
推荐指数
1
解决办法
3615
查看次数

无法加载文件或程序集'Microsoft.IdentityModel.Protocols.WsFederation,

我在startup.cs上添加了装配线后才出现此错误

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Owin;
using Owin;

[assembly: OwinStartupAttribute(typeof(InnovationInABoxWebApi.App_Start.Startup))]
namespace InnovationInABoxWebApi.App_Start
{
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这是package.json

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Antlr" version="3.4.1.9004" targetFramework="net45" />
  <package id="bootstrap" version="3.0.0" targetFramework="net45" />
  <package id="jQuery" version="1.10.2" targetFramework="net45" />
  <package id="Microsoft.ApplicationInsights" version="2.2.0" targetFramework="net45" />
  <package id="Microsoft.ApplicationInsights.Agent.Intercept" version="2.0.6" targetFramework="net45" />
  <package id="Microsoft.ApplicationInsights.DependencyCollector" version="2.2.0" targetFramework="net45" />
  <package id="Microsoft.ApplicationInsights.PerfCounterCollector" version="2.2.0" targetFramework="net45" />
  <package id="Microsoft.ApplicationInsights.Web" version="2.2.0" targetFramework="net45" />
  <package id="Microsoft.ApplicationInsights.WindowsServer" version="2.2.0" …
Run Code Online (Sandbox Code Playgroud)

.net c# owin asp.net-identity

6
推荐指数
1
解决办法
5361
查看次数