Hangfire shared dashboard - hangfire

.Net Core 2.2
Hangfire.Core 1.6.22
Hangfire.SqlServer 1.6.22
Hangfire 1.6.22
I have created a sample proof of concept for using Hangfire for multiple applications (2 console applications) but with a shared database and dashboard (a separate web app). It works wonderfully except that the dashboard shows either "could not load file or assembly" or "Can not find the target method" on the list of succeeded jobs.
Everything succeeds so that is good, but the dashboard is unable to display the name/description of the job without having a reference to the application dll where the job method is.
Is there a way to specify the job name/description instead of requiring the dashboard to have a reference to the application dll just to retrieve this name/description? I tried using the DisplayName attribute but that doesn't work either. If I reference the application project from the dashboard project then it works OK, but I really do not want to have to reference every project from the dashboard project just to populate this description.

Related

WCF in webjob returns list of records to webapp

Is this possible to put WCF in webjob that will return list of records to webapp.Actually I have project that returns search results (searching is done via lucene.net). Is there any guide or way to get results in my webapp from webjob?
Also can anyone guide me on my localhost I am running my webapp and web job is part of same solution. When I run web application, main function of WebJob is not hitting. Web app and web job can run simultaneously? If these are not runs simultaneously then How can I invoke my searching project initially ? How can my web project relate with my web jobs? I know about invoking by queue but some functions should be run initially when web application is started.
I want to test this behavior on my localhost
Is this possible to put WCF in webjob that will return list of records to webapp.Actually I have project that returns search results (searching is done via lucene.net). Is there any guide or way to get results in my webapp from webjob?
As I known, Azure WebJobs provide you with an easy way to run scripts or programs as background process in the context of your Azure Web Apps. You could not get results directly from WebJobs in your Web Application, you need to store your results in a central data center (Azure Queue, Table Storage,Service Bus,etc.), then you need to retrieve the data explicitly in your Web App. Here is a official tutorial about web application working with Azure WebJob.
Also can anyone guide me on my localhost I am running my webapp and web job is part of same solution. When I run web application, main function of WebJob is not hitting. Web app and web job can run simultaneously?
You could right click your solution and select Properties, choose Startup Project under Common Properties, choose Multiple startup projects and configure the Action for your web application and your WebJob. For more details, you could refer to this issue.
UPDATE:

When deploying mvc project with web reference in class library I see blank page

Hello I've got a mvc4 project with a web reference in a class library (Total two projects in my soluition).
SO what I've done so far to publish this project to my Windoiws 2008 r2 SERVER:
I give right - click only on my mvc web project -> Publish -> As publish method I choose -> file system -> and I give the physical path of the folder where i want to publish.
Then in my Internet Informatiobn Services Manager - > i give new Site and I bind this site with the physical folder I've created
So my problem is that when I start the site I see just one blank page and nothing in it. So I have no clue for any excception.
Keep in mind that before trying to upload this project I've created one simple mvc project (without class library whith only one index action that returns simple view with hello world message) and I had no problem deploying that site. What may be the problem? THANK YOU SO MUCH IN ADVANCE. I'm stuch with this for two days.
1.check Application pool select ASP.NET v4.0 Classic then tray.

Multiple apps in umbraco with IApplicationEventHandler

I recently started refactoring my site resulting in the following situation. I have a separate project containing all the surface controllers, views etc for the frontend users. In this project there is also StartupEventHandler wich registers the interfaces, controllers etc using AutoFac. I started a second project file containing the controllers, etc for the backend users. This project also uses AutoFac in the startupeventhandler and registers practically the same iterfaces as both front end en backend share the same services amongst them.
Now when I start the site, the frontend looks good. But when going via the umbraco backend the views dont get rendered with an error "Parameterless constructors not found". When I rebuild and restart, the backend page gets rendered without errors, but now the frontend pages give me the same error. Until I restart the site.
My guess I has to do with AutoFac and two startup handlers. The handlers each reside in their own assembly and namespace ...web.client and ...web.admin.
Anyone any clue on how to resolve this. I dont think it has to do with Umbraco as there are plenty of plugins which probably have also their own startup handlers.
I think I have found a proper solution. As I told in my question I had a separate project productname.customername.web.client and productname.customername.web.admin. What I have done is taking all the start up event logic out of those projects, created a new project productname.customername.web and put in there. From there I added a reference to both client and admin project and registered the controllers. It works fine now.

WebService Within a Web Application

I have this project developed by some goofball who decided to nest a dependent WebService within the Web Application that uses it. This has caused problems with publishing changes because you can't update the WebService without Publishing your changes first, and you can't Publish the changes without the WebService being updated at the publishing location. It's totally paradoxical.
Any suggestions on how to remedy this simply? I'm thinking it might be best to somehow extract the WebService out into a separate project which can be published independently (this is best practice after all, isn't it?). Also note that I have updated the project to .NET 4 which has the option to use a WCF Service instead, however if this would require a major reworking of the project, then I would like to keep things as simple as possible.
It's difficult to provide any code to illustrate this problem, but here is the basic hierarchy of the project.
Solution
Project
WebService
MyService 'This is a reference to the Web Service
Service
MyService.asmx 'This is the actual code for the Web Service
[Other Code Pages within the project]
EDIT: What if I did this? This way they could be compiled and published independently of each other.
Solution
Project - App
Web Reference
MyService 'This is a reference to the Web Service
[Other Code Pages within the project]
Project - Service
Service
MyService.asmx 'This is the actual code for the Web Service
The only remaining decision (assuming this is a recommended approach) would be whether to create a WCF Service Library or WCF Service Application? (Remember, this service is only used by this one app and is not shared by any other).
I would definitely extract the web service into a new project.
In addition, if there is other "shared" code (classes, modules) that is common between the projects, you have a couple of choices, depending on how much code needs to be shared:
1) Link the source files from one project or the other (so that you only have a single physical copy of the class)
2) Create a DLL project that each of the projects references and then move the shared code to that project.
3) (Obviously) Duplicate the code in each project.

Deploy SQL Server Reports Locally

i am very new to SQL server Reporting Services.I have developed reports in SQL Server Reporting.now Where do i deploy them in order to use them into my asp.net web application?
To include the report in your ASP.NET application, here you will need to use a custom control however, Microsoft does not provide a custom control like crystal report viewer custom control, in fact you will find it deployed in the samples directory of Reporting service. The custom control is located at
C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\Samples\Applications\ReportViewer
You can just go and open that project and compile it and use the ReportViewer DLL in your ASP.NET application. This can be done by opening your toolbox, then click Add/remove and click browse and select the ReportViewer.DLL I included the source and the DLL in the source in case you cannot find it or you didn't install the sample applications of reporting service. Anyway after selecting the DLL you have to select the custom control from the list.
You will find the name of the Custom Control ReportViewer "Microsoft Sample Report Viewer Application"
When you are done, just include the custom control in your ASP.NET page and change the following properties.
First you have to select the report path and this should be something
like :- My Reports/Report1 - exactly the sample folder you deployed
your reports in.
Second you have to edit the ServerURL and here you enter your
reporting service location http://localhost/reportserver/ this is the
reporting server location, while /reports is the report server web management so take care not to get mixed up.
Once both are done, you can start viewing your report by accessing your ASP.NET web page.
Now enter the location of your web application and choose the asp.net page that contains the custom control