mscorlib

C# compiler: /nostdlib option

て烟熏妆下的殇ゞ 提交于 2019-12-05 04:33:47
How is this possible not to include stdlib (mscorlib.dll) to my C# application when compiling it? As far as I know, all classes inherit System.Object class, which is defined in mscorlib.dll. What is more - types such as int are just aliases e.g. for System.Int32, which are also defined in mscorlib. Is this option ever used? Yes, it is used by anybody that compiles a program that doesn't run with the desktop version of the CLR. Like Silverlight, it targets .NETCore, or the Micro Framework. They have their own mscorlib.dll, of course with System.Object defined. Here's the compiler command line

Force Microsoft Build Tools 2015 to include mscorlib for the targeted version of the framework instead of 4.6

折月煮酒 提交于 2019-12-05 00:51:34
问题 I have written an application in Visual Studio 2015 that uses C# 6.0 features and targets .NET 4.5.2. When I build it using Microsoft Build Tools 2015, which is what is done by our TeamCity server, the resulting bin folder also contains a copy of mscorlib.dll . The problem here is that the mscorlib.dll being copied is the .NET 4.6 DLL, which causes problems at runtime. I have replaced my call to string.Format() with the new string interpolation syntax to work around the problem. That, however

Using system types in XAML as resources

爱⌒轻易说出口 提交于 2019-12-04 22:37:19
I have encountered a situation where it would be very useful to specify a floating point value directly in XAML and use it as a resource for several of my UI pieces. After searching around I found a good amount of information on how to include the proper assembly (mscorlib) in your XAML so you can do just that. Unfortunately, I am getting an exception in one instance where I try to do this. Here is the following XAML that recreates the situation: <Window x:Class="davidtestapp.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com

A first chance exception occurred… and I don't know why

ぐ巨炮叔叔 提交于 2019-12-04 20:53:38
Whenever I try to debug my Windows Phone 7 C# app, I get the following message in the Output window: A first chance exception of type 'System.OverflowException' occurred in mscorlib.dll A first chance exception of type 'System.OverflowException' occurred in mscorlib.dll A first chance exception of type 'System.InvalidOperationException' occurred in Microsoft.Phone.dll ...And then, App.xaml.cs opens up in VS (still in debug mode, where I can't edit anything), and "System.Diagnostics.Debugger.Break();" is highlighted. Why is this happening, how can I fix it, and how can I prevent it in the

Is mscorlib.dll a CLR?

眉间皱痕 提交于 2019-12-04 13:16:31
问题 If it's not which I almost sure in, then what's the role of mscorlib.dll and where CLR is situated? 回答1: CLR is not in mscorlib.dll but in MSCorEE.dll . I think that is what you were looking for. This is the main DLL loaded when an .NET exe assembly gets loaded. See this question which probably answers you question. 回答2: I believe this question covers most of what you're asking: mscorlib.dll & System.dll 回答3: mscorlib.dll is holding some fundamental classes of .net such as system. use

Is mscorlib.dll a CLR?

那年仲夏 提交于 2019-12-03 08:25:57
If it's not which I almost sure in, then what's the role of mscorlib.dll and where CLR is situated? Aliostad CLR is not in mscorlib.dll but in MSCorEE.dll . I think that is what you were looking for. This is the main DLL loaded when an .NET exe assembly gets loaded. See this question which probably answers you question. Kieren Johnstone I believe this question covers most of what you're asking: mscorlib.dll & System.dll mscorlib.dll is holding some fundamental classes of .net such as system. use reflector to what classes and namespaces mscorlib.dll is carrying. also your could find information

async await Task null reference exception

泪湿孤枕 提交于 2019-12-02 14:53:06
问题 I am getting NullReferenceExceptions on a webforms project I'm maintaining. The catch is that there is no stacktrace for this exception because none of my code causes the exception. Exception details copied to the clipboard offers zero assistance: System.NullReferenceException was unhandled Message: An unhandled exception of type 'System.NullReferenceException' occurred in mscorlib.dll Additional information: Object reference not set to an instance of an object. When I view the non-user code

async await Task null reference exception

折月煮酒 提交于 2019-12-02 08:27:08
I am getting NullReferenceExceptions on a webforms project I'm maintaining. The catch is that there is no stacktrace for this exception because none of my code causes the exception. Exception details copied to the clipboard offers zero assistance: System.NullReferenceException was unhandled Message: An unhandled exception of type 'System.NullReferenceException' occurred in mscorlib.dll Additional information: Object reference not set to an instance of an object. When I view the non-user code stacktrace, I see the following (all in mscorlib): The error occurs randomly and inconsistently, either

Mono take mscorlib.dll 2.0 instead of 4.0

风格不统一 提交于 2019-12-01 06:30:18
问题 I am having a problem with an MONO application, I'm trying to compile the project (with MonoDevelop) so as to load the library run mscorlib.dll 4.0 instead of version 2.0. (I need System.Type.op_Equality method that is in version 4.0 but not in 2.0). I've temporarily solved by making a link: # cd /usr/lib/mono/2.0 # mv mscorlib.dll mscorlib.dll.bak # ln ../4.0/mscorlib.dll mscorlib.dll But of course this is not a valid solution. Does anyone know how to MONO load mscorlib 4.0 instead of 2.0?

The assembly mscorlib.dll was not found or could not be loaded

房东的猫 提交于 2019-12-01 00:26:59
Firstly, I've seen this question , and while the problem seems similar, it is not the same. I'm running a trimmed down mono, built without the 4.5 profile using ./configure --with-profile4=yes --with-profile4_5=no . I have an application that targets .NET 4.0, built using mono's xbuild . When I run it against my trimmed down mono installation, I get this error: The assembly mscorlib.dll was not found or could not be loaded. It should have been installed in the `/opt/my-app/mono/lib/mono/4.5/mscorlib.dll' directory. Now, I'm not referencing only 4.0 assemblies - nothing from 4.5, AFAICS. Why