CodeTaskFactory RoslynCodeTaskFactory " + licxDirectoryPath); try { Directory.CreateDirectory(licxDirectoryPath); } catch(Exception dex) { if (dex is IOException || dex is UnauthorizedAccessException || dex is PathTooLongException || dex is DirectoryNotFoundException || dex is SecurityException) { Log.LogError(ProjectName + ": Error trying to create directory " + licxDirectoryPath + ". " + dex.Message); } else { throw; } } } var licxFilePath = Path.Combine(licxDirectoryPath, "licenses.licx"); var licxFileInfo = new FileInfo(licxFilePath); if (licxFileInfo.Exists) { if (licxFileInfo.Length == 0) { return true; } if (licxFileInfo.IsReadOnly) { licxFileInfo.IsReadOnly = false; } } Log.LogMessage(MessageImportance.High, ProjectName + " -> " + licxFilePath); new FileStream(licxFilePath, FileMode.Create, FileAccess.Write, FileShare.Read) .Dispose(); Log.LogMessage(MessageImportance.Normal, ProjectName + ": Empty licenses.licx file created"); } catch(Exception ex) { Log.LogError(ProjectName + ": Error creating licenses.licx file. " + ex.Message); } ]]> $(CompileLicxFilesDependsOn); CreateEmptyLicenseLicx;