Skip to content

LoadFile fails when using dotnet publish -p:PublishSingleFile=true >> (Value cannot be null. Parameter ('path') #21

@janmechtel

Description

@janmechtel

First of all thanks alot for CS-script!

At the moment, the below is more a cosmetic issue, It would be nice to have fewer files to deploy.

I'm happy to investigate, but don't worry to close this if it's weird.

The problem only occurs when i add -p:PublishSingleFile=true to donet publish

If I build and publish like this:

dotnet publish --configuration Release -r win-x64 -p:PublishSingleFile=true

During runtime, when loading the scripts with LoadFile this happens:

ERROR: System.ArgumentNullException: Value cannot be null. (Parameter 'path')
   at System.IO.Path.GetFullPath(String path)
   at CSScriptLib.EvaluatorBase`1.<>c.<GetReferencedAssemblies>b__22_1(String x)
   at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext()
   at System.Linq.Set`1.UnionWith(IEnumerable`1 other)
   at System.Linq.Enumerable.DistinctIterator`1.FillSet()
   at System.Linq.Enumerable.DistinctIterator`1.ToArray()
   at CSScriptLib.EvaluatorBase`1.GetReferencedAssemblies(String code, String[] searchDirs)
   at CSScriptLib.EvaluatorBase`1.ReferenceAssembliesFromCode(String code, String[] searchDirs)
   at CSScriptLib.RoslynEvaluator.Compile(String scriptText, String scriptFile, CompileInfo info)
   at CSScriptLib.EvaluatorBase`1.CompileCode(String scriptText, String scriptFile, CompileInfo info)
   at CSScriptLib.EvaluatorBase`1.LoadFile(String scriptFile, Object[] args)
   at DynamicsTransformer.Program.LoadTransformations()
   at DynamicsTransformer.Program.ProcessDocuments(Boolean dryRun)
   at DynamicsTransformer.Program.Main()

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