docker-archive / communitytools-image2docker-win

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generate_IIS : You cannot call a method on a null-valued expression.

golubenkoff opened this issue · comments

Hi, Trying to convert from existing server with a lot of apps and getting error:
How to convert or fix? Thanks

`Generate_IIS : You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\Image2Docker\1.8.5\Functions\Private\GenerateDockerfile.ps1:34 char:23

  • ... ockerfile = & "Generate_$Artifact" -MountPath $MountPath -ManifestPat ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Generate_IIS], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull,Generate_IIS`

If i Specify manually ArtifactParam - all is Ok, But i need app Applications

PS C:\Install\Image2Docker\1.8.5> ConvertTo-Dockerfile -Local -OutputPath C:\Docker\ -Artifact IIS -Force -Verbose
VERBOSE: User specified the Force Parameter. Removing existing items from C:\Docker
VERBOSE: User specified path C:\Docker\ has been created
VERBOSE: Using local drive: C:
VERBOSE: Starting conversion process
VERBOSE: Started discovering IIS artifact
VERBOSE: Checking IIS ApplicationHost config for Windows Version: 10.0
VERBOSE: Target Image Version 10.0.14393.0
VERBOSE: IIS service is present on the system
VERBOSE: ASP.NET is present on the system
VERBOSE: .NET 3.5 is present on the system
VERBOSE: Finished discovering IIS artifact
VERBOSE: Generating Dockerfile based on discovered artifacts in :C:
VERBOSE: Generating result for IIS component
VERBOSE: Copying IIS configuration files
VERBOSE: Writing instruction to create site Default Web Site
VERBOSE: Processing source directory: C:\inetpub\wwwroot
VERBOSE: Copying content from source: C:\inetpub\wwwroot, to: C:\Docker
VERBOSE: Creating web app MSMQ
VERBOSE: Processing source directory: C:\inetpub\wwwroot\msmq
Generate_IIS : You cannot call a method on a null-valued expression.
At C:\Install\Image2Docker\1.8.5\Functions\Private\GenerateDockerfile.ps1:34 char:23

  • ... ockerfile = & "Generate_$Artifact" -MountPath $MountPath -ManifestPat ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Generate_IIS], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull,Generate_IIS

Found that issue only with this WebSite:

Name ID State Physical Path Bindings


Default Web Site 1 Started %SystemDrive%\inetpub\wwwroot http :80:
net.tcp 808:

net.msmq localhost
msmq.formatname localhost
net.pipe *

I am having a similar problem with my web server. I have tried both WebSites.

ConvertTo-Dockerfile -local -OutputPath I:\i2d2\test -Artifact IIS -ArtifactParam test -verbose

VERBOSE: Using local drive: C:
VERBOSE: Starting conversion process
VERBOSE: Started discovering IIS artifact
VERBOSE: Checking IIS ApplicationHost config for Windows Version: 6.3
VERBOSE: Dism PowerShell Cmdlets Version 6.3.0.0
VERBOSE: Target Image Version 6.3.9600.18384
VERBOSE: IIS service is present on the system
VERBOSE: ASP.NET is present on the system
VERBOSE: .NET 3.5 is present on the system
VERBOSE: Finished discovering IIS artifact
VERBOSE: Generating Dockerfile based on discovered artifacts in :C:
VERBOSE: Generating result for IIS component
VERBOSE: Copying IIS configuration files
VERBOSE: ** Skipping site path: Default Web Site
VERBOSE: Writing instruction to create site test
VERBOSE: Processing source directory: W:\external
VERBOSE: Copying content from source: W:\external, to: I:\i2d2\test
VERBOSE: Creating virtual directory cbp/TempPdf
VERBOSE: Processing source directory: E:\cbp\TempPdf
Generate_IIS : You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\Image2Docker\1.8.5\Functions\Private\GenerateDockerfile.ps1:37 char:23

  • ... ockerfile = & "Generate_$Artifact" -MountPath $MountPath -ManifestPat ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Generate_IIS], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull,Generate_IIS

I'm using the version 1.8.5 and the problem still there. I have a scenario where the Default Web Site has 2 applications (beta and alpha) under it, and I want to extract only one of those applications (in that case, beta). Here's command run and the log:

