小编rem*_*dcu的帖子

如何使用ASP .NET Core设置Jenkins

我正在尝试在Jenkins上创建一个Pipeline,以自动化我的构建,测试和部署过程.

pipeline {
    agent any
    environment {
        myVersion = '0.9'
    }
    tools {
        msbuild '.NET Core 2.0.0'
    }
    stages {
        stage('checkout') {
          steps {
            checkout([$class: 'GitSCM', ...])
          }
        }
        stage('restore') {
            steps {
                bat 'dotnet restore --configfile NuGet.Config'
            }
        }
        stage('build') {
            steps {
                bat 'dotnet build'
            }
        }
        stage('publish') {
            steps {
              ...
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

尝试运行构建时,我从Jenkins收到此错误消息:

'dotnet'不被识别为内部或外部命令,可操作程序或批处理文件.

为了使这个环境有效,我需要做些什么改变?

我将我的.NET CORE路径等添加到了MSBuild的Jenkins设置中.

我错过了什么?

c# jenkins jenkins-plugins asp.net-core jenkins-pipeline

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

无法解析方法“ checkSelfPermission”

我在以下代码中收到错误:

 if (ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
}
Run Code Online (Sandbox Code Playgroud)

“ checkSelfPermission”始终为红色,表示某种错误。

我已经导入了“ import android.support.v4.content.ContextCompat;” 已经。

以下是我的build.gradle内容:

apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
    applicationId "com.xyz.user.abc"
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
//    testCompile 'junit:junit:4.12'
compile files('libs/volley.jar')
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.google.android.gms:play-services:10.2.1'
compile 'com.android.support:design:25.3.0'
compile 'junit:junit:4.12'
//    compile 'com.google.android.gms:play-services-appindexing:10.2.1'
//    compile 'com.google.android.gms:play-services:9.8.0'
//    compile …
Run Code Online (Sandbox Code Playgroud)

android android-permissions android-studio build.gradle android-gradle-plugin

5
推荐指数
1
解决办法
6000
查看次数

PolylineOptions不能为null

我正在制作一个地图应用程序,其中显示了两个点之间的路线(动态地)。在这种情况下,我正在从数据库中检索经度和纬度(随时间变化)。这是一个大学项目,因此尚未在安全性部分工作。这是导航的Java文件:

public class NavigationActivity extends AppCompatActivity implements OnMapReadyCallback,
        GoogleApiClient.ConnectionCallbacks,
        GoogleApiClient.OnConnectionFailedListener,
        GoogleMap.OnMarkerDragListener,
        GoogleMap.OnMapLongClickListener,
        LocationListener {

    private GoogleMap mMap;
    GoogleApiClient mGoogleApiClient;
    Location mLastLocation;
    Marker mCurrLocationMarker;
    LocationRequest mLocationRequest;
    private double longitude;
    private double latitude;
    private double fromLongitude;
    private double fromLatitude;
    private double toLongitude;
    private double toLatitude;
    private static final String LOGIN_URL = "http://192.168.211.1/xyz/lat.php";
    private static final String LOGIN_URLS = "http://192.168.211.1/xyz/lng.php";
    public static final String KEY_MYNAME = "User";
    public static final String LAT = "lat";
    public static final String LANG = "lang";
    public LocationManager …
Run Code Online (Sandbox Code Playgroud)

android google-maps google-maps-android-api-2

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