小编dug*_*ous的帖子

无法加载文件或程序集系统找不到指定的文件

我正在构建一个dll,它引用了第二个dll.我已经在第一个dll的项目中添加了第二个dll作为参考Properties > Common Properties > Framework and References > Add New Reference > Browse

我从第三方的源代码编译了第二个dll.这两个项目都是C++/CLI.每当我的主应用程序试图调用包含对第二个dll的调用的第一个dll中的函数时,我会收到以下错误:

未知模块中出现未处理的"System.IO.FileNotFoundException"类型异常.

附加信息:无法加载文件或程序集'NBIS,Version = 1.0.5156.29834,Culture = neutral,PublicKeyToken = null'或其依赖项之一.该系统找不到指定的文件.

我有一个与我的主exe在同一目录中的第二个dll的副本,我甚至尝试在第一个dll旁边保留一个副本,但无济于事.

第二个dll引用了几个静态库,但它包含的唯一程序集引用是

系统

System.Data

System.Drawing中

了System.XML

我在第一个dll中添加了所有这些作为程序集引用.

我该怎么做才能让我的应用程序找到并加载第二个dll?

.net dll c++-cli visual-studio-2012

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

如何删除Microsoft Azure存储中的租用blob

我在Azure中创建了一个虚拟机,然后将其删除.但是,关联的存储帐户仍然存在.我无法删除存储帐户,因为它包含一个容器,其中包含一个具有无限期租约的blob.
没有其他人使用此存储帐户.
我该如何删除这个blob?

azure azure-storage azure-storage-blobs

13
推荐指数
1
解决办法
1895
查看次数

Android SafeArgs 生成的操作缺少参数

我的项目使用 SafeArgs。我已经切换到其他人创建的分支,并且构建项目会生成编译器错误,因为即使在 nav_graph 中,生成的“~Directions”类的返回 ActionOnlyNavDirections 方法(没有传递给目标片段的参数)需要一个论点。

例如,使用以下 nav_graph.xml:

<fragment
    android:id="@+id/fragment_a"
    android:name="com.myapp.ui.fragment.FragmentA"
    android:label="Fragment A"
    tools:layout="@layout/fragment_a">

<argument
        android:name="userName"
        android:defaultValue=" "
        app:argType="string" />
    <action
        android:id="@+id/action_fragment_a_to_fragmentX"
        app:destination="@id/fragmentX" />

    <action
        android:id="@+id/action_fragment_a_to_homeFragment"
        app:destination="@id/homeFragment" />

    <action
        android:id="@+id/action_fragmentA_to_fragmentC"
        app:destination="@id/fragmentC"
        app:popUpTo="@id/loginFragment" />

</fragment>

<fragment
    android:id="@+id/fragment_b"
    android:name="com.myapp.ui.fragment.FragmentB"
    android:label="Fragment B"
    tools:layout="@layout/fragment_b">

    <argument
        android:name="from"
        app:argType="com.myapp.data.local.model.ToFragmentBFrom"/>

    <action
        android:id="@+id/action_fragmentB_to_homeFragment"
        app:destination="@id/homeFragment" />

    <action
        android:id="@+id/action_fragmentB_to_fragmentC"
        app:destination="@id/fragmentC"
        app:popUpTo="@id/homeFragment" />

</fragment>

<fragment
    android:id="@+id/fragment_c"
    android:name="com.myapp.fragment.fragmentC"
    android:label="Fragment C"
    tools:layout="@layout/fragment_c">

    <argument
        android:name="userName"
        app:argType="string" />
</fragment>
Run Code Online (Sandbox Code Playgroud)

我结束了以下方向类:

class FragmentADirections private constructor() {
    private data class ActionFragmentAToFragmentC(val userName: String) : NavDirections {
        override …
Run Code Online (Sandbox Code Playgroud)

android android-architecture-navigation android-safe-args

9
推荐指数
1
解决办法
791
查看次数

与docker run --init等效的docker-compose是什么?

根据https://github.com/krallin/tini#using-tini的说法,tini内置在docker中,可以通过将--init标志传递给来使用docker run。就我而言,我正在使用docker-compose,而不docker run直接调用。如何传递此标志?

docker docker-compose

8
推荐指数
2
解决办法
2877
查看次数

如何阻止AndroidStudio覆盖.idea / codeStyles / Project.xml

In our project, we have committed .idea/codeStyles/Project.xml to source control with the goal of enforcing a common style among all contributors to the project without affecting the style of other projects.

However, Android Studio appears to be making unwanted changes to this file.

Pulling down the latest code from git and then simply opening Android Studio and then checking git status produces:

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout …
Run Code Online (Sandbox Code Playgroud)

android-studio android-studio-3.5

6
推荐指数
0
解决办法
221
查看次数

为什么MediaElement有时会无声地失败,我该如何纠正呢?

在我的WPF项目中,我创建了一个包含多个MediaElements播放视频的视图.有时,在一个或所有MediaElements之间的任何地方都将无法播放分配给它们的视频,而是显示黑色矩形,或根本不显示.发生这种情况时不会发生MediaFailed事件.MediaOpened事件会在所有MediaElements上出现,即使他们不播放视频也是如此.

我已经为我的显卡安装了最新的驱动程序,这对此问题没有任何影响.

是否有一个程序可用于确保每个MediaElement始终如一地播放?

示例源代码如下.包含视频文件的完整示例项目位于github,网址https://github.com/duggulous/MediaElementIssueExample

MainWindow.xaml

<Window x:Class="VideoDemo.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="1920" Width="1080">
<Grid Name="rootContainer" Background="Pink">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="404" />
            <ColumnDefinition Width="136" />
            <ColumnDefinition Width="136" />
            <ColumnDefinition Width="134" />
            <ColumnDefinition Width="270" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="270" />
            <RowDefinition Height="30" />
            <RowDefinition Height="412" />
            <RowDefinition Height="416"/>
            <RowDefinition Height="526"/>
            <RowDefinition Height="264"/>
        </Grid.RowDefinitions>

