Bluebit Software
Bluebit Software Support Forum
 Home          Members     Calendar     Who's On

Welcome Guest ( Login | Register )
        



Problem to add a new .dll in BMNL project Expand / Collapse
Message
Posted Monday, June 05, 2006 2:41 PM Post #107
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
I have a problem: I want to add a new library .dll (not bluebit) to my project and system don´t allow this: "Unable to emit assembly: <error message>]". I open a new project and this time, there is not problem with this, dll works fine. Is something to do with bluebit public and private key interferences? , what can i do in order to add this new library?
Posted Monday, June 05, 2006 11:39 PM Post #313
 

Bluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit Support
Hello Guille,

I can think of one possible explanation. The project that has generated the DLL was not signed. Try signing this project, recompile the DLL, and then add the reference to it in your main project.

Your project using NML is a signed one. Signed assemblies can only use other signed assemblies.

Let me know if the above has solved the problem







Trifon Triantafillidis

Lead Developer

Bluebit Software

Posted Tuesday, June 06, 2006 3:07 AM Post #314
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
you said "Try signing this project, recompile the DLL, and then add the reference to it in your main project".

how can i sing this project?, I remember the first time using sn.exe tool but, should I turn to sing again. I don´t understand very well the methot to sing a project. what is the rigth operation, sing a project or a dll?

sn -k and sn -p?
Posted Tuesday, June 06, 2006 3:29 AM Post #315
 

Bluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit Support
Hi

You can sign the project by simply inserting the AssemblyKeyFileAttribute in the AssemblyInfo source file. This is exactly the same as you did in your main project (the one that uses BNML) and you do not need to generate a new keyfile with sn.exe utility, you may use the same keyfile.


[VB]
<Assembly: AssemblyKeyFile("MyKey.snk")>or<Assembly: AssemblyKeyFileAttribute("MyKey.snk")>

[C#]
[Assembly: AssemblyKeyFile("MyKey.snk")]or[Assembly: AssemblyKeyFileAttribute("MyKey.snk")]




Trifon Triantafillidis

Lead Developer

Bluebit Software

Posted Tuesday, June 06, 2006 3:35 AM Post #316
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
I supose I have to fill:
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
in the .dll source code Don´t I?
Posted Tuesday, June 06, 2006 3:46 AM Post #317
 

Bluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit Support


No,

1) You will NOT make any changes in your main peoject which uses BNML and your DLL
2) In your DLL's project you will have to add in the AssemblyInfo.cs source file

[assembly: AssemblyKeyName("XXXXXX.XXX")]

where XXXXXX.XXX is your keyfile, the file that you have generated with sn.exe and contains both the private and public signing key.
Just copy the command from your main project and copy it in the AssemblyInfo of your DLL's project. Also copy the keyfile and place it in the DLL's project folder.








Trifon Triantafillidis

Lead Developer

Bluebit Software

Posted Tuesday, June 06, 2006 2:13 PM Post #318
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
thank you again Trifon,
it seems is working
I apreciate your support
Guille
Posted Tuesday, September 19, 2006 1:22 PM Post #347
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
Hi,
I have a similar problem with a .net framework .dll. I want to extract some results in a excel sheet and I added Microsoft Excel 9.0 Object Library (interop.excel). The problem is that this dll are not signed. ¿what can I do if this dll is not a library project (.dll project)?
Posted Tuesday, September 19, 2006 1:47 PM Post #348
 

Bluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit Support

Guille,

Have a look here http://www.bluebit.gr/forum/topic.asp?TOPIC_ID=45

This might be a solution.

Another solution is to manually sign the created Interop dlls (look in the bin folder) using the sn.exe tool and your private-public key pair.








Trifon Triantafillidis

Lead Developer

Bluebit Software

Posted Tuesday, September 19, 2006 3:43 PM Post #349
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
I heve been tried to sing Interop.Excel.dll but how to do it? I have tried generating a pair of public-private keys with sn and then sn -R but says that it doesn´t represent an asambly with sure name. Could you give me more information?
Posted Wednesday, September 20, 2006 3:11 AM Post #350
 

Bluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit Support
Guille,

I am sorry but you are right, sn.exe cannot work this way.

Actually there is a simpler way:

In the Solution Explorer right click on your project's name and select "Properties". This will display the properties of your VB or C# project.

In "Common Properties -> General" set the "Wrapper Assembly Key File" property to a valid key file (you DO NOT have to create a new one - you can use the same as the one you use to sign your project in the AssemblyInfo )

When a .NET project references a COM components (such us the Excel Object Library) it does not do this directly but through "wrapper dll's". Setting the above property "Wrapper Assembly Key File" forces those wrappers to get signed.




Trifon Triantafillidis

Lead Developer

Bluebit Software

Posted Wednesday, September 20, 2006 2:45 PM Post #351
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
Hi Trifon:
I think that is only for a C# project. i have not "Wrapper Assembly Key File" property in the project properties. I´ll research how to do it for VB.net. If I find the solution, I share it in this forum.
Thanks.
Guille
Posted Wednesday, September 20, 2006 3:10 PM Post #352
 

Bluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit SupportBluebit Support

If it is VB project then: http://support.microsoft.com/?kbid=313666



Trifon Triantafillidis

Lead Developer

Bluebit Software

« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Trifon

Permissions Expand / Collapse

All times are GMT -5:00, Time now is 12:02pm

Powered by InstantForum.NET v4.1.4 © 2013
Execution: 0.313. 9 queries. Compression Disabled.
.NET Matrix Library