.net-assembly

What's the XML file that comes together with a .NET assembly file?

拥有回忆 提交于 2019-12-03 04:39:43
Many .NET assemblies are accompanied with an XML file. For example, System.Web.WebPages.Razor.dll comes together with System.Web.WebPages.Razor.xml that contains the following: <?xml version="1.0" encoding="utf-8" ?> <doc> <assembly> <name>System.Web.WebPages.Razor</name> </assembly> <members> <member name="T:System.Web.WebPages.Razor.PreApplicationStartCode" /> <member name="M:System.Web.WebPages.Razor.PreApplicationStartCode.Start" /> <member name="T:System.Web.WebPages.Razor.RazorBuildProvider" /> <member name="M:System.Web.WebPages.Razor.RazorBuildProvider.#ctor" /> Much more elements

C# CompilerResults GenerateInMemory?

眉间皱痕 提交于 2019-12-03 03:23:55
I've been following this StackOverflow question . Its the closest thing I can find, but not quite. Let me explain what my end goal is before my question, I'm making a compiler platform that's web enabled, because of that, I want to do everything in memory ( make no files ), so I want to be able to compile code, and then be able to reference the objects in the class I just compiled for arbitrary testing. I know how it unsafe it sounds, so input in regard to security is welcome. My question is how do I compile C# source to memory, and create an instance of that class? Currently I'm at a step

MSSQL 2012 creating CLR triggers for WCF fails

不羁的心 提交于 2019-12-03 02:55:50
I've created system that uses CLR triggers to connect to WCF server and notify it about changes in DB. It runs ok on SQL server 2008 R2. Now im trying to migrate on SQL Server 2012. To use WCF i need to load SMDiagnostics.dll assembly along the others. Ive checked that clr is enabled in db , and set trustworthy to be "on", ive disabled WCF debuging, ive checked that SQL server runs under Local System account so there is no problems with permissions. Now my problem is that when i run following command IF NOT EXISTS (SELECT * FROM sys.assemblies asms WHERE asms.name = N'SMdiagnostics') create

Retrieve Target Framework Version and Target Framework Profile from a .Net Assembly

人盡茶涼 提交于 2019-12-03 01:51:42
Is there any way that I can access the values that were used for TargetFrameworkVersion and/or TargetFrameworkProfile when a .Net assembly was compiled? The values I'm talking about are the ones contained the project file <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <OtherStuff> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkProfile>Client</TargetFrameworkProfile> <OtherStuff> </PropertyGroup> <OtherStuff> </OtherStuff> </Project> Basically I'd like

JIT code generation techniques

蓝咒 提交于 2019-12-03 01:37:16
How does a virtual machine generate native machine code on the fly and execute it? Assuming you can figure out what are the native machine op-codes you want to emit, how do you go about actually running it? Is it something as hacky as mapping the mnemonic instructions to binary codes, stuffing it into an char* pointer and casting it as a function and executing? Or would you generate a temporary shared library (.dll or .so or whatever) and load it into memory using standard functions like LoadLibrary ? You can just make the program counter point to the code you want to execute. Remember that

Can a C# .dll assembly contain an entry point?

╄→гoц情女王★ 提交于 2019-12-02 21:50:52
My goal is to create an executable that will start a shadow copied application. The trick is, I want this starter program to have no external dependencies and not have to contain any knowledge about the program it has to start. I also want it to be the only executable in the directory. In other words, I want it to "run" a .dll assembly not an .exe assembly. (I can require that the name of the .dll file being loaded into a new AppDomain be the same everytime, like Main.dll or something like that.) It looked like AppDomain.ExecuteAssembly would do exactly what I wanted. It says it will start

Oracle.DataAccess.dll not shown in explorer although it is installed in GAC

血红的双手。 提交于 2019-12-02 21:15:11
问题 Does anybody know why my Oracle.DataAccess.dll Version 4 assemblies are not shown in explorer view. It is installed in GAC and working without any problems. gacutil shows it as expected. C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC>gacutil /l Oracle Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.18020 Copyright (c) Microsoft Corporation. All rights reserved. The Global Assembly Cache contains the following assemblies: Number of items = 0 C:\Program Files (x86)

Making TeamCity Version Match .NET Assembly Version

天大地大妈咪最大 提交于 2019-12-02 20:47:05
Right now our assemblies have a version number like 2.0.831.0. As I understand it, that's major version, minor version, date and build number. If I make a change and build again on the same day it's 2.0.831.1, 2.0.831.2 etc. My TeamCity build number format is simply 2.{0} where {0} is an auto incremented number that just goes on forever (2.195, 2.196 etc). How do I make TeamCity look exactly like the assembly version? We want to be able to associate the Change Log with the assembly version so anyone can say assembly version 2.0.831.2 had these changes in these files. Extra info: Our build step

App.config in Test Projects

北战南征 提交于 2019-12-02 20:07:01
I'm building an ASP.NET app in VS2010. I have a number of separate assemblies (class libraries) and corresponding Test projects for each. In one of the class libraries I use an App.config file to store settings. The assembly itself uses the following code to retrieve settings: string tmp = ConfigurationManager.AppSettings["mySetting"]; The problem is that when I try to create a Unit Test in a separate test project, the test does not pick up the setting in the App.config file. If I COPY the App.config file into the Test project, it works. How can I ensure that each assembly uses its own copy of

Get dependent assemblies?

人盡茶涼 提交于 2019-12-02 18:18:32
Is there a way to get all assemblies that depend on a given assembly? Pseudo: Assembly a = GetAssembly(); var dependants = a.GetDependants(); If you wish to find the dependent assemblies from the current application domain, you could use something like the GetDependentAssemblies function defined below: private IEnumerable<Assembly> GetDependentAssemblies(Assembly analyzedAssembly) { return AppDomain.CurrentDomain.GetAssemblies() .Where(a => GetNamesOfAssembliesReferencedBy(a) .Contains(analyzedAssembly.FullName)); } public IEnumerable<string> GetNamesOfAssembliesReferencedBy(Assembly assembly)