Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET Core (>= v1.1) support. #76

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

huchim
Copy link

@huchim huchim commented May 16, 2017

.NET Core 1.1 was released at november 17 and there are 3 releases more after 1.1 (1.1.1, 1.1.2 & 2.0.0).

This code don't break your current compilation because I created 1 solution mustache-sharp-core.sln with two projects: mustache-sharp\mustache-sharp.csproj and mustache-sharp.test\mustache-sharp-core.test.csproj that include your code.

mustache-sharp.csproj

This project include all files of your original project but the information of nuget is in the project itself and don't use the .nuspec file.

I added directive NETCOREAPP1_1:

  • PropertyDictionary.cs use type.GetTypeInfo() when compilation is in .NETCore.
  • UpcastDictionary.cs use type.GetTypeInfo() when compilation is in .NETCore.
  • HtmlFormatCompiler.cs changes implementation of method escapeInvalidHtml(object, TagFormattedEventArgs) because SecurityManager it's not avalaible.

Properties\Resources.Designer.cs

The problem with the resource file is that is "auto-generated" and the original version is that use typeof and now we need to use GetTypeInfo(). Visual Studio 2017 generate the file corrrectly but I don't wan't to break the compilation.

I created a copy of the file with de name Resources.Core.resx and the generated file Resources.Core.Designer.cs had a class named Resources_Core.

I added this code to the files, and only works with the net core, so won't break current compilation.

#if NETCOREAPP1_1
using Resources = Mustache.Properties.Resources_Core;
#else
using Mustache.Properties;
#endif

Nuget

All nuget package is in the csproj file, but the nuspec was not touched. I created a powershell script (nuget-version.ps1) that push the package to the nuget. The package is compiled but VisualStudio.com services using my branch (I needed the package "urgently").

I updated nuget.exe to version 3.5.


This is my first pull request and I tried to don't break your current compilation using directives and creating csproj, my main interest on this project is to generate reports with my code using mustache, and your code works nice.

Kind regards

Carlos Huchim
Yucatán, México.

huchim added 14 commits May 15, 2017 08:55
Assembly info works differente in NetCore, and SecurityElement it isn't ported.
NetCore fails when we use typeof(Resources).Assamblye instead of GetTypeInfo().
All package information is in the csproj. I'm using mustache-sharp-core to compile the project using netcore and don't break original compilation.
• Add suport to netcore
• Disable `ShouldReturnNullIfNotDictionaryType` test. Im not sure how to implement it correctly.
• Add solution with the net core project and test project.
• Update AssemblyInfo to test with the `mustache-sharp-core.test`project.
• Update nuget CLI, we need -ForeEnglishOutput flag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant