csc

Why is csc.exe crashing when I last left the output encoding as UTF8?

时光总嘲笑我的痴心妄想 提交于 2019-12-18 08:48:58
问题 I am having am having or have run into a very strange thing. I wonder if others have and why it's happening. Having run a one line program with this line System.Console.WriteLine(System.Console.OutputEncoding.EncodingName); I see the Encoding is Western European (DOS) Fine Here is a list of some codepages 1200 Unicode and 65001 utf-8 and Windows-1252 Western European (Windows) and 850 Western European DOS from https://msdn.microsoft.com/en-us/library/system.text.encoding(v=vs.110).aspx Say I

Escape Catch-22 with extension attributes in .NET 2.0

好久不见. 提交于 2019-12-17 19:38:54
问题 How can a single .NET assembly, targeting 2.0, 3.0, 3.5, 4.0, and 4.5 concurrently, support extension methods for both C# and VB.NET consumers? The standard suggestion is to add this: namespace System.Runtime.CompilerServices { public sealed class ExtensionAttribute : Attribute { } } This the approach suggested by more than one Microsoft employee and was even featured in MSDN magazine. It's widely hailed by many bloggers as having 'no ill effects'. Oh, except it will cause a compiler error

Is it possible to install a C# compiler without Visual Studio?

时间秒杀一切 提交于 2019-12-17 07:09:21
问题 I want to build projects from the command line. Is it possible to deploy a C# compiler without installing Visual Studio? 回答1: Sure, the framework includes a compiler, csc.exe. Look at this article for a quick how-to. The important parts: You can get the command-line compiler (csc.exe) from Microsoft site http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx. Download the redistributable package of the .NET Framework, which includes the compiler and the .NET Framework with C# 2005 syntax

CodeDomProvider: where is the LIB environment variable located?

偶尔善良 提交于 2019-12-13 14:47:41
问题 I'm using a System.CodeDom.Compiler.CodeDomProvider.CreateProvider("CSharp") to compile C# classes on the fly. Recently I've switched from Visual Studio 2010 to Vistual Studio 2012. I also uninstalled SQL 2005. Since these events I've been unable to compile my classes due to the following error: Invalid search path 'C:\Program Files\SQLXML 4.0\bin\' specified in 'LIB environment variable' -- 'The system cannot find the path specified. Where is this "LIB environment variable" located? I've

VSTS - Xamarin iOS Build - How to choose the mono version to use?

被刻印的时光 ゝ 提交于 2019-12-11 23:19:06
问题 I'm building a Xamarin iOS project on the Hosted macOS Preview queue of VSTS. The log shows that it uses mono 5.8.0. However, the queue specs show that mono 5.10.0 is installed. The question is how can to choose the version of mono to use (amongst those installed) to build a xamarin ios project on vsts? UPDATE Itried the following after @valdetero's answer - task: XamariniOS@2 displayName: 'Building iOS' inputs: solutionFile: '**/*.sln' configuration: 'Release' mdtoolFile: '/Library

Compiling multiple files in a single directory separately with CSC

独自空忆成欢 提交于 2019-12-11 06:27:41
问题 I have multiple C# sources files (around 50) in a directory. What I want to do is to compile all of them separately, i.e. so that each of them should generate its own executable file. (Some of the files are one or 2 directories deep.) Currently what i am doing is csc *.cs /recurse:*.cs The problem here is that CSC tries to compile all of the files together and finds multiple instance of the method Main . I know this is the correct behavior but this it's not what I'm looking for. Is writing a

Command Line Compiler stops working in specific project

耗尽温柔 提交于 2019-12-11 02:51:57
问题 I got this strange error saying that the 'Command Line Compiler has stopped working' when I try to build the solution. The solution is 2 projects and a web MVC 4 Application. As I have no idea what it is, I'll depend on your inputs to know what information to share about the solution. Important: Any other projects I build dont show this error. Error Details (in portuguese): FIRST ERROR: Assinatura do problema: Nome do Evento de Problema: APPCRASH Assinatura do Problema 01: Csc.exe Assinatura

CS1703: In Xamarin.Droid, should I use the .Net Standard windowsruntime.dll located in Mono.Framework, or System.Runtime?

北城余情 提交于 2019-12-10 18:30:24
问题 I'm trying to build this Android Xamarin project, and am getting the compile time error: ./ResilientServices/ResilientServices.Droid/CSC: Error CS1703: Multiple assemblies with equivalent identity have been imported: ./ResilientServices/packages/System.Runtime.InteropServices.WindowsRuntime.4.0.1/lib/netstandard1.3/System.Runtime.InteropServices.WindowsRuntime.dll' and ./Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v1.0/Facades/System.Runtime.InteropServices

The specified task executable location …csc.exe is invalid error

白昼怎懂夜的黑 提交于 2019-12-10 15:59:25
问题 I have a project on TFS that is working on everyone else's machine, except mine. When building I get the error that can be seen in the image. "The specified task executable location csc.exe is invalid." currently trying to repair VS 2017 now. 回答1: Based on the message, seems the csc.exe is damaged. Just try below things to narrow down the issue: Navigate to the Microsoft.Net.Compilers package location, delete the package folder, then rebuild. Generally the package will be restored

Add compile parameter to csc command using Visual Studio IDE

只谈情不闲聊 提交于 2019-12-10 12:55:05
问题 The solution consists of two projects: main.csproj and helper.csproj . What Id'like to do is using dll which helper project will be complied into, as an embedded resource for main.dll . For that purposes it's seems resonable to add custom compile attribute for project main : /resource: <path to dll> . The problem is I can't find how to add this compile parameter through the Project Property. PS Maybe someone can suggest other solution to avoid making changes in compile process. 回答1: You