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
92
votes
4 answers

What are .CSX C# files for?

I've heard of .cs files but never of .csx files. Google searches led me to CSX corporation and other unwanted bodies. Can someone provide a terse description of what a CSX file is, and perhaps the main differences between CSX and CS?
Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607
17
votes
1 answer

How can I manually mark an invocation as Failure in an Azure Function?

I have tried many things but the only way I can force AzFn to understand the invocation has failed, is to throw an exception and not handle it. So, if I return an HttpResponseException, AzFn will consider the invocation as a success. That feels…
imbageek
  • 609
  • 5
  • 18
11
votes
4 answers

Launch a .csx (scriptcs) C# script directly without opening a command line window

Is there a way in Windows to launch a .csx script directly (e.g. by double clicking the file, or from the start menu, or via an app launcher like Launchy) such that the script runs in the background without opening a command line window? For…
ivanatpr
  • 1,862
  • 14
  • 18
10
votes
1 answer

How can I call function from one csx file to another csx file in Azure?

How can we create another run.csx and call the existing function from one csx file to another in an Azure Function App?
8
votes
4 answers

I need a CSharp script (.csx) runner, like csi.exe, for a build agent machine

I'm writing .csx build scripts. On my local machine I run them with CSharp interactive from visual studio or via C:\Program Files (x86)\MSBuild\14.0\bin\csi.exe. I've tried running .csx scripts on a TeamCity build agent machine (agent machines…
Ivan Koshelev
  • 3,830
  • 2
  • 30
  • 50
8
votes
2 answers

C# for scripting (csx) location of script file

In F# it's rather easy with predefined identifier __SOURCE_DIRECTORY__ https://stackoverflow.com/a/4861029/2583080 However this identifier does not work in C# scripting (csx files or C# Interactive). > __SOURCE_DIRECTORY__ (1,1): error CS0103: The…
Pawel Troka
  • 853
  • 2
  • 12
  • 33
7
votes
1 answer

Referencing a local csproj from a C# script

I've been experimenting with C# script (*.csx) to do some data processing with the results of service calls to some internal APIs. It's been pretty smooth thus far, but I'm now trying to call some methods from a C# project I have access to. The C#…
RAnderson
  • 180
  • 7
7
votes
1 answer

Intellisense for csx in VisualStudio 2015

I am new in programming cs scripts (csx files). But I have the problem that I do not have any intellisense. How can I get intellisense support in Visual Studio 2015 for it?
Sascha
  • 601
  • 1
  • 8
  • 23
5
votes
3 answers

Azure Functions Visual Studio 2015 intellisense

I'm playing around with Azure Functions but I've noticed VS 2015 doesn't provide intellisense for .csx files. Any idea how to fix this?
4
votes
1 answer

Why do I get System.NullReferenceException in my c# script while my executable of the same code is working?

I have the following .csx script: #r "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Management.dll" using System.Management; ManagementClass cls = new…
4
votes
0 answers

How to resolve dependency issues with C# script csx file in visual studio code?

I am trying to create an azure function program with a service bus queue trigger template using a csx file. But I am having issues resolving dependencies. To be honest, i am very confused about the project structure that is mentioned in [this doc]…
4
votes
2 answers

Type or NameSpace "BlobAttribute" Not Found

I am following along a Pluralsight Tutorial and it's a bit outdated, so I'm trying to fill in the gaps. It says to use a BlobAttribute to set the filename, but I keep getting an error saying that the type or namespace isn't found. I'm using CSX and…
Don Sartain
  • 557
  • 9
  • 25
3
votes
2 answers

The type or namespace name 'Bot' does not exist in the namespace 'Microsoft'?

Are other people having as much trouble with the Bot framework as I am? I'm just trying to follow the steps in Debug an Azure Bot Service bot so that I can edit and run my code locally and then push it up to the cloud. After a long struggle, I run…
PESMITH_MSFT
  • 350
  • 1
  • 9
3
votes
1 answer

Is it possible to execute a CSX during a VS2017 pre-build event?

I have several complex things to accomplish before a build can begin. Writing this in batch would be a nightmare. Writing these in CS would be lovely. I think CSX would be my most reasonable approach. But, is it possible? How do I invoke it? PS:…
Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233
3
votes
1 answer

Where to store application specific configuration properties in an Azure Functions app

I've inherited some code written for Azure Functions, and I know next to nothing about Azure Functions. Right now this code is written for our staging environment, and has things like hard coded URLs specific to our staging environment and various…
Mike Christensen
  • 88,082
  • 50
  • 208
  • 326
1
2 3 4