ConvertTo-Dockerfile -Verbose -Local -OutputPath c:\i2d2\iis -Artifact IIS -ArtifactParam "Default Web Site/beta"

VERBOSE: Using local drive: C:
VERBOSE: Starting conversion process
VERBOSE: Started discovering IIS artifact
VERBOSE: Checking IIS ApplicationHost config for Windows Version: 6.3
VERBOSE: Dism PowerShell Cmdlets Version 6.3.0.0
VERBOSE: Target Image Version 6.3.9600.18384
VERBOSE: IIS service is present on the system
VERBOSE: ASP.NET is present on the system
VERBOSE: .NET 3.5 is present on the system
VERBOSE: Finished discovering IIS artifact
VERBOSE: Generating Dockerfile based on discovered artifacts in :C:
VERBOSE: Generating result for IIS component
VERBOSE: Copying IIS configuration files
VERBOSE: Writing instruction to create site Default Web Site
VERBOSE: Processing source directory: C:\inetpub\wwwroot
VERBOSE: Copying content from source: C:\inetpub\wwwroot, to: C:\i2d2\iis
VERBOSE: Creating web app Beta
VERBOSE: Processing source directory: C:\Sites\beta
Generate_IIS : You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\Image2Docker\1.8.5\Functions\Private\GenerateDockerfile.ps1:37 char:23
+ ... ockerfile = & "Generate_$Artifact" -MountPath $MountPath -ManifestPat ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Generate_IIS], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull,Generate_IIS

then, this not Work?

commented

Still having the same issue. I don't know if the fix ever got merged because, I see the problem raised as an issue previously. Below is my -verbose output:

VERBOSE: Finished mounting image to: C:\Users\odidir\AppData\Local\Temp\226c3984-bf0a-4cc5-b410-9211fb5c8111-mount
VERBOSE: Starting conversion process
VERBOSE: Started discovering IIS artifact
VERBOSE: Checking IIS ApplicationHost config for Windows Version: 10.0
VERBOSE: Target Image Version 10.0.14393.2272
VERBOSE: IIS service is present on the system
VERBOSE: ASP.NET is present on the system
VERBOSE: .NET 3.5 is NOT present on the system
VERBOSE: Finished discovering IIS artifact
VERBOSE: Generating Dockerfile based on discovered artifacts in
:C:\Users\odidir\AppData\Local\Temp\226c3984-bf0a-4cc5-b410-9211fb5c8111-mount
VERBOSE: Generating result for IIS component
VERBOSE: Copying IIS configuration files
VERBOSE: Writing instruction to create site Default Web Site
VERBOSE: Processing source directory: C:\inetpub\wwwroot
VERBOSE: Copying content from source: C:\inetpub\wwwroot, to: C:\Users\odidir\DockerFileContent
VERBOSE: Writing instruction to expose port for site Default Web Site
VERBOSE: Writing instruction to create site Image2DockerSite
VERBOSE: Processing source directory: C:\Test_Image_Docker_Site
VERBOSE: Copying content from source: C:\Test_Image_Docker_Site, to: C:\Users\odidir\DockerFileContent
VERBOSE: Creating web app AppFolder/ray_app_1
VERBOSE: Processing source directory: C:\Test_Image_Docker_Site\AppFolder\ray_app_1
VERBOSE: Finished dismounting the Windows image from
C:\Users\odidir\AppData\Local\Temp\226c3984-bf0a-4cc5-b410-9211fb5c8111-mount
Generate_IIS : You cannot call a method on a null-valued expression.
At C:\Program Files\WindowsPowerShell\Modules\Image2Docker\1.8.5\Functions\Private\GenerateDockerfile.ps1:34 char:23

  • ... ockerfile = & "Generate_$Artifact" -MountPath $MountPath -ManifestPat ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [Generate_IIS], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull,Generate_IIS

Hi, my try to migrate wpf application services from iis on virtual machine, and this not work. But when i try with other, rather than .net web apps, this work. I Suspect that issues having problem with wpf services migrations.

Same error here. Help, please.