marshallward / TiledSharp

C# library for parsing and importing TMX and TSX files generated by Tiled, a tile map generation tool
http://marshallward.github.io/TiledSharp
Apache License 2.0
329 stars 87 forks source link

Nuget package 1.0.0 .NETFramework and .NETCoreApp compatibility #53

Closed danielscherzer closed 5 years ago

danielscherzer commented 6 years ago

Thank you for your very good package! I work with VS 2017 15.8.6. When building dotnet core applications using your nuget package I get this warning

warning NU1701: Package 'TiledSharp 1.0.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.

, but your package seems to work.

When building dotnet Framework (tried 4.6. 4.6.1 and 4.7.1) applications using your nuget package I get this error

error CS1705: Assembly 'TiledSharp' with identity 'TiledSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

and compilation fails. I tried to install the nuget package for System.Runtime with the required Version, but still the error persists.

The old nuget package 0.15 works with dotnet Framework and works (with the warning) with dotnet core.

marshallward commented 6 years ago

Thanks, I haven't really tested things against (or even use) .NET core, but others have submitted changes to allow compatibility. Hopefully others will see this issue and comment on it though.

CodeMyst commented 5 years ago

This has been fixed in #55 So I guess just a nuget update should be pushed

marshallward commented 5 years ago

Thanks, I'll take care of that today

On Mon, 3 Dec 2018, 08:48 CodeMyst, notifications@github.com wrote:

This has been fixed in #55 https://github.com/marshallward/TiledSharp/pull/55 So I guess just a nuget update should be pushed

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/marshallward/TiledSharp/issues/53#issuecomment-443545297, or mute the thread https://github.com/notifications/unsubscribe-auth/AAcN6zNT_hLh819zUobtfU93o__YfmBEks5u1EqpgaJpZM4XSX_R .

davidwesst commented 5 years ago

Any update on this? I'm getting a similar error with Unity 2018.3 (see below) and looking at the NuGet Gallery, it seems that it hasn't been updated in about three months.

Any chance we'll see that Nuget push soon?

Assembly 'TiledSharp' with identity 'TiledSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [Assembly-CSharp]

CodeMyst commented 5 years ago

@davidwesst Until the new nuget update is pushed you could try cloning the repo and building the .Net Standard library yourself if you know how.

marshallward commented 5 years ago

Sorry for this, I was having trouble getting my toolchain to see the new NuGet metadata (very much incompetence on my end) and lost steam. Will have another crack tonight.

On Fri, 21 Dec 2018, 17:37 CodeMyst, notifications@github.com wrote:

@davidwesst https://github.com/davidwesst Until the new nuget update is pushed you could try cloning the repo and building the .Net Standard library yourself if you know how.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/marshallward/TiledSharp/issues/53#issuecomment-449276004, or mute the thread https://github.com/notifications/unsubscribe-auth/AAcN64sGr73xn1m0ColSU8-I92rxNkVpks5u7IGTgaJpZM4XSX_R .

CodeMyst commented 5 years ago

@marshallward How are you usually making NuGet packages? If you're using Visual Studio you can just right click the project and click on Pack and it should work.

marshallward commented 5 years ago

Linux unfortunately... I think my command line tools are very out of date

marshallward commented 5 years ago

The main confusion here is that all of the instructions that I can find refer to a .nuspec file, but the most recent changes seem to have removed these files and integrated the information into .csproj. Is that right?

The downside is that it seems that all of the command line methods that I can find for pushing an update to nuget just don't work without a .nuspec file.

I am guessing there's some way to do this, but I am just not finding it anywhere.

CodeMyst commented 5 years ago

@marshallward Install the .Net Core SDK (so you have the dotnet commands) and run dotnet pack and that will generate the NuGet package file.

https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial#install

https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli#run-the-pack-command

You can also publish the package with the dotnet commands: https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli#publish-with-dotnet-nuget-push

marshallward commented 5 years ago

Progressing slowly on this... seems that I do not have some of the older frameworks available:

$ dotnet list TiledSharp package
Project 'TiledSharp' has the following package references
   [net35]: No packages were found for this framework.
   [net40]: No packages were found for this framework.
   [net45]: No packages were found for this framework.
   [netstandard2.0]: 
   Top-level Package             Requested   Resolved
   > NETStandard.Library   (A)   [2.0.3, )   2.0.3   

I am looking around my /opt/dotnet/sdk directory but it seems there is nothing support these older .NET runtimes.

Is it just that these are not supported at all? Or just not supported in the standard dotnet-sdk bundle?

marshallward commented 5 years ago

Nevermind, it seems these are no longer distributed with Mono. Will work through this one way or the other (maybe removing net35/40/45 support if need be)

marshallward commented 5 years ago

I've done a nuget update with your various Core and Standard changes (loosely tagged as 1.0.1).

I've removed .NET 3.5, 4.0, 4.5 as target frameworks for now, until there's a simple way to get all this working cleanly.

Otherwise, I was able to do everything with dotnet commands. Apologies to all for the delay here, my .NET knowledge is about 5 years out of date!

CodeMyst commented 5 years ago

I just tried making the NuGet package on Linux, and apparently you can use mono's reference assemblies like so:

export FrameworkPathOverride=/usr/lib/mono/4.5/

And then you can use dotnet pack and other dotnet commands to build for other frameworks as well.

danielscherzer commented 5 years ago

Thanks! Works great!