I am getting the following error written to the applications error log file when I run the .exe of the program in the release folder:
<logEntry>
<Date>23/06/2015 20:00:50</Date>
<Exception>
<Source>Twitter_twitinvi</Source>
<Message>Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.</Message>
<Stack> at Twitter_twitinvi.Program.RunTwitterApplication()
at Twitter_twitinvi.Program.Main(String[] args) in c:\Users\nikhil\Desktop\MediaLabs\Backup\BackupTwitter\Program.cs:line 64</Stack>
</Exception>
</logEntry>
I have tried reinstalling Newtonsoft to make sure there is no conflict with versioning. The application runs fine through VS2012
My intention is to restart the application when I catch an exception, here is my code:
static void Main(string[] args)
{
try
{
RunTwitterApplication();
}
catch (Exception e)
{
LogWriter.LogWriter.WriteLog(e);
Process.Start(@"C:\Users\nikhil\Desktop\MediaLabs\Backup\Twitter_twitinvi\Twitter_twitinvi\obj\Release\Twitter_twitinvi.exe");
}
}
private static void RunTwitterApplication()
Will this work? Once the .exe file starts running without the above mentioned error ofcourse
Thank you
This looks like you're not copying a resource properly.
Go into Visual Studio's Solution Explorer window, open the "References" tab for your project, then make sure the "Copy Local" property for the
Newtonsoft.Jsonreference is set to "True".