Post Publication Problem -

Oh Jeez,

I've been working for weeks on a project.

It's been stable and I published it. The deployment works absolutely fine.

It installs and is beautiful!
BUT.... after publishing... I can not develop. I can not activate the code in the debugger. I can't do anything. The code has binary serialization of a database.

And I am now after publishing I'm getting the "Cant find assembly ... Culture neutral - Null key" errors that I saw weeks and weeks ago and fixed.

I backed up the code this evening, before publishing. That environement works fine. The published and deployed code works fine. It's just that the development environment seems corrupted, or changed since I published and I have no idea where to go from here. To the best of my knowledge, I have returned the build configuration to what it was before.

[834 byte] By [ReneeC] at [2008-3-3]
# 1

I have some more information on this.

I saved my post- deployment BIN directory and copied the environment from the pre-deployment and copy the pre-deployment environment into it.

It gets much further it seems.
At any rate...... I know where the problem is in the code:

Here is the exception trail:
System.InvalidOperationException was unhandled
Message="An error occurred creating the form. See Exception.InnerException for details. The error is: Unable to cast object of type 'System.Collections.Generic.Dictionary`2' to type 'System.Collections.Generic.Dictionary`2'."
Source="RenTaskMgr"
StackTrace:
at RenTaskMgr.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 180

at RenTaskMgr.My.MyProject.MyForms.get_FrmTskMgr()

at RenTaskMgr.My.MyApplication.OnCreateMainForm() in G:\Code\aVb2005\ProjectCode\TaskMgr\My Project\Application.Designer.vb:line 35

at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()

at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()

at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)

at RenTaskMgr.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 76

at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)

at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)

at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)

at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()

at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)

at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)

at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()

at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart()
And here is the code:

Public Sub LoadMasterDatabases()

'Deserialize and read the process and Icon databases

Dim fsi As New System.IO.FileStream(GetRTMFilename(), IO.FileMode.OpenOrCreate) ' Open the dictionary in the defaulting directory

Dim BinFormatter As New BinaryFormatter()

Dim obj As Object

Dim i As Integer

Dim ii As Integer

Dim iii As Integer

Dim ps As psec

Dim TempProcDB As Dictionary(Of Integer, psec)

Try

obj = BinFormatter.Deserialize(fsi)

TempProcDB = (CType(obj, Dictionary(Of Integer, psec)))

Finally

fsi.Close() <<<<<< Exception or at the last executable line above

End Try

MasterProcDB.Clear()

FileDictionary.Clear()

ii = -1

iii = -1

For i = 0 To TempProcDB.Count - 1

ps = TempProcDB.Item(i) ' Get a packet from the temporary process db (from the file database)

' Filter dupicates using string filtration and exceptions generated by file dictionary

Try

ii += i

FileDictionary.Add(ps.filespec, ii) ' Use this as a DUP filter a dup will cause an exception

iii += 1 ' Make the records in the master continuous

ps.ImageIndex = NametoIconIndex(ps.ImageName) ' Insure there is an image index

MasterProcDB.Add(iii, ps) ' Add packet to database

Catch ex As Exception

End Try

Next

TempProcDB = Nothing

WriteMasterDatabases() 'write a clean database out

RefreshFileDictionary()

Common_exit:

End Sub


The amazing thing is that the data base actually loaded and as far as I see in the debugger, all records are intact after deserialization.
But I am still dead in the water even with all the care and backing up I did.

ReneeC at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic IDE...
# 2
I found the problem.

I went back to my latest backup and moved the latest changes to the backup.

Then I traced back to the error. At some point perhaps after the publication I made a slight change in the Root Namepsace, thinking that it would be propagated through the project. It wasn't.

I think that affected the security on the database.

Everything is fine now. I'm just so glad that I backed just before I published, because if I hadn't, this project would have stopped at V1.0. :(

:)

ReneeC at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic IDE...