assemblies

Assembly binding redirect does not work

I'm trying to set up an assembly binding redirect, using the following app.config: <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Microsoft.AnalysisServices" PublicKeyToken="89845dcd8080cc91" /> <bindin...

InternalsVisibleTo attribute isn't working

Before I go on I did go through this InternalsVisibleTo attribute ain’t workin'! Hence the title Okay so I had a working version of my project that was using something like the following. [assembly: InternalsVisibleTo("Stuff.Test.Support, PublicKey="0024000004800000940000000302000000240000525341310004000001000100d158cd56401c3d90b52ca...

Deserializing xml with dynamically loaded assembly

Hello, I have a problem with xml-deserialization and dynamically loaded assemblys. I load my assembly directly from a zip-file to a byte array. Then i load this assembly. The assembly contains a data-model, which should be deserialized with XmlSerializer. The problem is that I always get an TypeInitializationException, if i try to load ...

Dynamically Instantiate assembly objects - Null Reference

I am trying to load an assembly into memory and then instantiate types within that assembly. The objects are all of the same type (ITestMod). The following seems to work well: private void LoadTestAssembly(string assemblyName) { try { Assembly assembly = Assembly.LoadFrom(@".\testmods\" + assemblyName); ...

how to revolve this warning in ASP.Net application?

I get the following as a warning during build of my asp.net application: The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll' How do i resolve ...

Microsoft .NEt Security Model

Hi all, I have some questions about the security model of Microsoft .NET. I am aware about RBS and CAS which decide permissions of an assembly in function of their strong name, website origin, and so on. My question is : where are stocked in the assembly these informations (strongname, origin,...) ? Thanks. Robie. ...

app.config assemblies

I have the following in my app.config. <configuration> <configSections> <sectionGroup name="FooGroup"> <section name="Foo" type="Bar.FooSection" allowLocation="true" allowDefinition="Everywhere" /> </sectionGroup> </config...

Need to move .Net Assemblies to Program Files after Windows Update

I have a legacy windows client application that uses a several .Net assemblies (I created), one with a COM wrapper. The client application resides in a root drive subfolder (c:\somefolder...). Recently after a Windows update the application could not properly load the .Net assemblies. Prior to the update there were no issues. I fixed t...

What could be causing "Path Too Long" exception?

I'm trying to build a Visual Studio add-in. For long-winded reasons (to do with using disassembled assemblies courtesy of .NET Reflector) I removed the reference to the EnvDTE assembly, then re-added it. My project still builds without any problems but when I run my project I get the following exception. System.IO.PathTooLongException ...

How to identify which framework an assembly is loaded in?

A user reported to us that some strange behaviour in our application can be resolved after installing .NET 4: <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v2.0.50727" /> </startup> </configuration> I wasn't aware that if you didn't specify an assembly it might be loaded in a high...

Is it possible to see what version of .NET an assembly was built in?

I don't need to do it from code or anything. Just need to find out from windows. ...

How can in inject a literal expression using Reflection.Emit?

I am working on a project to evaluate tokenized user-defined expressions of varying complexity, using C# as the scripting language. I have a working model using CodeDOM and reflection to generate an evaluator class, create and load the assembly (GenerateInMemory = true), instantiate the class, and Execute the evaluate method. However, ...

How can I get a list of types from a DLL in C#?

I'd like to point a C# application at a DLL and get a list of the types defined in that DLL. What I have so far looks right on the surface, but is giving the error indicated below. using System.Reflection; ... static void Main(string[] args) { Assembly SampleAssembly; SampleAssembly = Assembly.LoadFrom("C:\\MyAssembly.dll"); /...

Is there a way to tell if a C# assembly has been compiled with the optimization parameter?

Rather, is there a way to tell if it's been compiled with the optimization parameter enabled or disabled. I don't want to know if it's release or debug, since either can be enabled with or without optimizations. From my perspective, even though the code says it's release version, is it truly optimized? Thanks. ...

Does .Net's Assembly class store variables?

Ok so here's the story. I have an array of Assemblies which are initiated by [Assembly].LoadFrom() that load a number of DLL's. Upon initialising, a method called InitMain (from the DLL!) is called, which sets a number of variables outside of this method, like here: Public Class Example Dim C As Integer = 0 Public Sub InitMain...

Referencing and using JScript.NET "functions only" exe assembly.

I've compiled what is intended to be client-side JavaScript using the JScript compiler (jsc.exe) on the server side in an attempt to make something that can be tested from a unit testing project, and maybe even something that can be debugged on the server side. The compiled file contains only functions as follows (just for example) and...

WPF Prism Assembly StrongNaming.

I am trying to strong name my WPF assemblies to add to the GAC. I have references to the to the prim assemblies in my project and the compilation fails with Error 1 Assembly generation failed -- Referenced assembly 'Microsoft.Practices.Composite.Presentation' does not have a strong name What am I missing? I do understand what is h...

Reading Assembly version information of WPF application

Hi, I am reading version information of my wpf application, but I am not getting the correct version as I have write in AssemblyInfo.cs file. In my file there is [assembly: AssemblyVersion("0.1.001")] [assembly: AssemblyFileVersion("0.0.001")] I am reading version information using this code System.Reflection.Assembly.GetExecutingAs...

How to manage development of PowerShell snap-ins with x86 and x64 versions

I am currently writing a PowerShell snapin that has specific dependencies on mixed-mode assemblies (assemblies containing native code) that specifically target x64 or x86. I have both versions of the dependent assembly, but I am wondering how best to manage the build and deployment of this snapin, specifically: Is it necessary to have ...

ASP.NET - AppDomain.CurrentDomain.GetAssemblies() - Assemblies missing after AppDomain restart

I have a Bootstrapper that looks through all Assemblies in an ASP.NET MVC application to find types that implement an IBootstrapperTask interface, and then registers them with an IOC Contrainer. The idea is that you can literaly place your IBootstrapperTasks anywhere, and organise your Projects how you please. Code for Bootstrapper: pu...