Questions tagged [.net-assembly]

A group of classes and namespaces compiled into a binary file, written in a .NET-specific language such as C# or VB.NET.

An assembly in .NET terminology is a set of modules assembled into a single process assembly (executable, ".exe") or a library assembly (".dll").

Assembly is the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions for .NET-based applications. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality.

3347 questions
495
votes
22 answers

Practical uses for the "internal" keyword in C#

Could you please explain what the practical usage is for the internal keyword in C#? I know that the internal modifier limits access to the current assembly, but when and in which circumstance should I use it?
Alexander Prokofyev
  • 33,874
  • 33
  • 95
  • 118
327
votes
7 answers

What is the purpose of a stack? Why do we need it?

So I am learning MSIL right now to learn to debug my C# .NET applications. I've always wondered: what is the purpose of the stack? Just to put my question in context: Why is there a transfer from memory to stack or "loading?" On the other hand,…
Jan Carlo Viray
  • 11,856
  • 11
  • 42
  • 63
261
votes
36 answers

Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. Manifest definition does not match the assembly reference

Things I've tried after searching: in Web.Config put a binding on the old version:
noobieDev
  • 3,063
  • 3
  • 14
  • 14
261
votes
13 answers

How do I find the PublicKeyToken for a particular dll?

I need to recreate a provider in my web.config file that looks something like this:
Matthew Jones
  • 25,644
  • 17
  • 102
  • 155
213
votes
6 answers

How can I get the executing assembly version?

I am trying to get the executing assembly version in C# 3.0 using the following code: var assemblyFullName = Assembly.GetExecutingAssembly().FullName; var version = assemblyFullName .Split(',')[1].Split('=')[1]; Is there another proper way of doing…
user1
  • 2,179
  • 2
  • 12
  • 7
158
votes
6 answers

Best practices/guidance for maintaining assembly version numbers

I'm looking for pointers, suggestions, and even dictation on how to manage the three different assembly version numbers for a .NET assembly. The Product version is the simplest, as this seems would normally be dictated by business. Then, the file…
ProfK
  • 49,207
  • 121
  • 399
  • 775
119
votes
5 answers

How to view the Folder and Files in GAC?

I want to view the folders and sub folders in GAC. Also want to know about adding and removing from GAC. To install we write this lines in command prompt by opening Visual Studio command prompt:- gacutil /i [assembly path] But to uninstall we need…
Rohit Vipin Mathews
  • 11,629
  • 15
  • 57
  • 112
116
votes
5 answers

How to prevent ReflectionTypeLoadException when calling Assembly.GetTypes()

I'm trying to scan an assembly for types implementing a specific interface using code similar to this: public List FindTypesImplementing(string assemblyPath) { var matchingTypes = new List(); var asm =…
M4N
  • 94,805
  • 45
  • 217
  • 260
107
votes
22 answers

No assembly found containing an OwinStartupAttribute Error

This error The following errors occurred while attempting to load the app. - No assembly found containing an OwinStartupAttribute. - The given type or method 'false' was not found. Try specifying the Assembly. To disable OWIN startup discovery, add…
NVA
  • 1,662
  • 5
  • 17
  • 24
89
votes
21 answers

Could not load file or assembly or one of its dependencies. Access is denied. The issue is random, but after it happens once, it continues

I have found plenty of information out there about this error: 'ERROR: Could not load file or assembly '*.dll' or one of its dependencies. Access is denied.’ But i haven't found answer specific to my scenario. My site is deploy on 6 different…
khawarPK
  • 2,179
  • 4
  • 20
  • 31
78
votes
11 answers

Could not load file or assembly HRESULT: 0x80131515 (When adding controller to MVC project that has assembly references on network drive)

I've seen this: VSTS 2010 SGEN : error : Could not load file or assembly (Exception from HRESULT: 0x80131515) and none of the answers work. It also doesn't appear when I build or anything. I can run the project fine, it happens when I try to add an…
SventoryMang
  • 10,275
  • 15
  • 70
  • 113
78
votes
4 answers

Shared AssemblyInfo for uniform versioning across the solution

I've read about this technique: Shared assembly info in VS projects - JJameson's blog Basically it means to create a SharedAssemblyInfo.cs with versioning information about the assembly, and adding this file as Link to all projects of the solution,…
lysergic-acid
  • 19,570
  • 21
  • 109
  • 218
70
votes
1 answer

Understanding a csproj assembly reference

I am using VS2010 and I tried to add a few assemblies from local hard disk to my C# project through file reference. Peeking into the csproj file, I found sometimes the file reference appears as However sometimes it…
intangible02
  • 993
  • 1
  • 9
  • 19
60
votes
3 answers

How to use "InternalsVisibleTo" attribute with Strongly named assembly?

I am using the "InternalsVisibleTo" attribute with an assembly to expose the internal methods/classes to my unit test project. I now need to install that assembly into the GAC, so I need to give it a strong name. When I try doing that, I get the…
Dave
  • 2,473
  • 2
  • 30
  • 55
59
votes
6 answers

From where do I reference a missing assembly (System.Net.Http.Formatting)?

In my Visual Studio 2013 RC project, I'm getting this err msg: "The type 'System.Net.Http.Formatting.MediaTypeFormatter' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Net.Http.Formatting,…
1
2 3
99 100