GVKun编程网logo

解决win10 Docker启动报InvalidOperationException(启动docker报错)

14

在本文中,您将会了解到关于解决win10Docker启动报InvalidOperationException的新资讯,同时我们还将为您解释启动docker报错的相关在本文中,我们将带你探索解决win1

在本文中,您将会了解到关于解决win10 Docker启动报InvalidOperationException的新资讯,同时我们还将为您解释启动docker报错的相关在本文中,我们将带你探索解决win10 Docker启动报InvalidOperationException的奥秘,分析启动docker报错的特点,并给出一些关于.net – XML序列化继承类时的InvalidOperationException、.net – 创建wcf Web服务实例时出现InvalidOperationException、.NET 进程抛出 System.InvalidOperationException、Android’InvocationTargetException’和’UnsupportedOperationException’的实用技巧。

本文目录一览:

解决win10 Docker启动报InvalidOperationException(启动docker报错)

解决win10 Docker启动报InvalidOperationException(启动docker报错)

Win10安装docker出现以下问题:

在这里插入图片描述

解决问题方法

1.下载NoLsp(须要使用VPN等)

http://www.proxifier.com/tmp/Test20200228/NoLsp.execlass

或者百度网盘

连接:https://pan.baidu.com/s/14nxzeKvpjf5zSL8Mcu4r8g
提取码:iq5s

2.下载的文件放在C:\Windows\System32下,若是不是NoLsp.exe重命名一下

cmd下执行(管理员模式)

NoLsp.exe c:\windows\system32\wsl.exe

若是不对,确定是路径不对。

3.启动 wsl

执行wsl

4.效果图

在这里插入图片描述

5.重启Restart Docker Desktop

选中图标,重启便可

.net – XML序列化继承类时的InvalidOperationException

.net – XML序列化继承类时的InvalidOperationException

我在将c#类序列化为具有基类的 XML文件时出现问题…这是一个简单的示例:

namespace Domain
{
   [Serializable]
   public class ClassA
   {
      public virtual int MyProperty
      {
         get; set;
      }
   }
}

namespace Derived
{
   public class ClassA : Domain.ClassA
   {
      public override int MyProperty
      {
         get { return 1; } set { /* Do nothing */ }
      }
   }
}

当我尝试序列化Derived.ClassA的实例时,我收到以下异常:

InvalidOperationException(Types’Domain.ClassA’和’Derived.ClassA’都使用XML类型名称’ClassA’,来自命名空间“.使用XML属性为该类型指定唯一的XML名称和/或命名空间.)

问题是我想创建一个简单定义XML文件结构的基类,然后允许其他任何人从该类派生以插入业务规则,但格式化将来自基础.

这是可能的,如果是这样,我如何归属基类来允许这个?

解决方法

如果您可以将派生类重命名为与其基类不同的内容,则可以使用 XmlAttributeOverrides执行此操作:

// For ClassB,which derives from ClassA
XmlAttributes          attributes  = new XmlAttributes();                        
attributes.XmlRoot                 = new XmlRootAttribute("ClassA");

XmlAttributeOverrides  overrides   = new XmlAttributeOverrides();
overrides.Add(typeof(ClassB),attributes);

XmlSerializer   serializer  = new XmlSerializer(typeof(ClassB),overrides);

这将序列化为< ClassA> …< / ClassA>并可以从那序列化为ClassB实例.

据我所知,当基类和派生类具有相同的名称时(除了通过Data Contract Surrogates或其他一些过度杀伤方法完全控制序列化过程之外),没有办法做到这一点.

.net – 创建wcf Web服务实例时出现InvalidOperationException

.net – 创建wcf Web服务实例时出现InvalidOperationException

我有一个从类库引用的WCF Web服务.在项目运行之后,当从类库中创建服务客户端对象时,我收到带有消息的InvalidOperationException:

Could not find default endpoint element that references contract
‘MyServiceReference.IMyService’ in the ServiceModel client
configuration section. This might be because no configuration file was
found for your application,or because no endpoint element matching
this contract Could be found in the client element.

我用来创建实例的代码是:

myServiceClient = new MyServiceClient();

MyServiceClient继承自的地方

System.ServiceModel.ClientBase

我该如何解决这个问题?

注意:我有一个单独的控制台应用程序,它只是创建相同的服务对象并调用它,它没有任何问题.

解决方法

Here is my app.config file of the class library:

您应该将此配置设置放到主应用程序的配置文件中. .NET应用程序(调用您的类库)使用来自它自己的配置文件的数据,而不是来自库配置文件.

.NET 进程抛出 System.InvalidOperationException

.NET 进程抛出 System.InvalidOperationException

如何解决.NET 进程抛出 System.InvalidOperationException?

我已经尝试了我在网上找到的所有解决方案,但都没有奏效。 我确保我已经转义了所有引号并双引号其中有空格的任何路径,我已经确保所有进程正常和正确启动。 但由于某种原因,此进程在内部失败并返回退出代码 100,并抛出此特定错误。

具体的工作:

  • 该函数/进程在 cmd 和 powershell 中运行良好。
  • Windows 事件日志没有说明任何关于错误的额外信息。和标题说的一样。

我尝试过的事情:

  • 所以最初我认为这与用户访问 C 驱动器有关。虽然由于 VS 是在 admin 中运行,我认为这没问题。但是我查看了此链接:https://forum.eset.com/topic/14598-cant-scan-c-drive/ 没有帮助。

  • 然后我发现了一堆相似甚至相同的问题;他们中的很多人导致该过程实际上没有正确启动的解决方案:https://social.msdn.microsoft.com/Forums/vstudio/en-US/e899c6c0-7fba-40ec-a824-1bb26715318f/processstart-invalidoperationexception?forum=csharpgeneral 但是,这并没有提供我的解决方案。

  • 与上述声明类似,我发现了一个旧答案,该答案暗示 processstartinfo 对象的某些属性设置不正确 https://forums.codeguru.com/showthread.php?517237-Process-started-in-dll-works-correctly-in-testing-but-not-in-final-version 但是在更改 processstartinfo 的方式时,这对我也没有任何作用设置的属性。

    • 设置 processstartinfo.WorkingDirectory 和 processstartinfo.FileName,反之亦然。
  • 我还假设 ecls.exe 命令行可执行文件实际上无法像带有属性标签的 cmd 行 exe 一样运行(因为原始命令只是称为“ecls”而不是“ecls.exe”,所以测试了设置 processstartinfo 以启动空白 CMD 控制台然后运行原始扫描 cmd 的方法。但是这最终抛出了相同的错误,所以我知道 ecls.exe 可以以 cmd 行方式运行;它只是中断别的。

  • 我也终于找到了至少给了我一些提示的东西:https://www.experts-exchange.com/questions/29134987/ASP-NET-gets-InvalidOperationException-exception-on-System-Diagnostic-Process-object.html 解决方案是在付费墙后面,但我注意到在这个问题中,他们实际上达到了某种输出,而我的问题甚至从未达到他们收到的输出。所以我知道它在 exe 运行时失败,而不是在 exe 中失败。 使用 StandardOutput 错误日志记录后,我将确切的问题缩小到抛出的这个错误:

    “无法打开 C:\Users\...\Logs\scanner.log: ????????????\r\n”

我不知道自己做错了什么,为此浪费了一天。 请有人给出比windows更好的解释...

// USING ESET
processstartinfo psi = new processstartinfo();
//Set pathway
if (System.IO.File.Exists($@"{ConfigurationManager.AppSettings["ESETPath"]}\ecls.exe"))
    psi.FileName = $@"""{ConfigurationManager.AppSettings["ESETPath"]}\ecls.exe""";
else
    psi.FileName = $@"""{ConfigurationManager.AppSettings["ESETAlternativePath"]}\ecls.exe""";
//Set arguments
psi.Arguments = $"--log-file={ConfigurationManager.AppSettings["ESETLogFilePath"]} --no-log-console --log-all {FilePath}";
psi.CreateNowindow = true;
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.WindowStyle = ProcessWindowStyle.Hidden;

//Create process with Process Info
Process proc = Process.Start(psi);
proc.WaitForExit(AllowedTimePeriod);

if (proc.HasExited == false)
{
    proc.Kill();
    throw new Exception("Error occured. Anti-Virus Scan Could not complete the operation. Scanning time period too long.");
}

//Log
string stdout = proc.StandardOutput.ReadToEnd();
string stderr = proc.StandardError.ReadToEnd();

switch (proc.ExitCode)
{
    case 0: VirusFound = false; return true;
    case 1:
        VirusFound = true;
        if (System.IO.File.Exists(FilePath))
        {
            System.IO.File.Delete(FilePath);
        }
        return true;
    default:
        throw new Exception("Error occured. Anti-Virus Scan Could not complete the operation. Returned Error Code " + proc.ExitCode.ToString());
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

Android’InvocationTargetException’和’UnsupportedOperationException’

Android’InvocationTargetException’和’UnsupportedOperationException’

我在OPPO X905和OPPO X907上遇到了问题,两者都是 Android 4.0.3(API等级15),我没有使用任何更高级别的API,我在Google和SO上搜索过,都与我的问题不同,下面是我的xml文件和崩溃日志,在此先感谢.
xml文件:(分隔符的边距最初是7.5dp,这可能是问题吗?)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/item_full"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#eff0f7"
    android:baselineAligned="false"
    android:orientation="vertical" >
    <RelativeLayout
        android:id="@+id/item_first_half"
        android:layout_width="match_parent"
        android:layout_height="36dp"
        android:orientation="vertical" >
        <View
            android:id="@+id/first_path"
            android:layout_width="4dp"
            android:layout_height="4dp"
            android:layout_marginLeft="40dp"
            android:layout_marginStart="40dp"
            android:background="@drawable/selector_car_action_path" />
        <ImageView
            android:id="@+id/im_car_direction_icon"
            android:layout_width="28dp"
            android:layout_height="28dp"
            android:layout_gravity="top"
            android:layout_marginLeft="28dp"
            android:layout_marginStart="28dp"
            android:layout_marginTop="4dp"
            android:background="@drawable/selector_car_action_background"
            android:padding="2dp"
            android:src="@drawable/selector_navi_icon_63" />
        <View
            android:id="@+id/second_path"
            android:layout_width="4dp"
            android:layout_height="4dp"
            android:layout_below="@id/im_car_direction_icon"
            android:layout_marginLeft="40dp"
            android:layout_marginStart="40dp"
            android:background="@drawable/selector_car_action_path" />
        <TextView
            android:id="@+id/tv_direction"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginEnd="15dp"
            android:layout_marginLeft="68dp"
            android:layout_marginRight="15dp"
            android:layout_marginStart="68dp"
            android:singleLine="true"
            android:text=""
            android:textColor="@drawable/selector_car_route_turn_text"
            android:textSize="16sp" />
    </RelativeLayout>
    <RelativeLayout
        android:id="@+id/item_second_half"
        android:layout_width="match_parent"
        android:layout_height="32dp" >
        <View
            android:id="@+id/third_path"
            android:layout_width="4dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="40dp"
            android:layout_marginStart="40dp"
            android:background="@drawable/selector_car_action_path" />
        <TextView
            android:id="@+id/tv_road_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="68dp"
            android:layout_marginStart="68dp"
            android:layout_marginTop="4dp"
            android:singleLine="true"
            android:text=""
            android:textColor="@drawable/selector_car_route_desc"
            android:textSize="16sp" />
        <TextView
            android:id="@+id/divider_for_road_and_distance"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_marginEnd="7dp"
            android:layout_marginLeft="7dp"
            android:layout_marginRight="7dp"
            android:layout_marginStart="7dp"
            android:layout_marginTop="4dp"
            android:layout_toEndOf="@id/tv_road_name"
            android:layout_toRightOf="@id/tv_road_name"
            android:singleLine="true"
            android:text="|"
            android:textColor="@drawable/selector_car_route_desc"
            android:textSize="16sp" />
        <TextView
            android:id="@+id/tv_ride_distance"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="15dp"
            android:layout_marginRight="15dp"
            android:layout_marginTop="4dp"
            android:layout_toEndOf="@id/divider_for_road_and_distance"
            android:layout_toRightOf="@id/divider_for_road_and_distance"
            android:singleLine="true"
            android:text=""
            android:textColor="@drawable/selector_car_route_desc"
            android:textSize="16sp" />
        <View
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_alignParentBottom="true"
            android:layout_marginEnd="15dp"
            android:layout_marginLeft="68dp"
            android:layout_marginRight="15dp"
            android:layout_marginStart="68dp"
            android:background="#dee1f0" />
    </RelativeLayout>
</LinearLayout>

drawable / selector_car_route_desc文件是

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_selected="true" android:color="@color/color_999999"/>
    <item android:state_selected="false" android:color="@color/color_333333"/>

</selector>

崩溃日志:

android.view.InflateException: Binary XML file line #106: Error inflating class <unkNown>
android.view.LayoutInflater.createView(LayoutInflater.java:606)
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
android.view.LayoutInflater.inflate(LayoutInflater.java:489)
android.view.LayoutInflater.inflate(LayoutInflater.java:396)
android.view.LayoutInflater.inflate(LayoutInflater.java:352)
com.tencent.map.ama.route.ui.view.e.<init>(CarRouteShowItem.java:78)
com.tencent.map.ama.route.ui.view.f.a(CarRouteShowView.java:100)
com.tencent.map.ama.route.ui.view.d.a(CarRouteDetailView.java:37)
com.tencent.map.ama.route.ui.MapStateCarRoute.e(MapStateCarRoute.java:418)
com.tencent.map.ama.route.ui.MapStateCarRoute$1.run(MapStateCarRoute.java:255)
android.os.Handler.handleCallback(Handler.java:605)
android.os.Handler.dispatchMessage(Handler.java:92)
android.os.Looper.loop(Looper.java:137)
android.app.ActivityThread.main(ActivityThread.java:4476)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:511)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:808)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:575)
dalvik.system.NativeStart.main(Native Method)
cause by:
java.lang.reflect.InvocationTargetException: null
java.lang.reflect.Constructor.constructNative(Native Method)
java.lang.reflect.Constructor.newInstance(Constructor.java:417)
android.view.LayoutInflater.createView(LayoutInflater.java:586)
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
android.view.LayoutInflater.inflate(LayoutInflater.java:489)
android.view.LayoutInflater.inflate(LayoutInflater.java:396)
android.view.LayoutInflater.inflate(LayoutInflater.java:352)
com.tencent.map.ama.route.ui.view.e.<init>(CarRouteShowItem.java:78)
com.tencent.map.ama.route.ui.view.f.a(CarRouteShowView.java:100)
com.tencent.map.ama.route.ui.view.d.a(CarRouteDetailView.java:37)
com.tencent.map.ama.route.ui.MapStateCarRoute.e(MapStateCarRoute.java:418)
com.tencent.map.ama.route.ui.MapStateCarRoute$1.run(MapStateCarRoute.java:255)
android.os.Handler.handleCallback(Handler.java:605)
android.os.Handler.dispatchMessage(Handler.java:92)
android.os.Looper.loop(Looper.java:137)
android.app.ActivityThread.main(ActivityThread.java:4476)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:511)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:808)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:575)
dalvik.system.NativeStart.main(Native Method)
cause by:
java.lang.UnsupportedOperationException: Can''t convert to dimension: type=0x12
android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463)
android.view.View.<init>(View.java:2849)
android.widget.TextView.<init>(TextView.java:499)
android.widget.TextView.<init>(TextView.java:492)
java.lang.reflect.Constructor.constructNative(Native Method)
java.lang.reflect.Constructor.newInstance(Constructor.java:417)
android.view.LayoutInflater.createView(LayoutInflater.java:586)
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
android.view.LayoutInflater.inflate(LayoutInflater.java:489)
android.view.LayoutInflater.inflate(LayoutInflater.java:396)
android.view.LayoutInflater.inflate(LayoutInflater.java:352)
com.tencent.map.ama.route.ui.view.e.<init>(CarRouteShowItem.java:78)
com.tencent.map.ama.route.ui.view.f.a(CarRouteShowView.java:100)
com.tencent.map.ama.route.ui.view.d.a(CarRouteDetailView.java:37)
com.tencent.map.ama.route.ui.MapStateCarRoute.e(MapStateCarRoute.java:418)
com.tencent.map.ama.route.ui.MapStateCarRoute$1.run(MapStateCarRoute.java:255)
android.os.Handler.handleCallback(Handler.java:605)
android.os.Handler.dispatchMessage(Handler.java:92)
android.os.Looper.loop(Looper.java:137)
android.app.ActivityThread.main(ActivityThread.java:4476)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:511)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:808)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:575)
dalvik.system.NativeStart.main(Native Method)

