Unable to call CudafyTranslator.Cudafy from Web API - asp.net-web-api

I'm trying to use CUDAfy.NET in a web application which will be further called from a web form.
When it tries to initiate a CudafyModule it gives the error as shown in pic below:
Code was working perfectly in console application.
Is there anyway to get rid of this problem?

It seems like your web application is unable to talk to the hardware. There is a great deal of abstraction and security in between the IIS and your .NET based assembly. It probably an issue of translation. Depends on how your web application is configured.
There can be several reasons for a process being unable to find the dll.
Try registering the dll in GAC. Or edit your web.config and add a reference to the dll's path
This might resolve the issue.

Related

How to config Service and UI view

Reference to my previous question: Can't compile the project. Missing so many files
I am very new to .NET core version. So I have so a few questions need someone to guide me to a quick start.
There are 2 templates version for ASP.NET core 2.0; .NET core and .NET full. Does it mean if I choose the .NET full version, I still can use 3rd party DLL such as iTextSharp or EPPlus version, doesn't it? 'Cause I have read that with .NET core, all 3rd party DLL without .NET core support could not be used in the project.
From the download template, it contains 2 main projects, one is .NET core service and another is angular UI view. Currently, it set to localhost for all API calls. Because I run the window server in my VM and run the client on my host so I need to set the client to look for the service on my VM via IP address. Which file do I need to config?
Related to Q2, how to config the .NET service to run in production mode and install into IIS server?
Thx in advance for all comments and suggestions.
Answer to the second question;
There's a config file in src/assets/appconfig.json
You can change those values...
remoteServiceBaseUrl: Used to configure base address of the server
side APIs. Default value: http://localhost:22742
appBaseUrl: Used
to configure base address of the client application. Default value:
http://localhost:4200
appBaseUrl is configured since we use it to define format of our URL. If we want to use tenancy name as subdomain for a multi-tenant application then we can define appBaseUrl as
Aspnet Zero Angular Getting Started
PS: Apart from the framework configuration; be aware that connecting something in VM is another discussion. You need to set some settings like Bridged Networking... You can figure it out in the related VM's board.
For point 1 you can refer this post.
For Point 2: You can host your service application on Azure or IIS so
that you can consume your service from other PC.
For Point 3, Its pretty well explained here.
Additional: If you want to deploy Angular application, you can refer Deployment of Angular Application
You can also refer src/assets/appconfig.json for required configurations.

OWIN Authentication Failing - Web API

I have some Web API applications that uses OWIN for authentication. Currently they are hooked up to Google and Facebook. I have them installed in multiple environments (local, dev, test, etc). Recently ALL of my applications in my development environment started failing. When trying to authenticate I would get a response back "access_denied". The URL would look like this:
https://{mydevserver}/{mywebapiapp}/#error=access_denied
The same code base works locally as well as in my test environment.
I tried using the same project (just adding redirect uris and orgins) as well as creating a new project.
I also updated my test environment to use the dev project (id and secret).
Nothing seems to have changed on the server recently. But it seems to be environment specific (because multiple applications are affected as well as multiple providers).
Are there any logging techniques I can use to drill down to a more detailed error message? Any tips or hints for what to try next?
The fix was a bit of an odd one. I had to log into my server, open up a browser and connect to a web page (any page). After doing so it started working again.

Cannot Access Business Rules in my Dynamics CRM Dev Environment

I'm having difficulties in creating / updating business rules. Every time I'm trying to create new Business Rules or Edit the Existing business rules. I'm getting an error without a error code. basically it's not letting me to look or create the business rules and sometimes even the processes(workflows) also.
I'm working on CRM 2016 on-premise (version-8.0.0.1088),I'm having a system Administrator's role. It's really tough to troubleshoot and find a solution for this issue has been struggling for a while with the issue.
I've imported an unmanaged solution recently. It's very annoying, spent a lot of time in researching but still no use, any help much appreciated!.
Error Log Details: (from Trace)
TargetInvocationException: Exception has been thrown by the target of an >invocation. ---> System.IO.FileNotFoundException: Could not load file or >assembly 'log4net, Version=1.2.15.0, Culture=neutral, >PublicKeyToken=669e0ddf0bb1aa2a' or one of its dependencies. The system cannot >find the file specified.
thanks to Federico Jousset who have promptly responded to my question. He has suggested me to enable the Trace log feature in CRM (on premise), which I wasn't aware of, and once done, it gave me reason why it was failing.
It looks like your custom dll deployed to dynamics crm is dependent on log4net, which is not found in server GAC/merged dll.

Chat implementation in windows form using SignalR

I am trying to implement chat application in windows form using SignalR. Actually I had created the web chat application using signalR now i want to synchronize it with windows application.
I am facing following problems
1) How to initialize the hub class as in web application we initialize it in javascript on page load. So how can we innitialize the hub and in web application there is global file to maphub for dynamically generating the signalr javascript so where in windows application can i map the hub to dynamically generate the same.
2) As i want to synchronize the windows application with the web application so do i need to keep both the projects under one solution or can i synchronize the two different solutions??
Please provide the startup code for the first problem as i have searched alot but not getting any way to implement the chat in windows form. the code i found on net just raising errors but helping me in any sense.
This is a full working sample for using SignalR in WinForms and WPF
You can download it and play with it.
There is a WinForms Server and Client which can be your starting point.
It is a good idea to keep the projects under one solution, but its up to you. The WinForms projects will need a server URL where they can communicate with each other (you can see this in the sample code from the above link)

how to reference dll in GAC in a remote machine in 3 tier structure

I have a 3 tier structure in my office and my dll (in GAC) in business tier is already installed in my business component server .
Method 1: Remote GAC
I'm trying to build a light-weight application and the application will reference the dll in the remote business tier server, but I don't know how.
Method 2: old way DCOM or COM+
But I do find an old way by using DCOM (no more GAC).
http://www.kepware.com/Support_Center/SupportDocuments/DCOM_Secure_by_default.pdf
It seems relatively achievable, but after i follow the steps, I always get some security alert, such as no access.
Method 3: Web Service, too slow!
I do not want to use web service because I need fast access within LAN. web service is just too slow as it has to go through IIS.
Method 4: .NET remoting using TCP
This method seems to be faster than web service, but it seems to have a lot of overhead.
I don't mind use old technology as long as it works.
GAC make my dll more secure as it cannot be copied and used by other unauthorized people, so it is preferred.
Please advise.
I research quite some articles and it seems in order to have most of the benefit included(version control, security, convenience, pooling etc.), then
the best way is to GAC the dll in remote machine and then use Regsvcs to register the dll as COM+ service.
some people don't want so much trouble as convenience is their top priority (fast deploy, security, version control are not that essential) then they suggest I can just XCopy the dll to remote server and then just Regsvcs it.

Resources