473,320 Members | 1,857 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,320 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 1469
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.