473,395 Members | 1,986 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

general strong name question

Hi,
I have written a component in c#. But when I recompile this component,
all other apps which includes my component can not start correctly:
An exception "System.IO.FileLoadExceptio" occurred. Only when I
compiled the app (with the new version of my component) it works. Can
it be because my component are signed and has a strong name?
How can I compile a new version of my component without compile the
apps which includes my component?

Thanks for help!

marcel

Jul 22 '05 #1
4 1473
Are you hard-coding the version number? If you create a new version of your
assembly, but the old version needs to keep running, change the version
number.

If you code a new version and you want your older apps to use it, make sure
you are interface compatible. Also make sure that, if you added any new
dependencies, that the dependent objects are also signed and strongly named.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
<ma****@mbcode.de> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Hi,
I have written a component in c#. But when I recompile this component,
all other apps which includes my component can not start correctly:
An exception "System.IO.FileLoadExceptio" occurred. Only when I
compiled the app (with the new version of my component) it works. Can
it be because my component are signed and has a strong name?
How can I compile a new version of my component without compile the
apps which includes my component?

Thanks for help!

marcel

Jul 22 '05 #2
Hi,
the Version will be changed by every compiling, because I use the *
character.
E.g. [assembly: AssemblyVersion("1.0.0.*")].

I have read that there are a possibility to configure the used version
in the config file of the application which includes my assambly. Is
this right and how I can do this?

thanks a lot
marcel

Jul 22 '05 #3
Let me understand correctly. I'm pretty sure I see your problem.

Is this the situation? --

1. You have a project that compiles to a dll.
2. You are making file references (not project references) between other
visual studio projects and this compiled assembly. (in other words, the
other solution files do not contain this project, but the other projects do
refer to the location, on the hard drive, of this compiled assembly).
3. Each time you recompile this assembly, and attempt to run the other apps,
the attempt fails and you want to know why, and what you can do about it.

Correct?

Answer: When you compile an assembly, Visual Studio creates a "manifest"
which provides the name and version of every assembly that is referenced.
So, when you compile your applications, the are referring to a specific
version of your DLL. If you then recompile the DLL, without recompiling the
dependent applications, then the manifest of the assembly will provide an
old version number. The applications will generate an error when they
cannot find the correct assembly (with the correct version number) and will
fail.

The solution is one of four things:
Either
A) specify the version number, so that ever time you recompile, the same
version number is used, or
B) create a solution file that contains all the projects that depend on this
DLL. That way, when you recompile and change the version, you can recompile
the applications automatically,
C) create a make file or nant script that will recompile all the dependent
applications (basically, the same concept as (B) but external to Visual
Studio).
D) hard code the assembly binding information (needed to resolve the
assemblies) into the config files of the applications that use the
independent assembly.

Some very useful links:
http://blogs.msdn.com/suzcook/archiv...14/132022.aspx
http://community.sgdotnet.org/forums/5614/ShowPost.aspx
Hope this helps,

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
<ma****@mbcode.de> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi,
the Version will be changed by every compiling, because I use the *
character.
E.g. [assembly: AssemblyVersion("1.0.0.*")].

I have read that there are a possibility to configure the used version
in the config file of the application which includes my assambly. Is
this right and how I can do this?

thanks a lot
marcel

Jul 22 '05 #4
Hi Nick,
thank you very much for your help! That is exactly what I need :-)

marcel

Jul 22 '05 #5

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

Similar topics

2
by: Daniel | last post by:
I'm a newcomer to .Net and am slowly becoming familiar with it, so I have some simple questions. Here's the situation: I created a VB.Net project for my data access layer (DAL), another VB.Net...
10
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...
20
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:...
3
by: Leonardo D'Ippolito | last post by:
Hello sirs, I am trying to understand how strong names work. Suppose I have lib.dll (a .net library), and also MyApplication.exe (a .NET WinApp) . MyApplication uses lib.dll . Suppose someone...
3
by: Richard | last post by:
Hi, We would like our application to be signed and have a strong name. However our application references a 3rd party .dll that does not have a strong name and so when we compile we get the...
5
by: Gopal Krish | last post by:
Hello, Can anyone tell me how to strong name a web page? Thanks Gopal
4
by: marcel | last post by:
Hi, I have written a component in c#. But when I recompile this component, all other apps which includes my component can not start correctly: An exception "System.IO.FileLoadExceptio" occurred....
1
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...
8
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.