APNs-Sharp work on an ASP.Net application? - c#

I saw a few posts on apple push notifications from an asp.net application but none of them i saw addressed the issues i'm having with the APNs-Sharp libraries. I'm assuming it should work with an asp.net application written in c# but im getting this error:
Error: Could not load file or assembly 'Newtonsoft.Json.Compact, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
I thought it was because i was missing the dll file. So i downloaded it and put it in the project. But, when i tried to add a reference to it i got this error:
A reference to 'C:\Users\me\Desktop\WebSite\Bin\Newtonsoft.Json.Compact.dll' could not be added.
This error message didn't help at all... Then i just tried to run it with out adding the reference and i got this error:
Error: Could not load file or assembly 'Newtonsoft.Json.Compact, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The module was expected to contain an assembly manifest.
I'm pretty much out of ideas on why its not working.. I downloaded their source code and ran one of the test projects with my p12 file and app id and it worked... so im not sure why its not working in my asp.net app.

The dll i downloaded was corrupted. I had to download the source code for the APNs-sharp project and get the dll from within the source code.

Related

Could not load file or assembly 'Microsoft.Practices.ObjectBuilder2, Version=2.2.0.0, Culture=neutral

My application is running fine on local, after i publish to azure web apps it gives me the error
Could not load file or assembly 'Microsoft.Practices.ObjectBuilder2, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
how do I fix this? I do not even have the objectBuilder2, if its something I have to reference where do I get it?Please help
Microsoft.Practices.ObjectBuilder2 is part of Enterprise Library. See here
Do you use this library? If not, try to remove references to it. If you use it, then add appropriate .dll to your installation.
For me Microsoft.Practices.Unity references was broken. I've just removed and added it again and worked. Maybe any refereces to Microsoft.Practices.* that would be broken can show this error.
Place Microsoft.Practices.ObjectBuilder2.dll in bin folder of your web application, this will work.

Saw this error when I try to Add-Type of the solution dll, after republishing my website "Could not load file or assembly 'Newtonsoft.Json"

I made changes and updated my web page after a year. The web page functions and loads fine but when I try to access a sub project DLL using Add-Type, it throws the above error. Really confused as to what the issue is.
Already tried fixing dependencies and everything. Nothing works! I had all that in place before, only after the republish things are not working.
Error is below:
New-Object : Exception calling ".ctor" with "3" argument(s): "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."
Thank you for the help guys ! Deleting the temporary files created on the server did the trick for me !

Google Api - System.IO.FileNotFoundException : Could not load file or assembly 'System.Net.Http.Primitives'

I'm getting the following exception when trying to use the Google Auth API:
System.IO.FileNotFoundException : Could not load file or assembly 'System.Net.Http.Primitives, Version=4.2.28.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
----> System.IO.FileNotFoundException : Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
The exception happens in Google.Api.Core.dll.
If I check the /Bin folder I can see Sytem.Net.Http.Primitives.dll in there and the version is 4.2.28.0.
I have tried updating the Microsoft HTTP Client Libraries NuGet package but that didn't help.
Is the problem something to do with a mismatch of .dll versions? If so how can I resolve that? Or is it something else entirely?
Double check if the assembly file is there in the bin folder and if its there, then try removing the reference and again add it to your project.
The version should be the same as expected. Also check on your web.config too for what it has about this particular assembly.
In your error code, I can see two different versions for the same file. Means probably, you are getting a clash between the existing assembly and the referenced assembly. Check you web.config for which version is referenced there and make sure you have the same version added to your project.
This link might help :
Could not find assembly System.Net.Http.Primitives

Deleting ReportViewer from .NET web app, something still looking for ReportViewer dll

I have a web app which used ReportViewer, from which I am trying to delete ReportViewer and all its dependencies.
As far as I can see, I have deleted everything I need to and all works fine locally. However, when I deploy to our QA server and run the site, I get the following error:
System.IO.FileNotFoundException: Could not load file or assembly
'Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91' or one of its dependencies.
The system cannot find the file specified.
I suspect that some other dll in the system depends on the ReportViewer.WebForms.dll, but I cannot work out which one. This dll is not referenced directly from anywhere in the app.
Does anyone know what dlls commonly reference ReportViewer.WebForms.dll?
I think the dll's reside in GAC, causing this error. According to MSDN;
When you run ReportViewer.exe, the following files are installed in
the Global Assembly Cache folder on the deployment computer.
Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.ProcessingObjectModel.dll
Microsoft.ReportViewer.WebForms.dll
Microsoft.ReportViewer.WinForms.dll
Microsoft.ReportViewer.DataVisualization.dll
Refer http://msdn.microsoft.com/en-us/library/ms251723.aspx for more clarification.

C# project with Interop.ComUtilitiesLib.dll issue

I downloaded an open source project written in C# and I can build that project. However, I got the error like this during run time:
Could not load file or assembly 'Interop.ComUtilitiesLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
This means it couldn't load the Interop.ComUtilitiesLib.dll file, I have checked in project root directory as well as in the Window/System32, still couldn't find the Interop.ComUtilitiesLib.dll file.
Any suggestion for me to fix this problem!
Does the project include a ComUtilities.dll file? If so, it might be a COM object that needs to be registered via the command line:
regsvr32 ComUtilities.dll

Categories

Resources