{"action":"created","issue":{"url":"https://api.github.com/repos/jeffkl/RoslynCodeTaskFactory/issues/15","repository_url":"https://api.github.com/repos/jeffkl/RoslynCodeTaskFactory","labels_url":"https://api.github.com/repos/jeffkl/RoslynCodeTaskFactory/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/jeffkl/RoslynCodeTaskFactory/issues/15/comments","events_url":"https://api.github.com/repos/jeffkl/RoslynCodeTaskFactory/issues/15/events","html_url":"https://github.com/jeffkl/RoslynCodeTaskFactory/issues/15","id":284093364,"number":15,"title":"Not working in .NET Core v2.0 project","user":{"login":"eduherminio","id":11148519,"avatar_url":"https://avatars3.githubusercontent.com/u/11148519?v=4","gravatar_id":"","url":"https://api.github.com/users/eduherminio","html_url":"https://github.com/eduherminio","followers_url":"https://api.github.com/users/eduherminio/followers","following_url":"https://api.github.com/users/eduherminio/following{/other_user}","gists_url":"https://api.github.com/users/eduherminio/gists{/gist_id}","starred_url":"https://api.github.com/users/eduherminio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduherminio/subscriptions","organizations_url":"https://api.github.com/users/eduherminio/orgs","repos_url":"https://api.github.com/users/eduherminio/repos","events_url":"https://api.github.com/users/eduherminio/events{/privacy}","received_events_url":"https://api.github.com/users/eduherminio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-22T07:35:23Z","updated_at":"2017-12-24T18:35:26Z","closed_at":null,"author_association":"NONE","body":"I'm trying to create a .zip file using MSBuild following [this example](https://peteris.rocks/blog/creating-release-zip-archive-with-msbuild/) in a .csproj targetting `netcoreapp2.0`.\r\n\r\nSince MSBuild on .NET Core does not support CodeTaskFactory, I tried modifying the task by using RoslynCodeTaskFactory in the following way:\r\n\r\n```\r\n<UsingTask TaskName=\"Zip\" TaskFactory=\"CodeTaskFactory\" AssemblyFile=\"$(RoslynCodeTaskFactory)\">\r\n    <ParameterGroup>\r\n      <OutputFilename ParameterType=\"System.String\" Required=\"true\" />\r\n      <Files ParameterType=\"Microsoft.Build.Framework.ITaskItem[]\" Required=\"true\" />\r\n    </ParameterGroup>\r\n    <Task>\r\n      <Reference Include=\"System.IO.Compression\" />\r\n      <Using Namespace=\"System.IO.Compression\" />\r\n      <Code Type=\"Fragment\" Language=\"cs\">\r\n        <![CDATA[\r\n      try\r\n      {\r\n        using (Stream zipStream = new FileStream(Path.GetFullPath(OutputFilename), FileMode.Create, FileAccess.Write))\r\n        using (ZipArchive archive = new ZipArchive(zipStream, ZipArchiveMode.Create))\r\n        {\r\n            foreach (ITaskItem fileItem in Files)\r\n            {\r\n                string filename = fileItem.ItemSpec;\r\n                using (Stream fileStream = new FileStream(filename, FileMode.Open, FileAccess.Read))\r\n                using (Stream fileStreamInZip = archive.CreateEntry(new FileInfo(filename).Name).Open())\r\n                    fileStream.CopyTo(fileStreamInZip);\r\n            }\r\n        }\r\n        return true;\r\n      }\r\n      catch (Exception ex)\r\n      {\r\n        Log.LogErrorFromException(ex);\r\n        return false;\r\n      }\r\n    ]]>\r\n      </Code>\r\n    </Task>\r\n  </UsingTask>\r\n```\r\n\r\nHowever, I'm getting the following error:\r\n`The value \"\" resulting from evaluating the value of \"$(RoslynCodeTaskFactory)\" from attribute  \"AssemblyFile\" of element  <UsingTask> is not valid`.\r\n\r\nAm i doing something wrong?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jeffkl/RoslynCodeTaskFactory/issues/comments/353797948","html_url":"https://github.com/jeffkl/RoslynCodeTaskFactory/issues/15#issuecomment-353797948","issue_url":"https://api.github.com/repos/jeffkl/RoslynCodeTaskFactory/issues/15","id":353797948,"user":{"login":"jeffkl","id":17556515,"avatar_url":"https://avatars2.githubusercontent.com/u/17556515?v=4","gravatar_id":"","url":"https://api.github.com/users/jeffkl","html_url":"https://github.com/jeffkl","followers_url":"https://api.github.com/users/jeffkl/followers","following_url":"https://api.github.com/users/jeffkl/following{/other_user}","gists_url":"https://api.github.com/users/jeffkl/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffkl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffkl/subscriptions","organizations_url":"https://api.github.com/users/jeffkl/orgs","repos_url":"https://api.github.com/users/jeffkl/repos","events_url":"https://api.github.com/users/jeffkl/events{/privacy}","received_events_url":"https://api.github.com/users/jeffkl/received_events","type":"User","site_admin":false},"created_at":"2017-12-24T18:35:26Z","updated_at":"2017-12-24T18:35:26Z","author_association":"OWNER","body":"The `$(RoslynCodeTaskFactory)` property is set by an import inside the NuGet package.  You must include a `<PackageReference />` in your project and do a restore.   This should create a file named `obj\\MyProject.g.nuget.props` which contains an import to the task factory file that creates that property.  Verify you have things set up correctly."}}
{"actor":{"display_login":"jeffkl"}}