I am coding in C# for Google Cloud Functions. They work fine, access GC Datastore, deploy fine in Google. Everything is fine.
My problem starts when I try to optimize, and a function A and function B want to access classes in a C class library.
It works fine for me in debugging, but when I deploy the code, Google Cloud Functions doesn't find the C project If I try to load the C project, it's not a console but a class library and so I don't have an entry point etc.
Could you guide me on what I'm misunderstanding? Basically, I want to have a common code library available.
Thanks in advance!
Related
So I have finished my application, everything works and it has been tested.... but what now? I am somewhat new to C# and I have never been in a position that I am in now.
I have a Windows server that is meant to constantly run this API, so how do I get this application out of VS? Normally I would just copy and .exe of the release build of my apps and run it like that, but that doesn't seem to work.
This sounds like a thing any C# dev should know but I can't find anything on the web, probably because "I am searching wrong", I would be really thankful I someone would show me where I can learn this part of development :D
EDIT: Thank you all for suggestions, I feel like I left out important information about the goals of my API. This API would run locally on my companies network, my employees have a good VPN on all of our devices and they are the only ones who would use the API anyways, so I felt like running it locally is the way to go for now.
You're looking for how to "Publish". This article https://www.c-sharpcorner.com/UploadFile/3d39b4/publish-and-host-Asp-Net-web-api/ will get you most of the way I'd say.
In a (really) rough summary:
Publish your code which will create the files you need a "publish" folder in the source project
Set up a site in IIS on the server (I guess you might need to set up a database too)
Copy the files to the server and make any changes you need to appsettings.json for things like db connection strings.
There are a lot of things that go into this, but with just the information you have given so far, I would suggest reading this article on publishing your API to your server.
The main issue with deployment is:
Will you do API versioning?
How you will maintain the code?
What happens when you change the code e.g. fix a bug or add a new features?
What happens when the new code does not work and you deploy it accidentally, how do you rollback it?
What kind of shutdown time is allowed?
Do you need continuous integration?
Do you need docker?
Do you need cloud?
etc...
People usually write automated deploy code nowadays, so it is not as simple as just running the code on an IIS server normally, though it depends on project size or how serious you and your bosses take it.
REST API versioning: https://www.xmatters.com/blog/blog-four-rest-api-versioning-strategies/
MsDeploy to IIS: https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/web-deployment-in-the-enterprise/deploying-web-packages https://dennistretyakov.com/setting-up-msdeploy-for-ci-cd-deployments-to-iis
CI servers: https://www.ahmetkucukoglu.com/en/how-to-publish-asp-net-core-application-by-using-jenkins https://www.alibabacloud.com/help/en/web-app-service/latest/08d871 https://octopus.com/docs/guides/deploy-aspnet-app/to-iis/using-octopus-onprem-teamcity-builtin
Cloud: https://learn.microsoft.com/en-us/azure/devops-project/azure-devops-project-aspnet-core
Some db versioning tools: https://www.liquibase.org/ http://dbdeploy.com/ https://flywaydb.org/
// question
I have an existing c# program that uses Microsoft .net's "remoting" SDK.
I want to send some data from a new iOS app to this c# program.
The existing c# program is huge (with existing clients) and I am not sure if rewriting the entire thing in asmx is a good idea.
I have looked at other online sources, they all say no, but some mentioned Xamarin (wfc server).
Xamarin.Forms Connection to Wcf Service from iOS
I don't mind converting to iOS app to Xamarin, but just want to get some expert opinion before going ahead.
I am also open to other options as well.
Thank you very much for you help.
// what I have tried
I have looked at various stack-overflow posts & online sources and tried to use regular soap request instead, but I realized that this requires restructuring of entire c# codebase.
I would like to know if there is a smarter way to do this.
// update
I've tried Xamarin and it keeps crashing for some reason... when I try to use .dll reference.
I would like to know how can I access some web application from my personal project in C#?
To be specific, I would like to access this website https://dictation.io/
In my console app in VS record speech from my mic then pass it to that web app and then returns in my app result as e.g. string.
If someone could give an advice, it would be really fine (not looking for exact code)
Thank you!
Typically, accessing external resources (such as Dictation.io) would require an API. As they don't offer one, there's no (legal) way to use their speech-to-text.
Instead, you can build your own using Microsoft's own libraries and APIs. An example, and probably your best bet, would be https://msdn.microsoft.com/en-us/library/office/hh361683(v=office.14).aspx
Hi all I have already created some addons to SAP Business one in c#. Now what i want to do is that everytime I create a new function my addon should be able to automatically download it from a database server. What I plan is to include all these functions in a database table with columns such as (FuncName, EventType, EventForm, EventField, EventColumn, FuncCode). And there will be a globle function in my addon code which has several switch cases and so on... But how can I automatically create new function inside the source code by just reading these data from the table. Any proper guidance will be appreciated.
I'm an Intern in a software company. So I'm not that great with programming. Therefore please don't give the answers in a very complicated way :-D
********I understood that the above method is extremely difficult!!!
UPDATE: If this is a bad idea please suggest me a better way to do this. But consider that there are a lot of customers who gonna use this addon and they want to eassily download newly created functions to this addon
*** If someone alreday creadted AddOns to SAP B1 could advise me how they managed to provide updates to their Add-Ons while been registered under SAP B1 would help me a lot. Because I still couldn't solve this problem!!!
UPDATE: I already created my own updater function to a SAP Addon. In this updater function I replace the current exe file with new version's exe. And it works completely fine. But the problem occurs after registering this addOn in SAP. Because there are lot of check sums in SAP which makes the addon not working after I replace the old exe file. And I have no idea how to update my addOn without replacing the exe file. Any valuable suggestion would be highly appreciated.
This would be very hard to do, because the code has to be compiled. I would suggest you create an updater inside your application and use something like Jenkins.
Jenkins can build your application after every commit on a repository like github and then you can add logic to your software to pull the new binary (.exe) and install it as an update. Even better would be a library (.dll), then there would be no need for an installer. I hope I sent you in the right direction.
You'd do something like this:
Add your code to a repository system with a build server.
For example Github and Jenkins
Add an autoupdater function in your code
For example with the .NET Compact Framework
The way I solved this problem was by putting the new functions inside a dll file. And add it as a reference in the application. Finally I wrote an update function which replaces the current dll file if there's a new version available in the provided FTP server path. This way I didn't have to override the exe file and therefore it was not needed to worry about the checksum anymore.
Hello i'm working on a personal project. It is a web/text based game.
I'm planning on making my classes into DLL and exposing their methods in Web Service.
I'm pretty sure this is possible. But can't find a good tutorial on how to start with this.
So far, i know how to make DLL, I know how to create Web Service. But can anyone help me with exposing my DLL thru Web Service?
Create the web service (e.g. using C#)
Add references to your .dll (e.g. using PInvoke)
Voila. You've just "exposed your .dll through a web service".
Here's a link describing how to call unmanaged code in a .dll from C#. You can find many other, similar references on the web. The mechanism is the same, regardless if the C# code is for a Windows form, a console app ... or a web service:
http://blogs.msdn.com/b/jonathanswift/archive/2006/10/02/780637.aspx