473,698 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Strong Name

<Sigh> - okay, I have given up on the hashing idea, I guess I am going to
have to break down and figure the sn gooo out. I keep getting this message
when strong naming my assembly (an exe):

Unable to Emit Assembly: Referenced assembly 'Interop.Script ing' does not
have a strong name.

I get the error - that DLL that I am using isn't strong named, but how does
one strong name an exisitng file that I just imported? I did a search for
scripting.dll, hoping it would be about, but no luck.

Can someone assist so I can get this thing to a position where I can run a
fun command like this on it:

caspol -enterprise -addfulltrust appname.exe

???
Thanks,
Derek
Nov 20 '05 #1
9 4274
In article <#a************ **@TK2MSFTNGP09 .phx.gbl>, dmj2195
@DONTSPAMMEokst ate.edu says...
I keep getting this message
when strong naming my assembly (an exe):

Unable to Emit Assembly: Referenced assembly 'Interop.Script ing' does not
have a strong name.
If you want to strong name an assembly, all referenced assemblies must
have strong names too. It's a .NET requirement.
I get the error - that DLL that I am using isn't strong named, but how does
one strong name an exisitng file that I just imported?


If you added a reference to a COM object in VS.NET, it automatically
generates an RCW (Runtime callable wrapper) using tlbimp. However, it
uses basic default options (no signing).

If you want your wrapper signed, you'll need to create the interop
assembly yourself from the command line:

tlbimp file.dll /out:Interop.fil e.dll /keyfile:mykey.s nk

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #2
Hi Patrick, I've tried that, and get this error:
TlbImp error: The input file 'C:\projects\bi n\Interop.Scrip ting.dll' is not
a valid type library

?

"Patrick Steele [MVP]" <pa*****@mvps.o rg> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
In article <#a************ **@TK2MSFTNGP09 .phx.gbl>, dmj2195
@DONTSPAMMEokst ate.edu says...
I keep getting this message
when strong naming my assembly (an exe):

Unable to Emit Assembly: Referenced assembly 'Interop.Script ing' does not have a strong name.


If you want to strong name an assembly, all referenced assemblies must
have strong names too. It's a .NET requirement.
I get the error - that DLL that I am using isn't strong named, but how does one strong name an exisitng file that I just imported?


If you added a reference to a COM object in VS.NET, it automatically
generates an RCW (Runtime callable wrapper) using tlbimp. However, it
uses basic default options (no signing).

If you want your wrapper signed, you'll need to create the interop
assembly yourself from the command line:

tlbimp file.dll /out:Interop.fil e.dll /keyfile:mykey.s nk

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele

Nov 20 '05 #3
In article <eG************ **@TK2MSFTNGP11 .phx.gbl>, dmj2195
@DONTSPAMMEokst ate.edu says...
Hi Patrick, I've tried that, and get this error:
TlbImp error: The input file 'C:\projects\bi n\Interop.Scrip ting.dll' is not
a valid type library


You need to import the COM library. That looks like the already
converted DLL (the RCW). I think you're looking to import either
"msscript.o cx" or "scrrun.dll " from \WINNT\SYSTEM32 .

tblimp C:\winnt\system 32\scrrun.dll /out:interop.scr ipting.dll
/keyfile:mykey.s nk

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #4
In article <eD************ **@tk2msftngp13 .phx.gbl>, dmj2195
@DONTSPAMMEokst ate.edu says...
Okay, I see what you are getting at, however, I was able to import the
scrrun.dll file as interop.scripti ng, but it didn't appear to have the
member I am needing. I have attached what I have been using and perhaps you
can point me at the correct file (or perhaps I am importing it wrong).


What member are you needing? I was just guessing that scrrun.dll was
what you were importing based on the name "interop.script ing.dll".

The DLL attached is a .NET assembly, but it is not strong-named. If you
tell me a bit more about what you're doing I'll try and help you out.

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #5
Thank you thank you thank you!
I got it to work after some finagling (sp?)...I forgot that it was a
namespace change on the import, so it wasn't recognizing simply:
scripting.membe r, I had to go and change those to Interop.Scripti ng.member -
wahoo!

THANK YOU SO MUCH! Now I can strong name, which, might let me run Network
Based programs :-)

Thank you very, very much Patrick!

Derek

"Patrick Steele [MVP]" <pa*****@mvps.o rg> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
In article <eD************ **@tk2msftngp13 .phx.gbl>, dmj2195
@DONTSPAMMEokst ate.edu says...
Okay, I see what you are getting at, however, I was able to import the
scrrun.dll file as interop.scripti ng, but it didn't appear to have the
member I am needing. I have attached what I have been using and perhaps you can point me at the correct file (or perhaps I am importing it wrong).


What member are you needing? I was just guessing that scrrun.dll was
what you were importing based on the name "interop.script ing.dll".

The DLL attached is a .NET assembly, but it is not strong-named. If you
tell me a bit more about what you're doing I'll try and help you out.

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele

Nov 20 '05 #6
Okay, if you are willing, I am not quite there yet. Now I am strong named,
I even did the sn -v and it said yippy on the strong name thing. Great, so
I move it into the Share and run this command:
caspol -enterprise -adduflltrust pathtoapp.exe

it says are you sure? I say yes, it says Success....grea t, but when I go to
run it...this error, STILL!!!!!!

System.Security .Permissions.Se curityPermissio n error...

Any ideas?
Thanks!
"Derek Martin" <dm*****@DONTSP AMMEokstate.edu > wrote in message
news:Ow******** ******@TK2MSFTN GP09.phx.gbl...
Thank you thank you thank you!
I got it to work after some finagling (sp?)...I forgot that it was a
namespace change on the import, so it wasn't recognizing simply:
scripting.membe r, I had to go and change those to Interop.Scripti ng.member - wahoo!

THANK YOU SO MUCH! Now I can strong name, which, might let me run Network
Based programs :-)

Thank you very, very much Patrick!

Derek

"Patrick Steele [MVP]" <pa*****@mvps.o rg> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
In article <eD************ **@tk2msftngp13 .phx.gbl>, dmj2195
@DONTSPAMMEokst ate.edu says...
Okay, I see what you are getting at, however, I was able to import the
scrrun.dll file as interop.scripti ng, but it didn't appear to have the
member I am needing. I have attached what I have been using and
perhaps
you can point me at the correct file (or perhaps I am importing it wrong).


What member are you needing? I was just guessing that scrrun.dll was
what you were importing based on the name "interop.script ing.dll".

The DLL attached is a .NET assembly, but it is not strong-named. If you
tell me a bit more about what you're doing I'll try and help you out.

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele


Nov 20 '05 #7
In article <#A************ **@tk2msftngp13 .phx.gbl>, dmj2195
@DONTSPAMMEokst ate.edu says...
I move it into the Share and run this command:
caspol -enterprise -adduflltrust pathtoapp.exe

it says are you sure? I say yes, it says Success....grea t, but when I go to
run it...this error, STILL!!!!!!

System.Security .Permissions.Se curityPermissio n error...


I haven't worked much with the command-line caspol tool. I've only
briefly used the "Microsoft .NET Framework 1.1 Configuration" from
Administrative Tools.

In there, you could add a new code group based on the public-key you've
created for your application. Give that code FullTrust permission and
then make sure *no one* get's access to that key file you used to sign
the assembly. Otherwise, they could sign their own malicious code with
your ky and since you've given FullTrust to that key, the code could do
anything it wanted.

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #8
Well, here is the problem - this is a deployment to about 250 machines,
running from the share (not locally) and we have to be able to stick
something into their login script (like a command) to add it to the allowed
instance...
???

Derek

"Patrick Steele [MVP]" <pa*****@mvps.o rg> wrote in message
news:MP******** *************** @msnews.microso ft.com...
In article <#A************ **@tk2msftngp13 .phx.gbl>, dmj2195
@DONTSPAMMEokst ate.edu says...
I move it into the Share and run this command:
caspol -enterprise -adduflltrust pathtoapp.exe

it says are you sure? I say yes, it says Success....grea t, but when I go to run it...this error, STILL!!!!!!

System.Security .Permissions.Se curityPermissio n error...


I haven't worked much with the command-line caspol tool. I've only
briefly used the "Microsoft .NET Framework 1.1 Configuration" from
Administrative Tools.

In there, you could add a new code group based on the public-key you've
created for your application. Give that code FullTrust permission and
then make sure *no one* get's access to that key file you used to sign
the assembly. Otherwise, they could sign their own malicious code with
your ky and since you've given FullTrust to that key, the code could do
anything it wanted.

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele

Nov 20 '05 #9
In article <uO************ **@TK2MSFTNGP12 .phx.gbl>, dmj2195
@DONTSPAMMEokst ate.edu says...
Well, here is the problem - this is a deployment to about 250 machines,
running from the share (not locally) and we have to be able to stick
something into their login script (like a command) to add it to the allowed
instance...


Sorry Derek -- not my area of expertise. This might help:

".NET Framework Enterprise Security Policy Administration and
Deployment"
http://tinyurl.com/8qp3

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1209
by: Mário Sobral | last post by:
Hi, I created an assembly (let's call it assembly (B)) that returns a localized resource for a given key (similar to System.Globalization.ResourceManager). I checks if the caller assembly (let's call it assembly (A)) has a satellite assembly (let's call it assembly (sA)) with localized resources. If it exists, it gets the resource with the given key and returns it, otherwise it reads information from a support database and dinamically...
10
2685
by: Tony Jones | last post by:
Can anyone think of a reason why a 3rd party vendor writing .NET components would NOT strong name their assemblies? What harm does adding a strong-name to assembly present - I would think none whatsoever. Strong-naming the assembly should benefit the end user just in case he/she wants to reference the assembly in another strong-named assembly or add it to the GAC. If you were a third-party vendor, would you strong-name your...
1
307
by: John E. | last post by:
How can I compile two projects with a circular reference while giving them a strong name? There is a project that we have that has two components that reference each other e.g. A<->B thus creating A.dll and B.dll. I have a project (e.g. R with an assembly name of Com.MyCompany.R.dll) that has to use this mess and access A. So, R->A. Well, Com.MyCompany.R.dll is going in the GAC. It is set for strong name (entry in the assembly...
20
3188
by: Razzie | last post by:
Hey all, I'm really going through a small hell right now - I've completely lost it :) I made a project, using two interop libraries from exchange (created them as in this msdn article: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsmtps/html/writingmngsinks.asp). I set my project properties as 'Register as COM interop' to true, I can install it my project on my developement machine without a flaw. Great.
6
1649
by: Manuel Lopez | last post by:
Hello, I have a Web Project (UserControls.dll) with some user controls that is shared by many asp.net web applicattions. What we do is copy UserControls.dll to all the applications bin folders an this works correctly. We want to have this shared code in the GAC.
5
1502
by: Gopal Krish | last post by:
Hello, Can anyone tell me how to strong name a web page? Thanks Gopal
10
10682
by: Chubbly Geezer | last post by:
I have been working on a VB 2005 DLL which has previously been working. I would create the DLL (reporting.dll), install it, run 'gacutil' and 'regasm' and my Access 2000 DB could see it and use it. I have recently added some new functionality, which included splitting out some classes into another DLL (sharedfunctions.dll), referenced by the original DLL. Now if I run this from a VB test app, it works fine. However, the 'gacutil' now...
1
2368
by: Tim F | last post by:
Problem: I'm receiving the error "File or assembly name XXXXX or one of its dependencies, was not found." when trying to execute code in an assmebly that has both a strong-name and has been installed into the GAC. We originally had this assembly without a strong-name and we were successfully using it by referencing it when it was NOT in the GAC. The assembly was built using the 1.0 framework and we were able to call it from both 1.0...
8
2691
by: per9000 | last post by:
Dear readers, I have some problems with strong keys. What I want to do is basically this. A - create an application (f.x. strongHello.dll) with a strong key. B - import the functions of this dll into a console application (f.x StrongConsoleApp.exe) and run it if I have somehow specified the public part of the strong key and not otherwise.
6
5676
by: raylopez99 | last post by:
Anybody use Strong Name Signing? I think this is used by default for Resource files, which is one reason perhaps I can't get my resource files to work (somehow the public key is messed up, perhaps since I've installed so many versions of Visual Studio) RL http://msdn.microsoft.com/en-us/library/h4fa028b.aspx Deployment in Visual Studio
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8611
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7741
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.