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

Bundle RazorEngine.dll which works on mono #203

Closed
forki opened this issue Sep 30, 2014 · 17 comments · Fixed by #207 or #209
Closed

Bundle RazorEngine.dll which works on mono #203

forki opened this issue Sep 30, 2014 · 17 comments · Fixed by #207 or #209

Comments

@forki
Copy link
Member

forki commented Sep 30, 2014

#202 suggests this is possible

@matthid
Copy link
Member

matthid commented Sep 30, 2014

Just some notes:

  • See the example code in the other issue in how to make it work
  • Because the problems seems to raise from calling the compiler and not being able to customize this process:
    • How about replacing the manuall call with Roslyn (in RazorEngine)
    • Add some API to influence the compiler call (like my change)
    • Because we are F# guys: How about using F# as the template language and using FSharp.Compiler.Service, this way you would not even require another dependency! This could in theory ported to ASP.net MVC as well (already dreaming of .fshtml files).

@forki
Copy link
Member Author

forki commented Sep 30, 2014

I'm pretty sure @tpetricek would prefer the third option, but just a hack to fix on mono would be ok.

@ovatsus
Copy link

ovatsus commented Sep 30, 2014

If we bundle a version of razor dll, it's important to capture how to rebuild that custom version somewhere

@matthid
Copy link
Member

matthid commented Oct 4, 2014

I have added https://www.nuget.org/packages/RazorEngine.N/ but I'm unable to setup paket to work with this (paket bug or did I setup invalid dependencies in the package?)

Paket failed with:

Error in resolution.
  Resolved:
    - CommandLineParser 1.9.71
    - FAKE >= 0
    - FSharp.Compiler.Service >= 0
    - Microsoft.AspNet.Razor >= 0
    - NUnit >= 0
    - NUnit.Runners >= 0
    - NuGet.CommandLine >= 0
    - RazorEngine.N 3.5.0
  Con't resolve:
    - Microsoft.AspNet.Razor 2.0.30506.0
       - from RazorEngine.N 3.5.0
 Please try to relax some conditions.

@cdrnet
Copy link
Member

cdrnet commented Oct 4, 2014

@matthid the paket issue may be related to fsprojects/Paket#140

@forki
Copy link
Member Author

forki commented Oct 5, 2014

It's not really a bug. But yes paket doesn't support conditional
dependencies.
On Oct 4, 2014 3:06 PM, "matthid" notifications@github.com wrote:

I have added https://www.nuget.org/packages/RazorEngine.N/ but I'm unable
to setup paket to work with this (paket bug or did I setup invalid
dependencies in the package?)

Paket failed with:

Error in resolution.
Resolved:
- CommandLineParser 1.9.71
- FAKE >= 0
- FSharp.Compiler.Service >= 0
- Microsoft.AspNet.Razor >= 0
- NUnit >= 0
- NUnit.Runners >= 0
- NuGet.CommandLine >= 0
- RazorEngine.N 3.5.0
Con't resolve:
- Microsoft.AspNet.Razor 2.0.30506.0
- from RazorEngine.N 3.5.0
Please try to relax some conditions.


Reply to this email directly or view it on GitHub
#203 (comment)
.

matthid added a commit to matthid/FSharp.Formatting that referenced this issue Oct 5, 2014
…anually in src/nugetDependencies instead of paket (see issue fsprojects#203).
@matthid
Copy link
Member

matthid commented Oct 5, 2014

Thanks! I worked around this by using nuget directly instead of paket.

@forki
Copy link
Member Author

forki commented Oct 5, 2014

Actually I don't it's a good idea to use such a hybrid solution with paket
and nuget. It will make things worse.

Why do you have this strange dependency in the package? That doesn't really
make sense to me.
On Oct 5, 2014 8:12 PM, "matthid" notifications@github.com wrote:

Thanks! I worked around this by using nuget directly instead of paket.


Reply to this email directly or view it on GitHub
#203 (comment)
.

@matthid
Copy link
Member

matthid commented Oct 5, 2014

I don't think this is such a good idea as well, but what are the alternatives? I guess its fine to leave it this way until paket supports this?

What do you mean, what kind of dependency would you suggest instead?

@forki
Copy link
Member Author

forki commented Oct 5, 2014

Paket will probably never support a conditional dependency to the same
package in different versions.
On Oct 5, 2014 9:35 PM, "matthid" notifications@github.com wrote:

I don't think this is such a good idea as well, but what are the
alternatives? I guess its fine to leave it this way until paket supports
this?

What do you mean, what kind of dependency would you suggest instead?


Reply to this email directly or view it on GitHub
#203 (comment)
.

@forki
Copy link
Member Author

forki commented Oct 6, 2014

Why do you have this splitted dependency? This feels like a big hack around versioning.

@cdrnet
Copy link
Member

cdrnet commented Oct 6, 2014

This can be needed if a dependency suddenly stops supporting some platform you still need to support, but you still want to leverage newer features on newer platforms. I have a similar problem with the FSharp.Core packages here (and I don't like it at all, that's why it is a prerelease for testing only)

@forki
Copy link
Member Author

forki commented Oct 6, 2014

I know, but still...

I created a new Paket issue (fsprojects/Paket#220) which could solve this. What do you guys think?

@forki
Copy link
Member Author

forki commented Oct 6, 2014

@matthid
Copy link
Member

matthid commented Oct 6, 2014

matthid@ec38f0a

While I think this would work here this is a major bug in paket now: If you watch closely Paket references the net45 dll which is build against an higher version of System.Web.Razor.dll while still using the old net40 System.Web.Razor.dll... this could lead to compiler errors in the best case (missing method exception?).

I read the nuget package this way: When using the .net45 dll you are not allowed to use a lower version than 3.2.2 (because I could have used new features of this dependency). So the only resolution for Paket is to use the net40 dll in both cases.

You said net45 profile is not build in FSharp.Formatting so it shouldn't matter, but the generated dependencies are now just wrong (for net45), should I use this anyway?

@forki
Copy link
Member Author

forki commented Oct 6, 2014

we will solve this issue soon. The new install model will propably fix this.

I think it'sa ok for now.

@matthid
Copy link
Member

matthid commented Oct 6, 2014

Done, see updated commits in: #207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants