asp.net core 3 rotativa startup.cs env problem - asp.net-core-3.0

Im try to use Rotativa ım follow this guide
in start.cs in configure function ım add this code
RotativaConfiguration.Setup(env);
Severity Code Description Project File Line Suppression State
Error CS1503 Argument 1: cannot convert from 'Microsoft.AspNetCore.Hosting.IWebHostEnvironment' to 'Microsoft.AspNetCore.Hosting.IHostingEnvironment'
ım search this error and find this and convert my code like this
RotativaConfiguration.Setup(env.WebRootPath, "Rotativa");
and its give me this error
Severity Code Description Project File Line Suppression State
Error CS1503 Argument 1: cannot convert from 'string' to 'Microsoft.AspNetCore.Hosting.IHostingEnvironment'
ım add Rotative folder in wwwroot and added
wkhtmltoimage.exe, wkhtmltopdf.exe
my package version Rotativa.aspnetcore v1.1.1
ım using current asp.net core version 3.xx
what is problem any one can be explain me ?

Remove existing Rotativa.AspNetCore from Nuget packages then install the beta version:
Install-Package Rotativa.AspNetCore -Version 1.2.0-beta
This has the overload method in it that also works with IWebHostingEnvironment
After installing configure in Configure method as:
RotativaConfiguration.Setup(env.WebRootPath, "Rotativa");

Im find a solution like this in statup.cs in configure function add env2 and obsolute
[Obsolete]
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, Microsoft.AspNetCore.Hosting.IHostingEnvironment env2)
and change this like
RotativaConfiguration.Setup(env2);
its working now but ıts bad solution if you know better one pls describe it.
Works on versions 3.0 and 3.1
// Rotary configuration
// This is for the rotating to use the files in the Rotating folder
RotativaConfiguration.Setup (env.ContentRootPath, "Rotativa");

install
Install-Package Rotativa.AspNetCore -Version 1.2.0-beta
set Rotativa environment variable to
RotativaConfiguration.Setup(env.WebRootPath, "/usr/bin/");
If you are on Ubuntu 20.10 or 20.04 install wkhtmlpdf.
sudo apt install wkhtmlpdf
This works for Dot Net Core 3.1 or 5.0 I have tested both.

Related

'Building' has encountered a problem. An internal error occurred during. "Building"

I tried to create a Robot project , but I am getting this error : An internal error occurred during: "Building".
Unable to communicate with XML-RPC server
I tried some solution , but didn't work , and now when I press OK , I can't access to the libraries and the files inside the projects...enter image description here
My installation is:
Eclipse 2021-06 (4.20.0)
RED - Robot Editor 0.9.5.202007241017
Robot Framework 5.0 (Python 3.10.4 )
You need to check comparability of RED Editor and the Robot Framework. I think, RED doesn't support latest RF version. Check more: http://nokia.github.io/RED/help/whats_new/0_9_5.html
Also, check the URL that eclipse trying to communicate inside Help>>Available Software to update/install new software.
you need to downgrade the Robotframework to version 3 and lower, you can do that using that command
pip install robotframework==3.1.1 <version>

F#: Assembly reference RDotNet.dll was not found or is invalid

While trying to load the RProvider.fsx, I get a error that the Assembly reference RDotNet.dll was not found or is invalid
I'm following this walktrough: http://bluemountaincapital.github.io/FSharpRProvider/Statistics-QuickStart.html
Using Visual Studio 15 (I use the free community edition)
Create new F# console project: UseNuGetPackage (Exact steps NOT given)
Download and install R (Exact steps NOT given)
Install R Type provider
In Visual Studio using Solution Explorer
Right click F# project e.g. UseNuGetPackage
Select: Manage NuGet Packages for Solution
Click Browse
Enter: RProvider
Click check box on the left of Project
Click Install
Click OK
The Visual Studio output window shows:
Attempting to gather dependencies information for package 'RProvider.1.1.15' with respect to project 'UseNuGetPackage', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'RProvider.1.1.15' with DependencyBehavior 'Lowest'
Resolving actions to install package 'RProvider.1.1.15'
Resolved actions to install package 'RProvider.1.1.15'
Adding package 'DynamicInterop.0.7.4' to folder 'c:\users\eric\documents\visual studio 2015\Projects\UseNuGetPackage\packages'
Added package 'DynamicInterop.0.7.4' to folder 'c:\users\eric\documents\visual studio 2015\Projects\UseNuGetPackage\packages'
Added package 'DynamicInterop.0.7.4' to 'packages.config'
Successfully installed 'DynamicInterop 0.7.4' to UseNuGetPackage
Adding package 'R.NET.Community.1.6.4' to folder 'c:\users\eric\documents\visual studio 2015\Projects\UseNuGetPackage\packages'
Added package 'R.NET.Community.1.6.4' to folder 'c:\users\eric\documents\visual studio 2015\Projects\UseNuGetPackage\packages'
Added package 'R.NET.Community.1.6.4' to 'packages.config'
Successfully installed 'R.NET.Community 1.6.4' to UseNuGetPackage
Adding package 'R.NET.Community.FSharp.1.6.4' to folder 'c:\users\eric\documents\visual studio 2015\Projects\UseNuGetPackage\packages'
Added package 'R.NET.Community.FSharp.1.6.4' to folder 'c:\users\eric\documents\visual studio 2015\Projects\UseNuGetPackage\packages'
Added package 'R.NET.Community.FSharp.1.6.4' to 'packages.config'
Successfully installed 'R.NET.Community.FSharp 1.6.4' to UseNuGetPackage
Adding package 'RProvider.1.1.15' to folder 'c:\users\eric\documents\visual studio 2015\Projects\UseNuGetPackage\packages'
Added package 'RProvider.1.1.15' to folder 'c:\users\eric\documents\visual studio 2015\Projects\UseNuGetPackage\packages'
Added package 'RProvider.1.1.15' to 'packages.config'
Successfully installed 'RProvider 1.1.15' to UseNuGetPackage
========== Finished ==========
Notice in the image below the green check mark identifying that the package is installed.
Notice in the image below the new references for the project.
To get the following two statements to work we need to verify some paths.
#I "../packages/RProvider.1.0.11"
#load "RProvider.fsx"
The example given is specific to a version and as we know versions change so check the version of the DLL that will be used.
In the F# project
Right click the RProvider reference
Right click Properties
Here is the full path so you don't have to squint
c:\users\eric\documents\visual studio 2015\Projects\UseNuGetPackage\packages\RProvider.1.1.15\lib\net40\RProvider.dll
The example is using version RProvider.1.0.11 and we have RProvider.1.1.15
so we need to update the line from the example to
#I "../packages/RProvider.1.1.15"
If you look a lot of examples where you download a package from NuGet and then use it with F# Interactive you will see the same pattern to get it started.
#I "../packages/<Name_XYZ>.<Version>"
#load "<Name_XYZ>.fsx"
This is because this code assumes that you have used NuGet to install the needed DLLs in a VS project and that the DLLS are in a packages directory that is relative to the source code for the project. If you look back at the listing I gave for the output window you will see the copying of the DLLs.
Here they are shown in File Explorer
So how does F# Interactive know how to find the DLLs when it only has a relative path.
Now for the magical missing part that we leave out because it is a
conspiracy to test newbies. :-)
F# Interactive has the property __SOURCE_DIRECTORY__ that gives the location of the source directory in a VS project. This can be seen in F# Interactive with
printfn __SOURCE_DIRECTORY__
which for my example is
c:\users\eric\documents\visual studio 2015\Projects\UseNuGetPackage\UseNuGetPackage
val it : unit = ()
if you get a directory containing AppData then restart F# Interactive.
This can be checked with File Explorer
sure enough this is the source directory for the project.
More importantly the path from the source directory to the NuGet packages is
../packages
So all the paths look good.
Now that we have updated and checked the script lines to load the DLL give it a try.
We get the error:
error FS0082: Could not resolve this reference. Could not locate the assembly "RDotNet.FSharp.dll".
The problem is the specific versions mentioned in RProvider.fsx
// Standard NuGet locations for R.NET
#I "../R.NET.Community.1.5.16/lib/net40"
#I "../R.NET.Community.FSharp.0.1.9/lib/net40"
If we substitute out #load "RProvider.fsx" with
#r "../packages/R.NET.Community.1.6.4/lib/net40/RDotNet.dll"
#r "../packages/R.NET.Community.FSharp.1.6.4/lib/net40/RDotNet.FSharp.dll"
#r "../packages/RProvider.1.1.15/lib/net40/RProvider.dll"
#r "../packages/RProvider.1.1.15/lib/net40/RProvider.Runtime.dll"
open RProvider
do fsi.AddPrinter(fun (synexpr:RDotNet.SymbolicExpression) -> synexpr.Print())
open System
open RDotNet
open RProvider
open RProvider.graphics
open RProvider.stats
The example works. e.g.
// Random number generator
let rng = Random()
let rand () = rng.NextDouble()
// Generate fake X1 and X2
let X1s = [ for i in 0 .. 9 -> 10. * rand () ]
let X2s = [ for i in 0 .. 9 -> 5. * rand () ]
// Build Ys, following the "true" model
let Ys = [ for i in 0 .. 9 -> 5. + 3. * X1s.[i] - 2. * X2s.[i] + rand () ]
let dataset =
namedParams [
"Y", box Ys;
"X1", box X1s;
"X2", box X2s; ]
|> R.data_frame
let result = R.lm(formula = "Y~X1+X2", data = dataset)
let coefficients = result.AsList().["coefficients"].AsNumeric()
let residuals = result.AsList().["residuals"].AsNumeric()
let summary = R.summary(result)
summary.AsList().["r.squared"].AsNumeric()
R.plot result
Also as Tomas noted in his answer there is a bug with the version numbers in the fsx file, but he was able to update the source code and make a new alpha version.
:)
Hopefully I gave enough detail that the next time you see one of these examples on using a NuGet package with F# Interactive and have a problem you can resolve it.
There is a bug in RProvider.fsx where it references a wrong version of R.NET. The version 1.1.16-alpha has a fix for this, but we did not release a new non-beta yet.
Can you check that this works fine if you install 1.1.16-alpha?
The link of #GuyCoder helped me: How does F# Interactive #I command know about project path?
I searched the missing .dll files on my computer, and pasted in the parent folder of the source directory.
After this everything worked fine
#I "../packages/RProvider.1.1.15"
(*
#r "RDotNet.dll"
#r "RDotNet.FSharp.dll"
These 2 are unnecessary*)
#load "RProvider.fsx"
open System
open RDotNet
open RProvider
open RProvider.graphics
open RProvider.stats
EDIT:
I first downloaded the nuget packages Rdotnet & Rdotnet.Fsharp, then I searched on my computer for the dll's,
Then I copied these files and pasted it in the directory I was working in:
Which you also can find with __SOURCE_DIRECTORY__

activator or sbt start fails with Play 2.3

I was trying to launch the Play Framework 2.3.4 server on Windows 8 with avtivator start or sbt start, and run into following errors:
The input line is too long.
The syntax of the command is incorrect.
Because of the long CLASSPATH. But event with the newly created app I run into an error:
Bad application path: -Dhttp.port=9000
The first problem can be solved by adding following lines to the build.sbt:
import com.typesafe.sbt.packager.Keys._
scriptClasspath := Seq("*")
The second problem is a currently unresolved bug in sbt-native-packager for Windows. The workaround for me was to use sbt stage and then launch directly the generated bat file at
\target\universal\stage\bin\
well, I had the same problem about
Bad application path: -Dhttp.port=9009
So the way I solve it is by editing the Bat file. I manually add all the configuration parameters into the APP_MAIN_CLASS and before the "play.core.server.NettyServer"
something like:
set "APP_MAIN_CLASS= -DapplyEvolutions.default=true -Dhttp.port=9009 play.core.server.NettyServer"

Build Qt 5.2 for windows ce 6

I tried to build qt 5.2.1 (opensource.zip) on a Windows 7 64 bit machine with Visual Studio 2005 Professional while having ActivePerl etc. installed. I used the Visual Studio 2005 Command prompt with the following line for configure:
configure -platform win32-msvc2005 -xplatform wince60standard-armv4i-msvc2005 -opensource -nomake examples
which ends up in the following output after about 2 min.:
…
qglobal.cpp
qmalloc.cpp
qlibraryinfo.cpp
qnumeric.cpp
qlogging.cpp
D:\qt-source5.2.1\qtbase\src\corelib\global\qlogging.cpp(96) : error C3861: “GetConsoleWindow”: identifier not found.
Code will be generated…
NMAKE : fatal error U1077: ““C:\Program Files (x86)\Microsoft Visual Studio 8\VC\BIN\cl.EXE”“: return code “0×2”
Stop.
Building qmake failed, return code 2
I also tried to do just a simple:,
configure
within Visual Studio 2005 Command Prompt -> Ends up in the same error.
Does anybody know what wents wrong here? Am i doing something totally wrong or missing something?
I also posted this to the qt Forums of a thread created by a user who had a similar problem -> http://qt-project.org/forums/viewthread/36177/
But nobody replied there.
EDIT: Today i updated my question in QT forums. See -> http://qt-project.org/forums/viewthread/36177/ I modified the problem file qtbase\src\corelib\global\qlogging.h and added the following on top of it:
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0×0500
#endif
I found this solution while searching for “getConsoleWindow” problems. The reference is written down as remark here -> http://msdn.microsoft.com/en-us/library/windows/desktop/ms683175(v=vs.85).aspx
After this my configure runs fine without any problems. But now I expected the following error after calling nmake. After nmake runs ~30 mins i got this output:
d:\readonly\qtsrc\qtbase\include\qtcore\../../src/corelib/tools/qvector.h(666) : error
C2244: 'QVector<T>::erase' : unable to match function definition to an existing declaration definition 'QVector<T>::iterator QVector<T>::erase(QTypedArrayData<T>::iterator,QTypedArrayData<T>::iterator)'
existing declarations
'QTypedArrayData<T>::iterator QVector<T>::erase(QTypedArrayData<T>::iterator)'
'QTypedArrayData<T>::iterator QVector<T>::erase(QTypedArrayData<T>::iterator,QTypedArrayData<T>::iterator)'
There are some more errors but all with QVector::insert and QVector::erase. I Googled a bit and found this post here which looks like a similar problem and is also not replied yet: http://qt-project.org/forums/viewthread/36735
I think i have to say that i compile for custom ce sdk. So i changed the qtbase\mkspecs\wince60standard-armv4i-msvc2005\qmake.conf and added additional includes and libraries there. I also use the following defines there:
DEFINES += WINCE WINDOWS WINDOWS_CE_OS _WIN32_WCE=0×600 UNDER_CE=0×600 ARM _ARM ARMV4I UNICODE UNICODE _USE_32BIT_TIME_T _CRT_SECURE_NO_DEPRECATE $$CE_ARCH _AMRV7 armv7 ARM QT_NO_CLIPBOARD QT_NO_ACCESSIBILITY QT_NO_NATIVE_GESTURES QT_NOSTANDARDSHELL_UI_MODEL
Is it so hard to compile qt 5.2.1 for ce? Should i use an older version of qt (i need at least qt5 for JSON handling)? Any suggestions regarding this issue here?
Use thirdpaty library for JSON. Visual Studio 2005 is too old compiler. For example - jsoncpp or QJson.

Error Qt + Beagle bone + Deployment

I tried to deploy my application created on Qt, but i get this error when i deploy ...
/home/root/2_boutton_2_capture: error while loading shared libraries: libQtGuiE.so.4: cannot open shared object file: No such file or directory
Can someone help me to solve it
Thank you
The shared library libQtGuiE.so.4 is missing on the Beagle Bone.
If you're using Angstrom, you must install the libqtguie package on BeagleBone.
This is the solution
Just do what it is suggesting first:
opkg update
Then,
opkg install qt4-embedded --force-depends

Resources