Project wont build - Error building Player: ArgumentException: An empty file name is not valid.
Im using windows and building for windows phone. When building i get 2 errors:
Error building Player: ArgumentException: An empty file name is not valid. Parameter name: sourceFileName
ArgumentException: An empty file name is not valid. Parameter name: sourceFileName System.IO.File.Copy (System.String sourceFileName, System.String destFileName, Boolean overwrite) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:98) System.IO.File.Copy (System.String sourceFileName, System.String destFileName) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:86) PostProcessWSA.CopyTestCertificate () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWSA.cs:231) PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:141) UnityEditor.Metro.BuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:133) UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
Answer by Voras · Feb 07, 2016 at 11:59 AM
Ok, i found a solution. A dumb one, but it seems to work. You need to create a new project and copy assests from the old one, while building it constantly (copying all assests at once gives the same error).
Answer by Martinch0 · Feb 22, 2016 at 03:45 PM
I got this error because I didn't setup properly the WSA certificate in Edit -> Project Settings -> Player -> Windows Store -> Publishing -> Certificate. For some reason it was empty. I just chose my existing certificate and built it again successfully. Otherwise, you can try to create a new certificate and select it.
Your answer
![](https://koobas.hobune.stream/wayback/20220612063239im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
JsonUtility.FromJson<> has ArguementExceptions 0 Answers
Error while trying to build XCode project 0 Answers
Object list is null? 1 Answer
DOTS / ECS: Burst error BC1022: Accessing a managed array is not supported 0 Answers
CommandInvokationFailure: Failed to re-package resources. I've tried everything! Dx 2 Answers