有什么办法可以在docker容器上运行aspnet_regiis.exe

时间:2019-04-01 17:03:18

标签: asp.net docker iis dockerfile

  

我有一个实验项目,我想在docker容器中运行asp.net Soap服务。我已经创建了Windows容器并在其中复制了所有必需的文件。我的服务使用web.config连接字符串加密。当我尝试运行服务时,出现以下错误

     
    

docker run -d -p 8000:80 --name my-service my-service

         
      

http://localhost:8000/MyService/MyService.asmx

    
  

解析器错误消息:无法使用提供程序'DataProtectionConfigurationProvider'解密。提供者的错误消息:密钥在指定状态下无效。 (来自HRESULT的异常:0x8009000B)

  

我尝试在容器内安装aspnet_regiis.exe -i命令,但出现以下错误

Microsoft(R)ASP.NET RegIIS版本4.0.30319.0 管理实用程序,用于在本地计算机上安装和卸载ASP.NET。 版权所有(C)Microsoft Corporation。版权所有。 开始安装ASP.NET(4.0.30319.0)。 此版本的操作系统不支持此选项。管理员应该使用“打开/关闭Windows功能”对话框,服务器管理器管理工具或dism.exe命令行工具,通过IIS8安装/卸载ASP.NET 4.5。有关更多详细信息,请参见http://go.microsoft.com/fwlink/?LinkID=216771。 完成安装ASP.NET(4.0.30319.0)。

我正在添加Dockerfile

from tkinter import *


def book_harvard():
    global author_entry, year_entry, title_entry  # ADDED

    reference = author_entry.get()
    reference_1 = year_entry.get()
    reference_2 = title_entry.get()
    string_to_display = reference + reference_1 + reference_2
    print(string_to_display)


def TypeofTextHarvard():
    second = Toplevel(first)
    first.withdraw()
    second.title("Type of Source")
    Source = Label(second, text = "What type of source would you like to reference?").grid(column=1, row=0)
    Book = Button(second, text="Book", command=Harvard).grid(column=1, row=1)
    Chapter = Button(second, text="Book Chapter").grid(column=1, row=2)
    Journal = Button(second, text="Journal Article").grid(column=1, row=3)


first = Tk()
first.title("Referencing Style")
Reference = Label(first, text="Which referencing style would you like to use?").grid(column=1, row=0)
Harvard = Button(first, text="Harvard Style", command=TypeofTextHarvard).grid(column=1, row=1)
APA = Button(first, text="APA Style").grid(column=1, row=2)


def Harvard():
    global author_entry, year_entry, title_entry  # ADDED

    third = Toplevel()
    third.title("book")
    author = StringVar()
    year = StringVar()
    title = StringVar()

    author_label = Label(third, text="Author")
    author_entry = Entry(third)
    year_label = Label(third, text="Year")
    year_entry = Entry(third)
    title_label = Label(third, text="Title")
    title_entry = Entry(third)
    button_1 = Button(third, text="Done", command=book_harvard)
    author_label_2 = Label(third, textvariable=author)
    year_label_2 = Label(third, textvariable=year)
    title_label_2 = Label(third, textvariable=title)

    author_label.grid(row=0, column=0)
    author_entry.grid(row=0, column=1)
    year_label.grid(row=1, column=0)
    year_entry.grid(row=1, column=1)
    title_label.grid(row=2, column=0)
    title_entry.grid(row=2, column=1)
    button_1.grid(row=3, column=0)
    author_label_2.grid(row=4, column=1)
    year_label_2.grid(row=4, column=2)
    title_label_2.grid(row=4, column=3)


first.mainloop()

0 个答案:

没有答案