    <MediaElement x:Name="panel1" Margin="-1" 
                Grid.Column="0" Grid.Row="0"
                Grid.ColumnSpan="2" Grid.RowSpan="2" 
                Source="media/1-ekg.mp4"
                MediaOpened="panel1_MediaOpened"
                MediaFailed="panel1_MediaFailed"
                MediaEnded="panel1_MediaEnded"/>

    <MediaElement x:Name="panel2" Margin="-1"
                Grid.Column="2" Grid.Row="0" 
                Grid.ColumnSpan="3" Grid.RowSpan="1"
                Source="media/2-star.mp4"
                MediaOpened="panel1_MediaOpened"
                MediaFailed="panel1_MediaFailed"
                MediaEnded="panel1_MediaEnded"/>

    <MediaElement x:Name="panel3" Margin="-1"
                Grid.Column="0" Grid.Row="2" 
                Grid.ColumnSpan="2" …
Run Code Online (Sandbox Code Playgroud)

c# wpf video mediaelement ms-media-foundation

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

我如何告诉 Prometheus 的 Alertmanager 通过 Gmail 的 SMTP 服务器发送电子邮件

当指标超过特定阈值时,我希望 Prometheus 从 Gmail (Gapps) 帐户发送电子邮件。在Alertmanager 配置文档中,没有提到密码。如何对 SMTP 服务器进行身份验证?

gmail smtp smtp-auth prometheus

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

如何在 Kotlin 中设置非内联 OnClickListener?

我想将 a 附加View.OnClickListener到 a Button。我不想OnClickListener成为内联匿名函数定义。相反,我想在onCreateView()函数范围之外定义它。

在 Java 中,我会这样做:

@Override public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                       Bundle savedInstanceState)
{
    View view = inflater.inflate(R.layout.my_layout, container, false);
    View my_btn = view.findViewById(R.id.my_btn);
    my_btn.setOnClickListener(handleButtonClick);
    return view;
}

View.OnClickListener handleButtonClick = new View.OnClickListener()
{
    @Override public void onClick(View v) 
    {
        Log.d("my_tag", "click!")
    }
}
Run Code Online (Sandbox Code Playgroud)

其他答案似乎表明以下内容可行,但它不适合我:

    override fun onCreateView(name: String?, context: Context?, attrs: AttributeSet?): View
    {
        var view = super.onCreateView(name, context, attrs)
        my_btn.setOnClickListener( handleButtonClick  )
        return view
    }

    private val …
Run Code Online (Sandbox Code Playgroud)

android kotlin

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

如何要求用户身份验证仅用于解密而不是加密

我在 AndroidKeyStore 中有一个公钥/私钥对,生成如下:

val spec = KeyGenParameterSpec.Builder(alias(username), KeyProperties.PURPOSE_DECRYPT or KeyProperties.PURPOSE_ENCRYPT)
                .setKeySize(keySize)
                .setUserAuthenticationRequired(true)
                .setBlockModes(ablockMode)
                .setEncryptionPaddings(apaddingMode)
                .setCertificateSubject(X500Principal("CN=Itsami Mario, OU=Adventure Unit, O=Plumber Bros, C=US"))
                .setKeyValidityStart(Date())
                .setKeyValidityEnd(Date(Date().time + 1000 * 60 * 60 * 24 * 7))
                .setCertificateSerialNumber(BigInteger(64, SecureRandom()))
                .setDigests(digest)
                .build()

