Questions tagged [csx]

For questions about Azure Functions C# scripts, previously known as C# script. For questions about C#, see the C# tag.

This tag is for questions about Azure Functions C# scripts.

Useful resources:

48 questions
2
votes
0 answers

does "dotnet script" (csx) support ASP.NET Core app development?

I am checking out "dotnet script" (csx) available here: https://github.com/filipw/dotnet-script I am able to get basic examples working fine. However, I am trying to check the possibility of ASP.NET Core using "dotnet script" (just using plain…
user203687
  • 6,875
  • 12
  • 53
  • 85
2
votes
1 answer

Do we pay for compilation time for .csx files used on Azure Functions?

I am currently learning for new Microsoft certification and this snippet from Azure Functions documentation caught my attention (link): The Azure Functions Tools provides the following benefits: Edit, build, and run functions on your local…
mmokrzycki
  • 70
  • 6
2
votes
2 answers

CSharp scripting, is it possible to return a value from a script run with csi.exe?

I'd like to create a script like this: static int Main(string[] args) { if ( !File.Exists( @"E:\Ivara\Cache\TimeCacheLastUpdated.txt" ) ) { return -1; } return 6; } And run it like this and get the error level: "C:\Program…
Derek
  • 7,615
  • 5
  • 33
  • 58
2
votes
1 answer

How to get the path to the .csx script being executed?

When executing a C# script (.csx) with C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\csi.exe, how do I get the path to the script being executed? The line Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory); prints the path to the…
chtenb
  • 14,924
  • 14
  • 78
  • 116
2
votes
1 answer

Using the PromtDialog.Text just shows the text and not a textarea?

Ì'am trying to create a promptDialog were the user inputs some text. Documentation for PromptDialog Code: PromptDialog.Text( context, ResumeAfterAnswerAsync, "What is your name?", null, 5); When…
Moddaman
  • 2,538
  • 3
  • 23
  • 41
2
votes
2 answers

C# Azure Function in Dll doesn't work in Azure (but in emulator)

Because I want an Azure Function totally compiled before deploying, and because I want to have all the benefits of refactorings (automatic renamings) before deploying, I want to get rid of the Csx file and use a Dll. And I want all my code to be in…
Emmanuel DURIN
  • 4,803
  • 2
  • 28
  • 53
2
votes
2 answers

How to create csx file in Visual Studio?

I'm using Visual Studio 2015 Update 2. According to csi.exe there are such things as 'C# script files': Executes script-file.csx if specified Is there are documentation for this format? How can I create them in Visual Studio? > csi.exe…
Colonel Panic
  • 132,665
  • 89
  • 401
  • 465
1
vote
1 answer

What's the difference between .cs with top-level statements and .csx programs?

As mentioned, I was wondering what is the difference between C# program with only top-level statements and no namespace nor main class and a csx script. I'm using dotnet-script right now and it behaves the same for both .cs and .csx and I'm a bit…
Barstok
  • 49
  • 6
1
vote
1 answer

What's the best way to load a CSX script from a C# application?

Tools like dotnet-script and CSI allow users to write, compile, and run C# like "scripts" rather than including their code in a complete pre-compiled project. These tools work great for command-line usage, but don't offer much in terms of…
Sam Weaver
  • 1,027
  • 16
  • 30
1
vote
0 answers

.csx Files: Combine all using statements and #r into one file

I have .csx files that has a lot of using statements and #r statements, but each of these files have the same using and #r statements. Is there a way to abstract this? Like having a file reference.csx or some other file extensions that can be used…
Kezin99
  • 41
  • 2
1
vote
1 answer

How to use System.Runtime.Caching in an Azure Function App

I want to use simple in-memory caching of some values between function calls in a serverless function in an Azure Function App. I am developing directly in the Azure portal using C# script files. Following the suggestion 2) from this blog post by…
Marcel
  • 15,039
  • 20
  • 92
  • 150
1
vote
1 answer

How to prevent code changes to Azure Function script (.csx)

Is there a way to lock, or make .csx functions read-only? I have been developing against the Azure Functions platform for a number of years, and have always developed them in a classic "Project" style assembly, deployed the project to a stage…
Aaron Hudon
  • 5,280
  • 4
  • 53
  • 60
1
vote
1 answer

How to reference Cosmos table API from within azure function?

I'm trying to compile a project I've written in C# script, in the azure portal(can't get any other environment to work). I'm trying to reference the cosmos table API within my function: #r "Newtonsoft.Json" #r "Microsoft.WindowsAzure.Storage" #r…
Calvin Bootsman
  • 157
  • 1
  • 9
1
vote
1 answer

How to add reference to all DLLs in folder in Blob Triggered Azure Function V 1.x?

I have created Blob Triggered Azure Function. I have added some DLLs in a folder named "ExternalAssemblies". If I have 3 DLLs in that folder I have to reference them with following lines at the top of my function: #r…
Yash
  • 356
  • 1
  • 5
  • 22
1
vote
2 answers

NuGet Packages do not compile Azure CSX

I have included a NuGet Package in an Azure Function app that I downloaded to work on in Visual Studio. I have added it to the project.json and I still get "error CS0246: The type or namespace name 'NetTopologySuite' could not be found (are you…
Geobility
  • 178
  • 1
  • 8