I have an application where I have removed my references to the Newtonsoft.Json library and used instead Swashbuckle.ASpNetCore.Newtonsoft version 6.1.4. When I run this locally everything works great. Swagger loads, I am able to query my API with no issues and the world is a nice place. I deploy this code to an Azure Server in Docker and where everything there was working great before, now I have problems. Swagger will not load and my API doesn't work at all, because the application doesn't even start. It would appear that something, somewhere is looking for Newtonsoft.Json version 12.0.0.0 because this is the error I get in the logs.
Any ideas would be greatly appreciated.
In case anyone else has this issue in the future, here is the solution in my case. The Coverlet NuGet package was causing this error. I removed the package and the problem went away.
Related
I've spent too long on this not to share.
I made a Windows Service with .Net 6.0 and the Host.CreateDefaultBuilder method. It worked fine, was deployed correctly. Then I modified something that worked in dev, but failed at startup in prod.
Looking at the logs, there was a problem with Dependency Injection that pointed back to the first line of my Program.cs. I tried everything around every DI thing I injected in the code, all the way to doing an "empty service" that was running a Task.Delay loop with nothing injected at all. It still failed.
I went back with working versions stored in Git. Still failed.
Nothing changed on the server, afaik.
So ultimately, I figured out that the problem was in the bundling of the Publish process: when using publish as single file, it failed. Turning that feature off solved it.
So in your .csproj, add (or modify) this line:
<PublishSingleFile>false</PublishSingleFile>
I don't know why it worked at some point and stopped working, but there's definitely something not right with that process.
A few days ago I had to update our .NET Framework 4.8 web application. First it could not be builded because of some TeamCity error on the newest version, link here. After that it could be builded but since then it showed us a custom errorpage after deployment -> 403 - Forbidden. I just changed a string ("exec X" to "exec Y") so we can access a better and faster SQL procedure.
Removing the tiny piece of argument it suddenly succeded in building anyways but the HTTP error still was there.
Neither IIS, Server, Framework Version etc. was updated, only TeamCity and that small code and argument change.
Reverting the changes to the version which had been working fine did nothing.
After a while I found out that it is a 403.14 error and static files can be accessed, but Microsofts help page didn't help a bit, it just showed the directory -> look here.
After that, I decided to shutdown and backup TeamCity and install an older version of it -> Nope.
Searching google and stackoverflow for similiar problems I stumbled upon to this post especially where I tried every single answer. Before I answer further questions on about what I had tried, please read it.
Since nothing helped so far I decided to try something "dumb" and publish the project to the folder and copy the data manually to the server and voi la! It worked! But I don't know why
and also TeamCity still can't do it anymore.
No changes were done to AppPool or other settings, please keep that in mind.
Here are my build settings from teamcity:
Please don't mind missing build steps, since those are either uninteresting or disalbed because some of them I had created to test the failing deployment on our test system.
And also, when running it locally or copying published project works fine..
Problem was with the antivirus blocking some processes, so some Asax_global.dll was missing.
I recently updated Visual Studio 2019 to 16.9. When it updated- there was a message indicating that the Android SDK was updated. When I go to run the IOS version of my Uno Project- it runs fine. However- when I go to run it on the Android version- I have had a few issues. At first it would not compile- but after doing some web searches I found I needed to reenable AAPT. I am now able to compile it- but I get an exception when I run the app on my android device. It says no virtual method getTargetState()- and then lists the library as the picture shows. I checked Nuget for any package updates and applied them- but still have the same error. It is showing a method missing- that presumably was there earlier. I am not sure how to resolve this- so any help would be appreciated.
I started thinking about what Leo Zhu said above and it made me think- there was no update to the package mentioned. Maybe there was a breaking change in the package that was installed? So- I downgraded it to 2.2.0.3- and it is working again. One point to make is I was using the latest alpha release- so a breaking change is not surprising. I hope this helps someone else that encounters this issue or a similar issue.
I have tried to connect to TFS on my VSCode 1.17.2 by installing Visual studio team services.
Please help me to solve the problem
I test the latest VS Code Version 1.22.2 and everything works as expected.
There is a thread talking about the issue here : https://github.com/Microsoft/vsts-vscode/issues/245
It seems an environment issue based on BrianFarnhill's conclusion:
So based on that I've come to the conclusion that the issue I have
here is nothing related to you guys or your extension, but something
to do with this environment for my customer and it impacting on all
extensions.
So, you can try to troubleshoot the issue based on the discussion in that thread.
If that still not work, you can download the latest VS Code Version 1.22.2, then configure it following the guide here, then check if it works for you.
You can also reference my answer in another thread to do that.
I am building on Hottowel spa template and my solution was working fine for Read, Save and Update. Delete was failing though with "Object reference not set to instance of object". At this point the Breeze.webapi verison was 1.2.0.0. After reading some articles, it was suggested to update the breeze to latest version.
I updated the breeze framework using nuget package manager and now, it fails while parsing the metadata - It says JSON string returned from the server have parsing errors. But when I look at the JSON using JSON formatters in chrome. It looks just fine. This is happening with Breeze.webapi version 1.2.8.0.
Now, if I switch just the breeze.webapi dll back to ver. 1.2.0.0. Metadata part works just fine again, however delete doesn’t.
Any help is appreciated
The likely cause is that the NuGet update did only part of the job and left your application with a mix of new and old Breeze parts. You could see that this happened by looking in the Package Console window but most folks don't look. Having been burned with every NuGet package upgrade I can think of, I now watch that console like a hawk.
I think you'll get out of trouble if you completely uninstall Breeze and re-install the latest. Look at that output window carefully. If it fails to remove something (as it might), there will be a warning to that effect. Please delete that lingering item manually before re-installing.
I'm talking to John about updating the HotTowel template so that upgrading the Breeze package feels less urgent.
Sorry for your pain.