assemblies

What's the costs of unused assembly references?

最后都变了- 提交于 2019-12-01 16:08:57
I was wondering what the various costs of referencing assemblies in a .NET solution are. I'm interested in both technical and organizational costs. Some examples: The unused Assembly contains additional bytes to ship (longer downloads, wasted space) The unused Assembly might contain an exploitable security hole The unused Assembly might incur additional startup costs The unused Assembly might incur additional review costs (like this question) The unused Assembly might confuse a new developer If you reference an assembly in a project but actually don't use any types in that assembly the unused

Where are Web Application Project Assembly references stored?

ぃ、小莉子 提交于 2019-12-01 15:24:40
Where are assembly refernces stored for a web application? In a Web Site, I see assembly tags written to the assembly node in the web.config when you add a reference. I am just curious as to how the Web Application Project makes the connection to get the correct local dll? I manually add the reference and the application builds, but the dll is not imported into the BIN folder, and the assembly nodes are not created in the web config as they are in a Web Site. I do a solution search for the text 'assembly="SomeAssembly..." and no results are found. I am just curious as I am trying to centralize

How can I troubleshoot : System.TypeLoadException?

佐手、 提交于 2019-12-01 15:22:18
Can you show me a way to troubleshoot System.TypeLoadException ? I am having this exception for an existing project in my solution which I reference from a unit test project in the same solution. This exeption is thrown when I run my unit tests. They fail because of this exception: Details: Test method MyErrorHandler.Test.MyTest.Parse_RecievesValidMessage_ReturnsArray threw exception: System.TypeLoadException: Could not load type 'MyTestNameSpace' from assembly 'MyTestAssemblyName.Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=Somenumber. What should I check or where should I start to

Where are Web Application Project Assembly references stored?

ぐ巨炮叔叔 提交于 2019-12-01 14:19:53
问题 Where are assembly refernces stored for a web application? In a Web Site, I see assembly tags written to the assembly node in the web.config when you add a reference. I am just curious as to how the Web Application Project makes the connection to get the correct local dll? I manually add the reference and the application builds, but the dll is not imported into the BIN folder, and the assembly nodes are not created in the web config as they are in a Web Site. I do a solution search for the

Loading different versions of the same assembly

▼魔方 西西 提交于 2019-12-01 13:44:19
问题 Using reflection, I need to load 2 different versions of the same assembly. Can I load the 2 versions in 2 different AppDomains in the same process? I need to do some data migration from the old version of the app to the new version. Please let me know if this is possible or should I use 2 separate processes. 回答1: If you are doing it at design time (which you indicate you are not) this should help you: http://blogs.msdn.com/abhinaba/archive/2005/11/30/498278.aspx If you are doing it

How can i hide “setters” from all but one assembly?

帅比萌擦擦* 提交于 2019-12-01 09:40:28
I have alluded to this issue in my other question , but i think it's worthwhile breaking it out into its own question, as it's not really dependant on the other scenarios i mentioned. Anyways - onto the Q, don't know if this is possible. Looking for a solution/workaround. I have a Class Library, with nothing but POCO's: MyCompany.MyProject.Domain.POCO This assembly has a POCO like this: public class Post { public int PostId { get; set; } public int Name { get; set; } ... } Now, i have another Class Library, which is my DAL/Repository, and uses Entity Framework 4.0 for the persistence:

How can i hide “setters” from all but one assembly?

大城市里の小女人 提交于 2019-12-01 08:50:17
问题 I have alluded to this issue in my other question, but i think it's worthwhile breaking it out into its own question, as it's not really dependant on the other scenarios i mentioned. Anyways - onto the Q, don't know if this is possible. Looking for a solution/workaround. I have a Class Library, with nothing but POCO's: MyCompany.MyProject.Domain.POCO This assembly has a POCO like this: public class Post { public int PostId { get; set; } public int Name { get; set; } ... } Now, i have another

How to compile CIL code?

倾然丶 夕夏残阳落幕 提交于 2019-12-01 08:04:29
I have a code written in CIL . Let's say, a file called some_il_code.il holds it. I want to compile it to create a managed exe assembly. How do I achieve that? Alex You can use the ilasm tool. ilasm /exe Your.il /deb=opt peverify /md /il Your.exe ilasm compiles it, peverify verifies it. 来源: https://stackoverflow.com/questions/12741607/how-to-compile-cil-code

reflection is possible on obfuscation

天涯浪子 提交于 2019-12-01 07:58:42
问题 I am struggling with this problem since last one week. I have obfuscated exe of my application. Our application is offline tool for online web application. Client will install this application and connect once to internet, application will download relevant information and store in xml file on client machine for further display. for security purpose we are encrypting these xml files. Unfortunately we have one method GetCryptXML inside exe which will read encrypted settings.xml on client

How to get a type from an unreferenced assembly?

霸气de小男生 提交于 2019-12-01 07:09:27
问题 GetType() returns null when the type exists in an unreferenced assembly. For example, when the following is called "localType" is always null (even when using the full namespace name of the class): Type localType = Type.GetType("NamespaceX.ProjectX.ClassX"); I don't see any reason why Type.GetType shouldn't be able to retrieve a type from an unreferenced assembly, so How can the type of an unreferenced assembly be retrieved? 回答1: Use LoadFrom to load the unreferenced assembly from it's