Menu
  • HOME
  • TAGS

Why are not all assemblies in GAC built as MSIL?

Tag: .net,gac,gac-32,gac-64,gac-msil

What is the reason that not all of the assemblies in the Global Assembly Cache (GAC) are built as MSIL? I see x86 and AMD64 architecture types used for some assemblies, as in the example below, but not for others:

C:\Windows\assembly\

enter image description here

Why is System.Data built for two different processor architectures, while System.Core is MSIL?

C:\Windows\Microsoft.NET\assembly

enter image description here

A similar pattern can be seen under the second version of GAC, shown above. Assemblies are split into different architectures, but not all of them are built into 32/64 versions -- some are just MSIL.

Best How To :

When you compile your library you can choose to target either "Any CPU" or a specific processor architecture.

The "Any CPU" libraries only need a single entry in the GAC and the entire assembly is compiled to MSIL.

Other assemblies need a different library for each architecture. These libraries are built for each CPU type and there are multiple copies in the GAC. The most common reason is to include unmanaged code or load a native dll which is architecture specific.

In your example System.Core is probably fully managed code whereas System.Data is probably built on top of a bunch of native windows libraries.

Applications running in 32bit mode will load the 32bit version of the library whereas applications running in 64bit mode will load the 64bit version.

Regex to remove `.` from a sub-string enclosed in square brackets

c#,.net,regex,string,replace

To remove all the dots present inside the square brackets. Regex.Replace(str, @"\.(?=[^\[\]]*\])", ""); DEMO To remove dot or ?. Regex.Replace(str, @"[.?](?=[^\[\]]*\])", ""); ...

Microsoft Band and WPF

.net,wpf,dll,microsoft-band,.net-core

The current Band SDK does not support Windows desktop (i.e. Win32) applications. It supports only Windows Store and Windows Phone (i.e. WinRT) applications. Portable libraries can be confusing as the terms '.NETCore' and 'netcore451' refer to the Windows Store version of the .NET framework....

Formatting large numbers in C#

c#,.net,unity3d,formatting

I am using this method in my project, you can use too. Maybe there is better way, I dont know. public void KMBMaker( Text txt, double num ) { if( num < 1000 ) { double numStr = num; txt.text = numStr.ToString() + ""; } else if( num < 1000000...

DialogBox with value verifications

c#,.net,winforms

The problem is you're trying to enable or disable the button when checking individual textboxes and they're conflicting with each other, instead the logic needs to be at a higher level. Change your textbox validation function to return a bool, and use that in ValidateAll to determine whether or not...

How does the Take() method work in LINQ

c#,.net,linq,entity-framework

See Return Or Skip Elements in a Sequence. Take(N) will add TOP N to your SQL and only retrieve N records. For example (using my own SQL Server 2014 with EF 6.1): This LINQ: var query = await dbContext.Lookup .Where(w => w.LookupCd == '1') .Take(10) .ToListAsync(); Generates this SQL: SELECT...

How can I determine if an object of anonymous type is empty?

c#,.net

Anonymous types do not provide operator overloads for ==, although it wouldn't matter in this case since one of the arguments is typed object. However the C# compiler does provide Equals, GetHashCode, and ToString implementations. Use the static object.Equals, method which will do the appropriate null checks and then call...

Move windows form from a picturebox in C#

c#,.net,winforms,picturebox

Refer this code: private bool draging = false; private Point pointClicked; private void pictureBox1_MouseMove(object sender, MouseEventArgs e) { if (draging) { Point pointMoveTo; pointMoveTo = this.PointToScreen(new Point(e.X, e.Y)); pointMoveTo.Offset(-pointClicked.X, -pointClicked.Y); this.Location = pointMoveTo; } } private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { draging = true;...

How does System.Data.SQLite deal with .NET Data Types?

.net,sqlite,system.data.sqlite

I suggest you start with the driver-agnostic SQLite documentation on the subject. It explains the way booleans should be stored, and the different datetime serialization schemes, for example. For more details, System.Data.SQLite is open source, and while a bit crufty around certain edges, is generally quite easy to read. For...

Does MongoDB successful insert guarantee populated ID's?

c#,.net,mongodb-csharp,mongodb-csharp-2.0

Yes. If the operation completed without errors you are guaranteed that the documents have an ID (either created by you before the operation or by the driver in the operation itself). Moreover, since the IDs are generated by the driver itself (client-side) before calling the MongoDB server there's a good...

ASP.NET MVC posting list from view to controller

c#,.net,asp.net-mvc,razor

That's probably a good candidate for an EditorTemplate to be honest, that way you don't have any issues with prefixing: @Html.EditorFor(m => m.TechnologyFilters) Without using an editor template though, a technique you can use is to specify the prefix in your partial declaration within the ViewDataDictionary, by doing: Html.RenderPartial("_TechnologyFilters", Model.TechnologyFilters,...

.NET use IIF to assign value to different variables

.net,vb.net,conditional,variable-assignment,iif

What you're asking to do would have been possible in a language that supports pointer types (such as C/C++, or C# in unsafe mode) with dereferencing; VB.NET doesn't do that. The best you got to leverage is local variables, reference types, and (perhaps) ByRef. If it's a Class, its instantiation...

How does convert.ToString(C0) behave?

c#,.net

You can brute force search the string for any currency symbols and change them to whatever character you want eg: string s = "$"; foreach (var c in s) { var category = CharUnicodeInfo.GetUnicodeCategory(c); if (category == UnicodeCategory.CurrencySymbol) { //Force convert the char to what every character you want }...

Unhandled exceptions and background workers

.net,exception-handling,backgroundworker

The other threads will carry on. Only the thread used by the BackgroundWorker will crash. An unhandled exception will be thrown. Since there is no exception handling in the event handler, it will get caught by the CLR as a last resort. This will not influence other threads....

WPF Navigation using MVVM

c#,.net,wpf,mvvm

The AncestorType should be MainWindow not MainViewModel. MainViewModel is not a class that is part of the visual tree.

Custom drawing using System.Windows.Forms.BorderStyle?

c#,.net,vb.net,winforms,custom-controls

If you want to get results that reliably look like the BorderStyles on the machine you should make use of the methods of the ControlPaint object. For testing let's do it ouside of a Paint event: Panel somePanel = panel1; using (Graphics G = somePanel.CreateGraphics()) { G.FillRectangle(SystemBrushes.Window, new Rectangle(11, 11,...

Foreign key not updating in entity frame work

c#,.net,entity-framework,foreign-keys

Base on Entity Framework does not update Foreign Key object I created public string ModifiedBy { get; set; } [DataMember] [ForeignKey("ModifiedBy")] public User ModifiedUser { get; set; } That means I additionally introduced a primitive type(string ModifiedBy ) for Modified User and specified ForeignKey. That resolved my issue...

inconsistent timing from .net StopWatch

c#,.net,timing,stopwatch,cudafy.net

As the TotalMilliseconds is constantly incrementing & you are trying to find differences between points in time, you need to subtract the sum of the preceding differences after the second one, hence : tIQR = watch.Elapsed.TotalMillisconds - (tHistogram + tHistogramSum); & tThresholdOnly= watch.Elapsed.TotalMillisconds - (tHistogram + tHistogramSum + tIQR); ...

Automapper AfterMap function initialising classes

.net,vb.net,automapper

The objects have values in them because they are called after Mapping.Map function is called and that's where actual object with values is passed and then AfterMap function is called and that's how it has the values in it.

Hashing speed - cryptic results (Hashing twice much slower than hashing once)

c#,.net,hash

Your results are most likely caused by disk caching. Assuming both tests operate on the same data, only the first read will result in significant I/O time. IE: Iteration 1, Test 1 : 30 seconds (= 20s disk read, 10s work). Iteration 1, Test 2 : 30 seconds (= 0s...

Catch concurrency exception in EF6 to change message to be more user friendly

c#,asp.net,.net,entity-framework,entity-framework-6

You are executing an asynchronous method. This means that any exceptions will be thrown when you call await on the returned task or when you try to retrieve the results using await myTask; You never do so, which means that the exception is thrown and caught higher up your call...

Web API - Set each thread with the HttpRequestMessage id?

c#,.net,multithreading,task-parallel-library,web-api

For context related problems, you can use CallContext.LogicalSetData and CallContext.LogicalGetData, which is merely an IDictionary<string, object> which flows between contexts, and has a copy-on-write (shallow copy) semantics. Since your data is immutable (according to the docs), you can map your correlation id to your threads managed thread id: protected async...

Listing directories by content size using C# [closed]

c#,.net,windows,linq

A small example here: class DirectorySize { public string DirectoryName; public long DirectorySizes; } public class Program { static void Main(string[] args) { string[] cDirectories = Directory.GetDirectories("C:\\"); List<DirectorySize> listSizes = new List<DirectorySize>(); for (int i = 0; i < cDirectories.Length; i++) { long size = GetDirectorySize(cDirectories[i]); if(size != -1) {...

Set default value for string prompt

c#,.net,autocad,autocad-plugin

I paste you some code as example for the different prompts : using System; using System.Collections.Generic; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Geometry; using Autodesk.AutoCAD.ApplicationServices; namespace EditorUtilities { /// <summary> /// Prompts with the active document ( MdiActiveDocument ) /// </summary> public class EditorHelper : IEditorHelper { private readonly Editor _editor; public EditorHelper(Document...

String Format: How to add any number of zeros before string

c#,.net

int num = 4; string a = num.ToString("D4"); Documentation...

XElement.Value is stripping XML tags from content

c#,.net,xml,xml-parsing,xelement

As others have said, this format is truly horrible, and will break as soon as the XML embedded in the JSON will contain double quotes (because in the JSON they will be encoded as \", which will make the XML invalid). The JSON should really be embedded as CDATA. Now,...

Consuming and exposing webservices in one project (.NET)

.net,web-services,rest,soap

If you are trying to enrich the data from one source and combine that with information from another source, I think this is a decent solution. I think it is better to have one single point to talk to (your REST service), than to have two in your application and...

How to send Ctrl+S through SendKeys.Send() method to save a file(save as dialog)

c#,.net,windows,sendkeys

I believe you need to use: SendKeys.SendWait("^(s)"); Instead of: SendKeys.SendWait("^%s?"); Have a look at https://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.send(v=vs.110).aspx for more information....

how can I add a column to IQueryable object and modify its values

c#,.net,linq,grid,devexpress

Simple example for using a non-anonymous class. public class MyLovelyClass { public Int32 Number { get; set; } public bool Selection { get; set; } } var packs = from r in new XPQuery<Roll>(session) select new MyLovelyClass() { Number = r.number }; gcPack.DataSource = packs; ...

Best approach to upgrade MVC3 web app to MVC5?

c#,.net,asp.net-mvc,asp.net-mvc-5

There's a handy documented guide by Rick Anderson which he wrote to upgrade from MVC4, the same applies to you with the exception of the fact that the "Old version" of DLLs he mentions will be different to the ones that you will have, but the outcome will still be...

Where to store an mp4 file in my project?

.net,vb.net,visual-studio,mp4

Try going Project>"Project Name" Properties>Resources>Add Resource>Add Existing File This should add the file into your resources folder. You can then access any file by going My.Resources.Name_Of_Resource...

Why when trying to upload a video file to youtube i'm getting InvalidCredentialsException?

c#,.net,youtube,youtube-api,google-client-login

ClientLogin (login and password) was deprecated as of April 20, 2012 and turned off on May 26 2015. This code will not longer work you need to switch to using Oauth2. I would like to also recomed you use the new Google client library Install-Package Google.Apis.YouTube.v3 ...

Programmatically accessing TFS history [closed]

c#,.net,powershell,tfs

Shai Raiten's Blog is great for learning the TFS API. For getting file history - read this post: http://blogs.microsoft.co.il/shair/2014/09/10/tfs-api-part-55-source-control-get-history/...

External Datepicker not working

javascript,jquery,.net

Apparently your Array has no map method, which is part of ECMA-262 edition 5 and which your JS engine seems not to support? You can implement Array.prototype.map manually by taking it from somewhere like https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/map.

How to set public bool value in C# code behind, read in .ascx User Control?

c#,.net

You could cast the Page property to the right type, the page property needs a getter. (somewhere in your ascx codebehind): MyPageType page = this.Page as MyPageType; if(page != null) { bool templateBGOption = page.TemplateBGOption; } But in this way you are hard-wiring the page with the UserControl. Instead the...

SpecFlow Ambiguity in bindings

c#,.net,bdd,specflow

As @perfectionist has pointed out your problem is with your regexes. One is consuming all of the chars for both. Try this instead: Feature: ConversionUnencrypted Pdf-Pdf @mytag Scenario Outline: ConversionUnencrypted Pdf-Pdf Given I get Inputs Folder and list of Files '<inputFolder>' then '<getInputTokens>' Given I get '<outputDirectory>' ... and the...

Is Serialization the same as GetBytes?

.net

No, GetBytes() just converts a string to its binary represenation using the asked encoding. So it does serialize, but it is very specific to strings. When you want to serialize any object to bytes, you could use the BinaryFormatter. More about how to serialize an object using the BinaryFormatter can...

Feature-specific compatibility of a .NET 4.5 application on a system with .NET 4.0

c#,.net,zipfile

The easiest way to do this is probably to load the required code dynamically. You could use reflection to look for the required assembly, class and members if .NET 4.5 is detected. You could cache the results in delegates, to avoid reflecting every time. You could also use a plug-in...

Dependency Injection for concrete .Net classes

c#,.net,dependency-injection,ninject

If TcpServer is sealed and implements no interfaces, but you still want to decouple a client from its particular implementation, you'll have to define an interface that the client can talk to, as well as an Adapter from TcpServer to the new interface. It can be tempting to extract an...

OpenXml.WordProcessing.Justification always comes as OpenXmlUnknownElement

.net,ms-office,openxml,openxml-sdk

You need to read the documentation. TableCellProperties doesn't take the a Justification element. Link If you are trying to align elements within a cell, you need to put it into ParagraphProperties....

I want to upload video on youtube using client side login. without open web page permission

c#,.net,google-api,youtube-api,google-api-dotnet-client

Your code is doing is doing everything correctly. The YouTube API doesn't allow for pure server authentication (Service Account). The only option available to you to upload files will be to use Oauth2 and authenticate your code the first time. I just sugest you make one small change add filedatastore....

How can i get list of my youtube videos from youtube?

c#,.net,winforms,youtube,youtube-api

You're trying to call a v2 URL (the one that starts with https://gdata), which no longer exists. Additionally, the location you got a developer key from is also deprecated; you won't use a "developer key," but the API key you get from console.developers.google.com -- NOT the client ID, though. You...

Unconstrained type parameters casting

c#,.net,types,casting

The compiler sees the T2 and T identifiers and helpfully informs you that those types seem unrelated. That's absolutely correct, as they have no relation: there are no generic constraints that would assert any relations between them (I'm not saying that would be useful here though :) ). Whether this...

Application is missing required files

c#,.net,windows,winforms,sharpdevelop

Your program is looking for compas.ico inside the build directory, while it probably resides in some other directory in your project.

MySQL database to combo box using mysqldatareader in c#.net [closed]

c#,mysql,sql,.net

Wow... Suppost your combox name is cbProducts, and you want fill it with the colum "description" of the query MySQL database to combo box using mysqldatareader in c#.net MySqlCommand cmd = new MySqlCommand("select * from product", connection); MySqlDataReader dread = cmd.ExecuteReader(); while (dread.Read()) { cbProducts.Items.Add(dread("description"); } ...

Serialize/Deserialize class containing byte array property into XML

c#,.net,xml,serialization,.net-4.0

As you've noticed, there are lots of characters that may not be present in an XML document. These can be included in your data, however, using the proper escape sequence. The default settings of the XmlTextReader cause it to mishandle this -- I think it interprets the escape sequences prematurely,...

Capturing group recursively inside non-capturing group?

.net,regex

The .net regex implementation gives the possibility to store the substrings of a repeated capture group. So with this pattern that describes the whole string: \A(?:(\d+(?:-\d+)?)(?:,|\z))+\z (where \A and \z stand for the start and the end of the string) you obtain all the values in capture group 1 with...

Related entity not loaded

c#,.net,entity-framework

Mark your relation property with virtual keyword for EF's proxy to be able to overload it: [ForeignKey("SchoolClassId")] public virtual SchoolClass SchoolClass { get; set; } Also, be sure that context's DbContext.Configuration.ProxyCreationEnabled property value is set to true (by default it is). These two conditions enabling lazy loading of your relations....

How can I handle exceptions in Web API 1.0 at my BaseAPIController

.net,asp.net-web-api

you probably should use an exception filter. [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] public sealed class ExceptionHandlerAttribute : ActionFilterAttribute { public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) { base.OnActionExecuted(actionExecutedContext); var e = actionExecutedContext.Exception; if (e != null) { // do whatever you need with your exception } } You...

Visual Studio Assembly force-installs Target Framework

c#,.net,visual-studio-2013,.net-framework-version

The targeted .NET version is the only version that the app will depend upon by default. Visual Studio will not automatically add higher and backwards compatible releases. Do this manually by adding other .NET versions to a configuration file: On the Visual Studio menu bar: Choose Project; Add New Item;...

QUERY IN C# ,where statement

c#,.net,select

I Assumed that you are using SQL this a generic query for your question: SQLCommand cmd = new SQLCommand(); cmd = "SELECT DEPT_ID FROM PERSONNEL_TEMP.DEPARTMENT WHERE DEPARTMENT_NAME= '" + combobox1.Text + "'"; here is what I recommend SQLCommand cmd = new SQLCommand(); cmd = "SELECT DEPT_ID FROM PERSONNEL_TEMP.DEPARTMENT WHERE DEPARTMENT_NAME=...