Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 53261 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
I migrated my Xamarin.iOS project to latest msbuild csproj project file format with 'dotnet migrate'. After that I cannot do 'dotnet build' anymore. Build fails with following error:
>/usr/local/share/dotnet/sdk/1.0.1/Sdks/Microsoft.NET.Sdk/build/Microsoft.NET.TargetFrameworkInference.targets(84,5): error : Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='xamarinios10'. They must be specified explicitly.
I found that Visual Studio Mac works so much better with new project files compared to project.json/package.config style projects. Improvement is very significant, to the point that I'd rather use Visual Studio Mac instead of VMWare + Visual Studio 2015 combination. The only things which stops me is this issue. I hope there is quick solution or workaround for this.
This is not supported currently. I believe we would need to add custom MSBuild targets to properly support Xamarin.iOS with the new Sdk style project file format. We would probably want to have a special Xamarin.iOS sdk that is imported into the project.
How does this dotnet tool work? Our Xamarin.iOS.CSharp.targets already set the TargetFrameworkIdentifier and TragetFrameworkVersion:
<TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">Xamarin.iOS</TargetFrameworkIdentifier>
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v1.0</TargetFrameworkVersion>
What else needs to be done?
Probably want to chat with mhutch about what the plan is for this. The new style .NET Core projects look like the following:
So the files added to the project are defined with implicitly imported MSBuild files based on the Sdk being imported, which in the above case is Microsoft.NET.Sdk.
So to do this fully we would probably want to do something like:
Which would not work with the existing Xamarin.iOS MSBuild targets since they do not define any file globs.
If you are not that concerned about having a simplified MSBuild project file you can basically take an existing Xamarin.iOS project and make two changes to it:
1) Change Project element to use an Sdk attribute:
2) In the global property group disable the default file globbing rules:
All files would need to be added to the project the same as before. Unless you work out some file globs that can be added to the project.
You can then, after setting the MSBuildSDKsPath environment variable to point to the .NET Core SDK, compile from the command line using MSBuild. However within Xamarin Studio the project is not currently treated as a .NET Core project.
I think this is impacting more than just .NET Core.
I have a xamarinios10 csproj that I use to package and publish via nuget. The pack command is erroring out when executed on this csproj.
This machine has never had VS2015 on it. Right now, I'm forced to make my changes, go to my VM that has VS2015 on it, fetch the changes and nuget pack and push from there.
If I'm missing something, let me know, but I'm thinking this needs to be solved with the same type of fix for this thread.
I have a thread going here about the issues I'm facing:
Ugh, file globs are not going to work well for Xamarin.iOS :(
I honestly don't understand how `nuget pack` has anything to do with this feature request?
@Andrey: for now, I would recommend not migrating your Xamarin.iOS, Android or Mac projects using `dotnet migrate`.
The new project format is not supported by any of those project types.
This is a bug in `dotnet migrate`. You cannot migrate iOS projects the same way as .NET Core projects, and it's creating an invalid project.
We would definitely like to support the new `Sdk` style projects for Xamarin.iOS at some point. However, it would involve building an iOS MSBuild SDK, rewriting our VS project system using CPS, and designing a migration system for the properties and items in iOS projects. It would also break project format compatibility with VS2015. We're looking into it, but it probably won't be any time soon for the aforementioned reasons.
FWIW you can use <PackageReference> without migrating, at least on Mac.