RazorJS - Could not load type 'System.Web.Razor.Parser.MarkupParser' - asp.net-mvc-4

When I try to use #Html.RazorJSInline() function I get
Could not load type 'System.Web.Razor.Parser.MarkupParser'
When I try to use #Html.RazorJSInclude() RazorJs is generating path to JS file but then I get the same error when trying to open the file with browser.
edit
I think it is caused by that the RazorJS was designed for Razor 1...
Does anybody find out some nice workaround?

Got here a bit late, but I hit a similar problem when trying to call RazorEngine's Razor.Parse(). I also got this message:
Could not load type 'System.Web.Razor.Parser.MarkupParser'
I was at the time using RazorEngine version 3.0.8. This issue was apparently resolved in a later version of RazorEngine (3.1.0)
So upgrading the package to this version fixed it for me.
I used the following command in the NuGet Package Manager Console to upgrade to the fixed version:
PM> Update-Package RazorEngine -Version 3.1.0
At the moment, RazorEngine is already a bunch of versions further (I think currently 3.7.2) but upgrading all the way to this version wasn't really an option for us, as this would've required quite a bit of refactoring in existing code. If this isn't an issue for you, you could always try the latest version.

Related

Pyarmor - Marshal loads failed

How do I fix the issue "The python version in runtime is different from the build time".
When I try to run the obfuscated file present in a folder I am getting this error.
Please help me with this!!
According to this:
https://pyarmor.readthedocs.io/en/latest/questions.html
You are probably running Pyarmor (building your obfuscated code) with a different version than the environment where the app is running. Find out the version that runs the app and try to run Pyarmor with the same version, for example by creating an environment with that version.

What is the correct package to use for SIgnalR with ASP.NET Core?

I'm trying to use SignalR in an ASP.NET Core web application but I'm struggling to find the correct package to use. In this article, they say to use "Microsoft.AspNetCore.SignalR" (with the help of a NuGet.Config file) but when I do a dotnet restore, I get:
error NU1102: Unable to find package Microsoft.AspNetCore.SignalR.Server with version (>= 0.2.0)
error NU1102: - Found 1 version(s) in nuget.org [ Nearest version: 0.0.1-alpha ]
error NU1102: - Found 0 version(s) in aspnetcidev
I guess the v0.0.1-alpha is not the one I want.
However, I found the package "Gray.Microsoft.AspNetCore.SignalR.Server" and it seems to work but the last published version is from November 2016... That, and the namespace make me think that it's not the package I have to use neither...
I also saw this video that refers to the v1.0.0 version but, of course, I can get it to work...
Anyway, what is the correct package to use in order to use SignalR?
I'm using the prerelease dev package for now.
https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json (thank you Pawel)
I also had to get the Microsoft.Extensions.Primitives from there.
Update:
I had to go back to .NET core 1.1 packages since migrating to 2.0 will not work for several reasons. I went back to using the unmaintained Microsoft.AspNetCore.SignalR.Server Version 0.1.0 from here:
https://www.myget.org/F/aspnetmaster/api/v3/index.json
Update:
For a new project I'm successfully using the v.1.0.0-alpha2-final version from nugget.org.
Examples including the JavaScript files can be found here: aspnet/SignalR-samples

Cannot install jQuery UI WIdgets:Datepicker