CarRouteShowItem.java:78的代码是这样的:

View mView = LayoutInflater.from(mContext).inflate(R.layout.car_route_detail_item,null);

CarRouteShowItem不是View的子代,其代码如下:

public class CarRouteShowItem {

    private Context mContext;

    private View mView;

    public CarRouteShowItem(Context context) {
        mContext = context;

        // mView is used by caller 
        mView = LayoutInflater.from(mContext).inflate(R.layout.car_route_detail_item,null);

        // some view finds 
    }

        // some other methods related with specific logic
}

图形布局可以在Eclipse中从API级别8预览到API级别23,但是当我在API级别15的Android Studio中预览时,它会显示错误消息:无法解析资源@style / Widget.TextView,其他API级别没问题,但我没有使用TextView的样式.

解决方法

你需要的只是一个额外的眼睛:-)

enter image description here

android:layout_height="1px"

希望你现在能看到.第二个RelativeLayout中的最后一个子项,其id为item_second_half,类型为< View,将其更改为

android:layout_height="1dp"

让我尽快回顾一下

关于解决win10 Docker启动报InvalidOperationException启动docker报错的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于.net – XML序列化继承类时的InvalidOperationException、.net – 创建wcf Web服务实例时出现InvalidOperationException、.NET 进程抛出 System.InvalidOperationException、Android’InvocationTargetException’和’UnsupportedOperationException’等相关知识的信息别忘了在本站进行查找喔。

本文标签: