LicenseService.cs not found - imageresizer

I have a purchased license to use ImageResizer.Sqlreader, I have it working on one section of my site already, and now I'm trying to get it working on a separate section of our site. On my AddImage page (on localhost), the debugger is barfing on a line of code that says:
ImageBuilder.Current.Build(file, ms, resizeCropSettings)
It throws me to an error that says "Source Not Found" and "LicenseService.cs not found". "You need to find LicenseService.cs to view the source for the current call stack frame."
I have the same ImageResizer NuGet packages installed in this project as I do in my already working project:
ImageResizer v4.0.5
ImageResizer.WebConfig v4.0.5
ImageResizer.Storage v4.0.5
ImageResizer.Sqlreader v4.0.5
Gist of diagnostics page
Usage context
Dim resizeCropSettings As New ResizeSettings("maxwidth=1600&maxheight=1600&format=jpg&autorotate=true")
Using ms As New MemoryStream()
' Resize the image
ImageBuilder.Current.Build(file, ms, resizeCropSettings) ' *** Fails to step through here
bytData = ms.ToArray()
End Using
Can you please advise? Thanks in advance.

The ImageResizer code in this question was working properly. The problem was due to an error in my code to save the Image item to the database (type mismatch). Setting the breakpoint as Nathanael suggested allowed me to debug past the "LicenseService.cs not found" error.

Related

Shopware 6.4.17.2 update results in maintenance mode

After upgrading in the backend by clicking on update button, I'm getting "Our website is currently undergoing maintenance." both on front- and backend. Deleted update-assets folder, nothing changed. When I go to mydomain/recovery/update/index.php I'm getting:
Slim Application Error
The application could not run because of the following error:
Details
Type: TypeError
Message: trim() expects parameter 1 to be string, bool given
File: .../shop/vendor/shopware/recovery/Update/src/DependencyInjection/Container.php
Line: 41
What can I do?
Delete {shopwareRoot}/files/backup/auto_update/dummy.
Then either retry the web updater or better try and update through shell which is recommended and more reliable.
I finally gave up and installed the shop new.
I had exactly the same problem and i found an evil solution: Simply change line 41 in File: .../shop/vendor/shopware/recovery/Update/src/DependencyInjection/Container.php
from
$version = trim(file_get_contents(UPDATE_ASSET_PATH . \DIRECTORY_SEPARATOR . 'version'));
to
$version = "6.4.18.0";
or whatever version you need.
Hope it helps

Webforms Error shows TWO projects although solution shows ONE project

In a VS-2019 webforms solution I get this error that shows TWO projects although the solution only has ONE project.
Severity: Error
Code Description : BC30456 'prpPageCaption' is not a member of 'MasterPage'.
Project: 7_SessionExpired.aspx, repo_TripManagement
File: C:\Users...\SessionExpired.aspx.vb
Line: 100
Suppression State: Active
It appears that the error shows TWO projects and I did not create a project named 7_SessionExpired.aspx
The vb-page "SessionExpired.aspx and .vb" was copied from a similar project in VS-2017. This is confusing to me and I don't have any way to know what this error is saying.
Here is the LINE=100 from the source VB file:
100| | Master.prpPageCaption = "Session has Expired"
Here is the property in the master-page:
Public Property prpPageCaption() As String
Get
Return Me.lblCaption.Text
End Get
Set(ByVal p_sCaption As String)
Me.lblCaption.Text = p_sCaption
Me.updpanelPageCaption.Update()
End Set
End Property
The vb-page "SessionExpired.aspx and .vb" was copied from a similar project in VS-2017. This is confusing to me and I don't have any way to know what this error is saying. I need your help. Thanks...John
Think the IDE/VS-2019 is confused and I cut ALL of the files for SessionExpired.aspx (.vb) and pasted them in a my-documents-folder.
I then added a webform-page with Master-page (WebForm1.aspx) into the project.
I then added the ASPX objects as UI for the page. I performed a "View Code" option and the / VB-code structure is shown. I only added "Option Explicit ON". Saved both modified files and closed the SOLUTION.
I then re-opened the solution and the code compiled -- even though the full VB-functionality was not coded.
From the 'Solution Explorer' I then renamed the WebForm1.aspx to "SessionExpired" and compiled again -- all ok.
Finally I added the VB-code from the saved-off original SessionExpired.vb code.
All of the errors shown above were cleared and things are working.
IMHO, bringing in an older webform brings with it the old-style of 'designer' and by starting with a VS-2019 webform-page conforms to the VS-2019 designer pattern.
I apologize to those that viewed this question.
Thanks. John.

Error with both blogdown:new_site() and New Project > website using blogdown

I am following "blogdown: Creating Websites with R Markdown" and unfortunately am stuck in Section 1.2. I created a new project in an empty folder, but get this error:
blogdown::new_site()
'C:\Users\rose89\AppData\Roaming\Hugo\hugo.exe" new site ".' is not recognized as an internal or external command, operable program or batch file.
Error in shell(cmd, mustWork = TRUE, intern = intern) :
'"C:\Users\rose89\AppData\Roaming\Hugo\hugo.exe" new site "." --force -f toml' execution failed with error code 1
I have tried removing and re-installing blogdown. When I try File > New Project > New Directory > website using blogdown, I get a popup error: R code execution error
I am using Windows, R studio 1.3.959 and R version 4.0.2. Here is some other info:
getwd()
1 "C:/Users/rose89/Documents/anothernewproject"
list.files('content', '.md$', full.names = TRUE, recursive = TRUE)
character(0)
I prefer to use the first approach in the console, but feel hopeless as I can't even get the "point and click" approach to work. If anyone has suggestions, I would greatly appreciate them! Thank you. Also this is my first post on StackOverflow and first time trying Blogdown, apologies if my question is not phrased clearly!
Update: I believe the error is due to my domain's "group policy" blocking hugo.exe (and other zipped .exe programs) on my Windows machine. I am working with my department's IT department to find a work-around.

Index was outside the bounds of the array in #Scripts.Render

For each controller have a folder (with the same name controler), and for each action a script file.
For each file is creating a bundle following the pattern: "~/Scripts/Controllers/{controller-name}/{filename-without-extension}"
bundles.IncludePerFile(new DirectoryInfo(server.MapPath("~/Scripts/Controllers")), "~/Scripts/Controllers/{0}/{1}",
(dir,file) => string.Format("~/Scripts/Controllers/{0}/{1}", dir, Path.GetFileNameWithoutExtension(file)), "*.js");
IncludePerFile is an extension method I created to perform this task
Then one bundle for: ~/Scripts/Controllers/processos/pasta should exist!
And to confirm this:
So far so correct! The bundle exists!
Running app
When I run the application, the following error occurs:
Full image
Wrongly and inefficient to repair the error:
If I change this:
#Scripts.Render("~/Scripts/Controllers/processos/pasta")
to this:
#Scripts.Render("~/Scripts/Controllers/processos/pasta.js")
No error is generated. But the file is not minified since there is effectively a bundle. (I have already put in release mode and published application!)
Full error
Index was outside the bounds of the array.
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: System.IndexOutOfRangeException: Index was outside the bounds of the array.
Source Error:
Line 3: #section js {
Line 4: #*#Scripts.Render("~/Scripts/Controllers/processos/Pasta.js", "~/Scripts/Controllers/processos/display.js")*#
Line 5: #Scripts.Render("~/Scripts/Controllers/processos/pasta")
Line 6: #Scripts.Render("~/Scripts/Controllers/processos/display.js")
Line 7:
Source File: w:\Clients\creditoimobiliariobb\sistema\src\CreditoImobiliarioBB\CreditoImobiliarioBB.Web\Views\processos\display.cshtml Line: 5
Stack Trace:
[IndexOutOfRangeException: Index was outside the bounds of the array.]
System.String.get_Chars(Int32 index) +0
Microsoft.Ajax.Utilities.CssParser.Append(Object obj, TokenType tokenType) +402
Microsoft.Ajax.Utilities.CssParser.AppendCurrent() +74
Microsoft.Ajax.Utilities.CssParser.SkipToClose() +744
Microsoft.Ajax.Utilities.CssParser.SkipToEndOfStatement() +232
Microsoft.Ajax.Utilities.CssParser.ParseRule() +574
Microsoft.Ajax.Utilities.CssParser.ParseStylesheet() +1235
Microsoft.Ajax.Utilities.CssParser.Parse(String source) +897
Microsoft.Ajax.Utilities.Minifier.MinifyStyleSheet(String source, CssSettings settings) +419
System.Web.Optimization.CssMinify.Process(BundleContext context, BundleResponse response) +302
System.Web.Optimization.Bundle.ApplyTransforms(BundleContext context, String bundleContent, IEnumerable`1 bundleFiles) +207
System.Web.Optimization.Bundle.GenerateBundleResponse(BundleContext context) +355
System.Web.Optimization.Bundle.GetBundleResponse(BundleContext context) +104
System.Web.Optimization.BundleResolver.GetBundleContents(String virtualPath) +254
System.Web.Optimization.AssetManager.EliminateDuplicatesAndResolveUrls(IEnumerable`1 refs) +435
System.Web.Optimization.AssetManager.DeterminePathsToRender(IEnumerable`1 assets) +1029
System.Web.Optimization.AssetManager.RenderExplicit(String tagFormat, String[] paths) +75
System.Web.Optimization.Scripts.RenderFormat(String tagFormat, String[] paths) +292
System.Web.Optimization.Scripts.Render(String[] paths) +51
I've had the same error in this question: StyleBundle Index was outside the bounds of the array
And answer is pretty simple: you have to update your Microsoft Web Optimization & WebGrease packages (at this time 1.1.2 & 1.6.0 versions)
I would verify that all the elements of your
IncludePerFile(new DirectoryInfo(server.MapPath("~/Scripts/Controllers")), "~/Scripts/Controllers/{0}/{1}",
(dir,file) => string.Format("~/Scripts/Controllers/{0}/{1}", dir, Path.GetFileNameWithoutExtension(file)), "*.js")
are putting in the created bundles exactly what you think they're putting in.
I got this error at run time when the wrong type of file is included within a bundle. i.e.
#Styles.Render("~/bundles/myStyleBundle");
actually contains a JavaScript file.
I had the same problem and when I tried different checking I found out that there is a selector in my css file like this that cause the problem:
.glyphicons-icon _:-o-prefocus,
.glyphicons-icon {
background-image: url(../images/glyphicons.png);
}
it seems that Microsoft.Ajax.Utilities.CssParser has a problem with _: css selector. I removed the line and it's working.
I just ran into a similar problem. I am using VS 2013 and MVC 5 and was updating to Bootstrap v3.0.1 in order to use a theme from Bootswatch. I updated everything using the latest Bootstrap download and the site seemed to work fine. I then grabbed the CSS for Slate from the Bootswatch site and used it in the new stylesheet, changed it in the StyleBundle and built solution. When I ran it, I got the "Index was outside the bounds of the array" error. Switch back to bootstrap.css and it worked fine.
I then used NuGet Package Manager to update all my packages... I had just installed VS 2013 and not yet updated everything. Rebuilt the solution and wallah, it works great. So I would up vote the updating your packages answser.
You may need to update some of your nuget libraries. Try updating WebGrease
I'm using
#Scripts.Render()
For me it was an issue with the backtik in JS file.
Sample 1
let something = `some text
bla bla
`;
Above code thrown this exception
Index and length must refer to a location within the string.
Sample 2
let something = `some text
bla bla`;
Now it works well, so do not keep the closing backtik at the beginning new line ...

Filling in a pdf form with aspose

I am trying to use Aspose to set the values of fields in a pdf. This pdf works fine in ITextSharp. That is the main frustration I am experiencing.
Here's my code
string outputPdf = String.Format(#"C:\PDF\output\test{0:dd-MM-yyyy-HH-mm-ss}.pdf", DateTime.Now);
string inputPdf = #"C:\PDF\application.pdf";
Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(inputPdf, outputPdf);
form.FillField("MY_FIELD", "Test Value");
form.FlattenAllFields();
form.Save();
the line Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(inputPdf, outputPdf); is causing an error.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Here's the stacktrace
[NullReferenceException: Object reference not set to an instance of an object.]
Aspose.Pdf.EmbeddedFileCollection.( node, Hashtable hash) +57
Aspose.Pdf.EmbeddedFileCollection..ctor(Document document) +161
Aspose.Pdf.Document.() +58
Aspose.Pdf.Document.(Stream input, String password) +181
Aspose.Pdf.Facades.Form..ctor(String srcFileName, Stream destStream) +92
I posted on their forums and it appears Aspose.Pdf 6.0.0 has known bugs due to a project merge between Aspose.Pdf and Aspose.Pdf.Kit. I am unable to open a Document or access the form in 6.0.0, so I grabbed Aspose.Pdf.Kit 5.6.0 and I was able to make it work.
Aspose.Pdf.Kit.Form form = new Aspose.Pdf.Kit.Form(inputPdf, outputPdf);
form.FillField("MyField", "Some Value");
Hope that helps anyone else who tries to use their software. After I did that, everything works fine for my demo version.
Have you tried Aspose.Pdf for .NET 6.2.0? Our team is also reviewing the upcoming version 6.3.0 which will be published in a week. Please try the latest one. If you still find any such issue please report it along with the input PDF file in Aspose.Pdf forum so our team could help you resolve this issue.
Disclosure: I work as developer evangelist at Aspose.