I have a stimulus report that runs locally without any problems, but I get the following error in IIS
Access to the path 'Stimulsoft' is denied.
System.UnauthorizedAccessException: Access to the path 'Stimulsoft' is denied.
Source Error : Line 6
Line 4: }
Line 5:
Line 6: #Html.Stimulsoft().StiMvcViewer(options: new StiMvcViewerOptions()
Line 7: {
Line 8: Actions =
Code in Controller :
public ActionResult report()
{
var report = new StiReport();
report.Load(Server.MapPath("~/Content/SalaryReport.mrt"));
report.Compile();
Code in View :
#using Stimulsoft.Report.Mvc;
#{
ViewBag.Title = "Print";
}
#Html.Stimulsoft().StiMvcViewer(options: new StiMvcViewerOptions()
{
Actions =
{
GetReport = "report",
ViewerEvent = "viewerEvent"
}
})
unfortunately no one answered my question and I finally found the solution myself, the reason for this error is in the version of the reporting software that needs to be changed.
add this code to web config :
<appSettings>
<add key="PageInspector:ServerCodeMappingSupport" value="Disabled" />
</appSettings>
Use StimulSoft Report 2015 or higher, version 2014 does not work properly
Related
My goal is to test this code to make sure that Stanford Core NLP installed properly.
First I installed StanfordCOreNLP package using NuGet package manager and then I downloaded a zip file that contained a jar file that needed to be installed using jar -xf command , and then I ran the code.
At (var pipeline = new StanfordCoreNLP(props);)
I'm getting an error that says:
edu.stanford.nlp.io.RuntimeIOException: Error while loading a tagger model(probably missing model file)"
Inner Exception IOException:Unable to open"edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger" as class path, filename or URL
var jarRoot = #"D:/VisualStudioProjects/C#MachineLearningProjects/Chapter3TwiterSentiment/CoreNLPTest2/CoreNLPTest2/edu/stanford/nlp/models/pos-tagger";
var text = "We're going to test our CoreNLP instalation!!";
Properties props = new Properties();
props.setProperty("annotators", "tokenize, ssplit, pos, lemma, ner, parse, dcoref");
props.setProperty("ner.useSUTime", "0");
var curDir = Environment.CurrentDirectory;
Directory.SetCurrentDirectory(jarRoot);
var pipeline = new StanfordCoreNLP(props);
Directory.SetCurrentDirectory(curDir);
var annotation = new Annotation(text);
pipeline.annotate(annotation);
using (var stream = new ByteArrayOutputStream())
{
pipeline.prettyPrint(annotation, new PrintWriter(stream));
Console.WriteLine(stream.toString());
stream.close();
}
Console.ReadKey();
Please follow the below steps:
Step 1: Download Core NLP
Step 2: Unzip d:\stanford-corenlp-full-2018-10-05
Step 3: Unzip d:\stanford-corenlp-full-2018-10-05\stanford-corenlp-3.9.2-models.jar
Step 4: Change var jarRoot = #"d:/stanford-corenlp-full-2018-10-05/stanford-corenlp-3.9.2-models";
Step 5: Change props.setProperty("ner.useSUTime", "0"); to props.setProperty("sutime.binders", "0")
I just deployed a new controller to my production environment. For some reason, the controller does not get called. All other controllers on the site work fine. This is the only one that is failing. What I keep getting is the error:
Error rendering controller BlogListing.GetIndex: Could not create
controller: 'BlogListing'. The controller for path '/' was not found
or does not implement IController
I've spent about 3 hours trying to troubleshoot this. I have:
Added debug code into the controller to see if it is in fact being called. My debug statements does not get hit.
Verified the name of the controller is correct
I am using the default MVC routing.
Thinking that it might be a missing dependent dll, I copied all of the dlls from my production environment (where it is not working) to my local environment and it came right up
Checked file system permissions thinking that somehow it couldn't be read.
I did look at other posts regarding similar issues but none of those solutions worked or were not applicable
namespace Portal.Features.Blog.Controllers
{
using Glass.Mapper.Sc;
using Glass.Mapper.Sc.Web.Mvc;
using Sitecore.Data.Items;
using System;
using System.Linq;
using System.Web.Mvc;
using Portal.Foundation.Blog;
using portal.ct.gov.Models;
using Portal.Features.Blog.Models;
using portal.ct.gov.Business;
public class BlogListingController : GlassController
{
public ActionResult GetIndex(string keyword = "", string page = "", string author = "")
{
Sitecore.Diagnostics.Log.Info("Blog Controller found", "portal.ct.gov");
try
{
SitecoreContext scContext = new SitecoreContext();
Item contextItem = scContext.GetCurrentItem<Item>();
Item blogHome = null;
//Get Blog Root
if (contextItem != null)
{
blogHome = contextItem.Axes.SelectSingleItem("ancestor-or-self::*[##templatename = 'Blog Section']");
}
var sKeyword = !string.IsNullOrEmpty(HttpContext.Request.QueryString[Constants.QueryStrings.SearchKeyword]) ? HttpContext.Request.QueryString[Constants.QueryStrings.SearchKeyword] : string.Empty;
var blogAuthor = !string.IsNullOrEmpty(HttpContext.Request.QueryString["author"]) ? HttpContext.Request.QueryString["author"] : string.Empty;
var blogCategory = !string.IsNullOrEmpty(HttpContext.Request.QueryString["category"]) ? HttpContext.Request.QueryString["category"] : string.Empty;
var blogPage = !string.IsNullOrEmpty(HttpContext.Request.QueryString["page"]) ? HttpContext.Request.QueryString["page"] : "1";
var model = GetBlogListing(blogHome, sKeyword, blogCategory, blogAuthor, Convert.ToInt32(blogPage));
return View("/views/blog/BlogResultsMain.cshtml", model);
}
catch(Exception ex)
{
Sitecore.Diagnostics.Log.Error("Error processing bloglisting-->getINdex " + ex.Message, ex, "portal.ct.gov");
return View("/views/blog/BlogResultsMain.cshtml");
}
}
}
Any help is appreciated. Please note that I am using Sitecore CMS.
It is worth checking the cached MVC-ControllerTypeCache.xml file in folder c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\NAMEOFYOURAPP\xxxxx\xxxxxxxx\UserCache\.
If you can't find your controller there, remove the cached xml file and restart your website. More details you can find here
I am trying to make a simple reactjs.net simple application. I have installed React.Web.Mvc4 through NuGet manager. This is a MVC application and I am trying to render a Index view from the HomeController.
I have tried adding the chakra and V8 engine. Also, I have changed the ReactConfig.js to include -
ReactSiteConfiguration.Configuration.AddScript("~/Scripts/App.js");
JsEngineSwitcher.Current.DefaultEngineName = V8JsEngine.EngineName;
JsEngineSwitcher.Current.EngineFactories.AddV8();
However, I get the different error -
Server Error in '/' Application.
SyntaxError: Unexpected token export
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.ClearScript.ScriptEngineException: SyntaxError: Unexpected token export
Source Error:
Line 7:
Line 8: <!-- Reach Component -->
Line 9: #Html.React("Hello", new
Line 10: {
Line 11:
Index.cshtml
#using React.Web.Mvc
#{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<!-- Reach Component -->
#Html.React("Hello", new
{
})
and
Scripts/App.js
class Hello extends React.component {
render() {
return (<h1>Hello React App</h1>);
}
}
Now, in the App_Start -
ReactConfig.js
public static class ReactConfig
{
public static void Configure()
{
ReactSiteConfiguration.Configuration.AddScript("~/Scripts/App.js");
}
}
The http://localhost:65386/Home/Index should display -
"Hello React App"
using JavaScriptEngineSwitcher.ChakraCore;
using JavaScriptEngineSwitcher.Core;
using JavaScriptEngineSwitcher.Jint;
using JavaScriptEngineSwitcher.Jurassic;
using JavaScriptEngineSwitcher.Msie;
using JavaScriptEngineSwitcher.NiL;
using JavaScriptEngineSwitcher.V8;
using JavaScriptEngineSwitcher.Vroom;
namespace JavaScriptEngineSwitcher.Sample.AspNet45.Mvc5
{
public class JsEngineSwitcherConfig
{
public static void Configure(IJsEngineSwitcher engineSwitcher)
{
engineSwitcher.EngineFactories
.AddChakraCore()
.AddJint()
.AddJurassic()
.AddMsie(new MsieSettings
{
EngineMode = JsEngineMode.ChakraIeJsRt
})
.AddNiL()
.AddV8()
.AddVroom()
;
engineSwitcher.DefaultEngineName = ChakraCoreJsEngine.EngineName;
}
}
}
For Further clarification, Check this link github
I am using SikuliCSharp package v1.1.2 in Visual Studio 2015
I am trying to do following:
using (var session = Sikuli.CreateSession())
{
var pattern = Patterns.FromFile(#"C:\pathtoimage\image.png");
var value = session.Click(pattern);
}
But while running i get an exception:
An unhandled exception of type 'SikuliSharp.SikuliFindFailedException' occurred in SikuliSharp.dll.
Additional information: [error] Image: Image not valid, but TextSearch is switched off!
How to resolve this problem?
It should work if you delete var value = in front of session.Click(pattern);
In Windows Forms I can create a class file called 'Authentication.cs' with the following code:
public class Authentication
{
public string Name;
internal bool Authenticate()
{
bool i = false;
if (Name == "Jason")
{
i = true;
}
return i;
}
}
In WebMatrix, I can insert a new Class file, called 'Authentication.cs', and insert the above code.
And in my default.cshtml file, I do this:
<body>
#{
Authentication auth = new Authentication();
if(auth.Authenticated("jasonp"))
{
<p>#auth.Authenticated("jasonp");</p>
}
}
</body>
But it won't work! It works for the WinForms desktop app, but not in WebMatrix. I don't know why it's not working. The error message is:
"The namespace Authenticate does not
exist. Are you sure you have
referenced assemblies etc?"
So, then at the top of my default.cshtml file I tried this:
#using Authentication.cs;
Which led to the exact same error!
There's no documentation that I can find anywhere that tells you how to "include" a class file into your WebMatrix pages.
Any help is appreciated,
Thank you!
You import a namespace, not a file. So; what namespace is Authentication in? For example:
#using My.Utils.Authentication.cs;
Also - you want to drop the ; in the razor call:
<p>#auth.Authenticated("jasonp")</p>
You can also provide the fully qualified name in the code:
#{
var auth = new My.Utils.Authentication();
if(auth.Authenticated("jasonp"))
{
<p>#auth.Authenticated("jasonp")</p>
}
}
(aside: are you intentionally calling the same method twice with the same values?)
Just drop the cs file in you App_Code directory
then do something like this
#{
Authentication auth = new Authentication();
if(auth.Authenticated("jasonp"))
{
<p>#auth.Authenticated("jasonp");</p>
}
}
No need to add a using.
Additionally if you wanted to use a .dll then you would need the using
#using NameSpace.Authenication
#{
Authenticated auth = new Authenicated();
}
#if(#auth.Authenticated("jasonp"))
{
<p>#auth.Authenticated("jasonp")</p>
}
Create a file named linkRef.cs
code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
public class linkRef
{
public linkRef() {
//
// TODO: Add constructor logic here
//
}
}
Put it in a folder App_code then by dot net 2012 publish to bin then upload bin folder