        keyPairGen.initialize(spec)
        return keyPairGen.genKeyPair()
Run Code Online (Sandbox Code Playgroud)

我希望每次使用私钥时都需要生物识别身份验证,但我不想在使用公钥加密时要求生物识别提示。但是,当我在 KeyGenerator 中使用setUserAuthenticationRequired(true),然后在不首先显示 BiometricPrompt 的情况下尝试加密时,我收到一条android.security.KeyStoreException消息:Key user not authenticated

如何要求解密验证而不加密加密

android android-keystore

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

新构建类型失败并出现错误:CrashlyticsOrgIdException:无法获取 Crashlytics 组织 ID

我有一个使用 Crashytics 一段时间的项目。今天,我通过复制/粘贴 buildTypes{...} 下的现有块之一并重命名来添加新的构建类型。

构建类型包含不同的应用程序id后缀,所以我登录Firebase控制台,使用新的应用程序id后缀注册一个新应用,下载生成的google-services.json文件,放到同名的src文件夹中作为构建类型。

尝试构建新变体失败并显示以下消息:

任务 ':app:uploadCrashlyticsMappingFileR1Qa' 执行失败。

java.io.IOException: com.google.firebase.crashlytics.buildtools.exception.CrashlyticsOrgIdException: 无法获取 Crashlytics Org Id

其他变体构建没有问题。我尝试了 gradle 同步、清理和重建,以及使缓存无效和重新启动 Android Studio。但错误仍然存​​在。

我已经搜索了 Crashlytics Org Id,但在文档或更广泛的互联网中找不到它的提及,除了其他一些没有说明的 SO 帖子。

什么是 Crashlytics Org Id,它是从哪里检索的?

更新:似乎谷歌在这里试图变得有点过于自动化。将 google-services.json 文件添加到您的项目后,实际上需要打开 Firebase 控制台的 Crashlytics 部分,左键单击下一步(包括刚刚打开文档的步骤),直到它显示“构建并运行您的app”并在打开控制台的情况下执行此操作。我习惯于右键单击链接并在其他选项卡/窗口中打开它们,显然这不会在该页面上触发必要的脚本。

android firebase crashlytics

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

无法在离线模式下构建。“没有 androidx.fragment:fragment:[1.2.0] 可用于离线模式的缓存版本列表”

我希望能够离线处理我的项目。所以我禁用离线模式,按“同步项目与 gradle 文件”按钮,然后启用离线模式并尝试构建。但是,每次我这样做时,都会收到错误消息:

FAILURE: Build failed with an exception.

*What went wrong:

Could not determine the dependencies of task ':app:compileDebugRenderscript'.
  > Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
      > Could not resolve androidx.fragment:fragment:[1.2.0].
        Required by
           project :app > androidx.fragment:fragment-ktx:1.2.0
               > No cached version listing for androidx.fragment:fragment:[1.2.0] available for offline mode.
               > No cached version listing for androidx.fragment:fragment:[1.2.0] available for offline mode. 
Run Code Online (Sandbox Code Playgroud)

我还尝试在启用离线模式之前使缓存/重启无效,然后 gradle 同步,结果相同。

我正在运行 Android Studio 3.6.3

gradle-wrapper.properties 包含以下内容:

distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
Run Code Online (Sandbox Code Playgroud)

如何使 androidx.fragment:fragment 可用于离线模式?

android android-studio

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

如何链接Visual Studio 2012中的.a文件?

我有一些.a文件形式的静态库,以及随附的标题(.h)文件.如何告诉链接器Visual Studio 2012 Windows Desktop Express引用这些文件,以便在尝试构建时不会出现"未解析的外部符号"错误?

c linker visual-studio-2012

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

无法构建Caliburn Micro教程代码.没有'AssemblySource.Select'的定义

我正在尝试按照http://www.mindscapehq.com/blog/index.php/2012/2/1/caliburn-micro-part-4-the-event-aggregator/上的教程开始使用Caliburn Micro .

但是,教程中的代码会产生错误.在该页面上,提供了以下Bootstraper代码:

using Caliburn.Micro;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;

public class AppBootstrapper : Bootstrapper<AppViewModel>
{
  private CompositionContainer container;

  protected override void Configure()
  {
    container = new CompositionContainer(new AggregateCatalog(AssemblySource.Instance.Select(x => new AssemblyCatalog(x)).OfType<ComposablePartCatalog>()));

    CompositionBatch batch = new CompositionBatch();

    batch.AddExportedValue<IWindowManager>(new WindowManager());
    batch.AddExportedValue<IEventAggregator>(new EventAggregator());
    batch.AddExportedValue(container);

    container.Compose(batch);
  }

  protected override object GetInstance(Type serviceType, string key)
  {
    string contract = string.IsNullOrEmpty(key) ? AttributedModelServices.GetContractName(serviceType) : key;
    var exports = container.GetExportedValues<object>(contract);

    if (exports.Count() > 0)
    {
      return exports.First();
    }

    throw new Exception(string.Format("Could not …
Run Code Online (Sandbox Code Playgroud)

c# wpf caliburn.micro

0
推荐指数
1
解决办法
405
查看次数