Skip to content

Runtime Exception on Publish with Produce Single File option selected #80

@Taster-git

Description

@Taster-git

Visual Studio: 2022
Target Framework: net6.0-windows10.0.19041.0
Target runtime: win-x64
Deployment mode: Framework-dependant

Runtime Exception at all Production machines on Publish with Produce Single File option selected but works fine when this option is unselected.

Publish is successful but Exception when application is run at Production machines.

Called method: (or any other )
VirtualDesktop.FromHwnd(hWnd)

It returns following Exception
`Exception:Empty path name is not legal. (Parameter 'path')

StackTrace: at System.IO.Strategies.FileStreamHelpers.ValidateArguments(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at Roslyn.Utilities.StandardFileSystem.OpenFile(String filePath, FileMode mode, FileAccess access, FileShare share)
at Roslyn.Utilities.CommonCompilerFileSystemExtensions.OpenFileWithNormalizedException(ICommonCompilerFileSystem fileSystem, String filePath, FileMode fileMode, FileAccess fileAccess, FileShare fileShare)
at WindowsDesktop.Interop.ComInterfaceAssemblyBuilder.<>c.b__14_2(Assembly x)
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Collections.Generic.LargeArrayBuilder1.AddRange(IEnumerable1 items) at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable1 source)
at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable1 items) at Microsoft.CodeAnalysis.Compilation.ValidateReferences[T](IEnumerable1 references)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.WithReferences(IEnumerable1 references) at WindowsDesktop.Interop.ComInterfaceAssemblyBuilder.Compile(IEnumerable1 sources)
at WindowsDesktop.Interop.ComInterfaceAssemblyBuilder.CreateAssembly()
at WindowsDesktop.Interop.ComInterfaceAssemblyBuilder.GetAssembly()
at WindowsDesktop.VirtualDesktop.InitializeCore()
at WindowsDesktop.VirtualDesktop.FromHwnd(IntPtr hWnd)
at MyProject.DB.DTOs.ActiveApplication.<>c__DisplayClass138_0.b__0() in D:/ProjectPath`

Any Help ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions