OVH Cloud OVH Cloud

Erreur assembly non trouvée, XmlSerializer

1 réponse
Avatar
Cornu Nicolas
Bonjour,



Le code suivant dans mon application provoque l'erreure ci dessous
L'aasembly non trouvée est différente à chaque execution.

--------------------------------------------------------------------------
public void WritePatchConfiguration(StreamWriter wr)
{
System.Xml.Serialization.XmlSerializer writer = new
XmlSerializer(this.GetType());
//writer = null;
}

--------------------------------------------------------------------------
System.IO.FileNotFoundException: Le fichier ou l'assembly nommé
u_pawew4.dll ou
l'une de ses dépendances, est introuvable.
Nom du fichier : "u_pawew4.dll"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, B
oolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Ass
embly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean
stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef,
Evidence assembl
ySecurity)
at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
at
System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlTypeMapping
xmlTypeMapping)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String
defaultName
space)
at System.Xml.Serialization.XmlSerializer..ctor(Type type)
at dotnetpatcher.PatchFilesList.WritePatchConfiguration(StreamWriter
wr) in Q
:\Developpement\Pro\dotnetpatcher1\PatchFilesListInfos.cs:line 100
at dotnetpatcher.Patcher.NewVersionAvailable() in
Q:\Developpement\Pro\dotnet
patcher1\Patcher.cs:line 49
at dotnetpatcher_app.MainForm..ctor() in
Q:\Developpement\Pro\dotnetpatcher-a
pp\MainForm.cs:line 38

=== Pre-bind state information ===
LOG: Where-ref bind. Location = d:\tmp\u_pawew4.dll
LOG: Appbase = Q:\Developpement\Pro\dotnetpatcher-app\bin\Debug\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private,
custom, partia
l, or location-based assembly bind).
LOG: Attempting download of new URL file:///d:/tmp/u_pawew4.dll.

1 réponse

Avatar
Paul Bacelar
"Cornu Nicolas" wrote in message
news:430237b4$0$26064$
Bonjour,



Le code suivant dans mon application provoque l'erreure ci dessous
L'aasembly non trouvée est différente à chaque execution.

--------------------------------------------------------------------------
public void WritePatchConfiguration(StreamWriter wr)
{
System.Xml.Serialization.XmlSerializer writer = new
XmlSerializer(this.GetType());
//writer = null;
}

--------------------------------------------------------------------------
System.IO.FileNotFoundException: Le fichier ou l'assembly nommé
u_pawew4.dll ou
l'une de ses dépendances, est introuvable.
Nom du fichier : "u_pawew4.dll"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, B
oolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Ass
embly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean
stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef,
Evidence assembl
ySecurity)
at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[]


xmlMappings)
at
System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlTypeMapping
xmlTypeMapping)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String
defaultName
space)
at System.Xml.Serialization.XmlSerializer..ctor(Type type)
at dotnetpatcher.PatchFilesList.WritePatchConfiguration(StreamWriter
wr) in Q
:DeveloppementProdotnetpatcher1PatchFilesListInfos.cs:line 100
at dotnetpatcher.Patcher.NewVersionAvailable() in
Q:DeveloppementProdotnet
patcher1Patcher.cs:line 49
at dotnetpatcher_app.MainForm..ctor() in
Q:DeveloppementProdotnetpatcher-a
ppMainForm.cs:line 38

=== Pre-bind state information == > LOG: Where-ref bind. Location = d:tmpu_pawew4.dll
LOG: Appbase = Q:DeveloppementProdotnetpatcher-appbinDebug
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
== >
LOG: Policy not being applied to reference at this time (private,
custom, partia
l, or location-based assembly bind).
LOG: Attempting download of new URL file:///d:/tmp/u_pawew4.dll.




Le sérialiser .NET à la manie de construire des assemblies à la volée pour
sérialiser et désérialiser les types que l'on lui donne.

Je pencherais pour un problème de place ou de droit d'accès dans d:tmp.


--
Paul Bacelar