When following this tutorial (http://www.asp.net/mvc/tutorials/javascript/using-the-html5-and-jquery-ui-datepicker-popup-calendar-with-aspnet-mvc/using-the-html5-and-jquery-ui-datepicker-popup-calendar-with-aspnet-mvc-part-4), I try to install the jQuery UI WIdgets:Datepicker via NuGet and get the following error:
Attempting to resolve dependency 'jQuery.UI.Core (= 1.8.9)'.
Attempting to resolve dependency 'jQuery (≥ 1.4.4 && < 1.6)'.
Successfully installed 'jQuery 1.4.4'.
Successfully installed 'jQuery.UI.Core 1.8.9'.
Successfully installed 'jQuery.UI.Widgets.Datepicker 1.8.9'.
Install failed. Rolling back...
Updating 'jQuery 1.7.1.1' to 'jQuery 1.4.4' failed. Unable to find a version of 'jQuery.UI.Combined' that is compatible with 'jQuery 1.4.4'.
This is presumably because I have jQuery 1.7.1.1 in the solution for something else. How can I get around this?
If I can't, is there another datepicker I can use in ASP .NET MVC 4 (which I am new to) with clear instructions on using?
I had the exact same problem, so I downloaded the widget manually: http://jqueryui.com/download/
Extracted the folder and added the scripts I needed to my project:
\jquery-ui-1.10.2.custom\jquery-ui-1.10.2.custom\development-bundle\themes\base\jquery.ui.datepicker.css
\jquery-ui-1.10.2.custom\jquery-ui-1.10.2.custom\development-bundle\ui\jquery.ui.datepicker.js
The reason why Nuget failed the installation was because the package was trying to reference jquery.1.4 and MVC 4 needs a higher library.
Hope it helps...
It seems Old post but people like me come to later in to this post I resolve this issue by using bootstrap date piker instead of using jquery ui date picker.

Outdated version of Zend Engine API

I am hosting a website, using the Symfony framework, on a MAMP server on my Mac, and I'm trying to generate bundles automatically with the help of the terminal.
If it is relevant in any way, here is what I try to type into the terminal:
php -c /Applications/MAMP/bin/php/php5.4.10/conf/php.ini php
app/console generate:bundle
And here is the error I get:
XCache requires Zend Engine API version 220100525. The Zend Engine API
version 220090626 which is installed, is outdated.
Could not open input file: php
Do any of you have an idea of how I could update the Zend Engine API or otherwise fix my problem? That would be of HUGE help!
Edit:
Thanks to the help of whistlergreg I've gotten rid of one of the problems it seems, but I still get the following response:
Could not open input file: php
Edit:
I was told by someone that the second php in my command shouldn't be there. Instead I should write:
php -c /Applications/MAMP/bin/php/php5.4.10/conf/php.ini app/console
generate:bundle
It seems like the second error was caused by a noobish typo by me, and now everything is working.
Note: With Xcache 3.0, xcache.so is no longer a Zend Extension but a PHP extension
remove zend_extension = */xcache.so
load it using extension = xcache.so
This might be why the error is being thrown:
The main cause for the error is because of outdated build of XCache
(not related to its actual version though), that mostly happens when
user upgrades PHP version. When compiling and building XCache, it’s
been associated with the version of Zend Engine API that exists on the
system at the time.
When PHP is updated or upgraded, the Zend Engine API is updated too, causing XCache module to fail as the version no longer matched.
The solution for the Zend Engine API version is newer error is pretty
simple. Just download, compile and install XCache again will fix and
resolve the issue permanently (until new PHP major version update). 1
Switch MAMP to use APC from the MAMP preferences menu, that worked for me! Make sure you restart apache after making the change.

Dojo version upgrade from 1.3 to 1.7.3

While changing the dojo version from 1.3 to 1.7.3, I simply replaced all my dojo 1.3 folder files with dojo 1.7.3. After rebuilding my web application, I am getting error hxrFailed at dojo.js, line no 15.
What is the wrong that I am facing here? Do I need to change any existing code. Is there any document to refer for all the required changes.
Please help me to get out from this issue.
Thanks,
Sridhar.ch
Lots changed and there are some lengthy tutorials to help you migrate. Check out the documentation tab on Dojo's website:
1.x to 2.0 migration guide:
http://dojotoolkit.org/reference-guide/1.8/releasenotes/migration-2.0.html
Updated buildsystem tutorial:
http://dojotoolkit.org/documentation/tutorials/1.8/build
In theory the current (1.8) build system is backward compatible until 2.0, but in practice I'm not sure it is 100% backward compatible because my 1.6 build profile didn't work with 1.7.x and up. I didn't try that hard to get it to work though.
I have gone through the same. the xhrFailed error occurred for me for multiple reasons. One of the reason was a missing a file in the define as below:
define(["something/was/missing/here"],function(){});.
Another cause for the same error occurred was when a folder in a path of a dependency was renamed but not updated in the application build profile. (This case only if your are doing custom builds).
See if that is the case!