XSP/Mono: preventing "Warning as Error" exceptions - c#

I'm running an ASP.NET v4.8 project under Mono.
Actually, I'm doing it by using the Mono's standalone web server - XSP.
When I try to start the application in browser, I'm getting this annoying exception:
System.Web.Compilation.CompilationException:
error CS1685: Warning as Error: The predefined type System.Runtime.CompilerServices.AsyncMethodBuilderAttribute' is defined multiple times. Using definition from mscorlib.dll'"
For each project in my solution, I set the "Treat warnings as errors" option to "None" - but it still doesn't work.
I suspect that the "Warning as Error" exceptions come from the XSP program, but not sure.
I can say that I able to load the application when I'm deleting 2 files - System.Memory.dll and System.Threading.Tasks.Extensions.dll which both are used by npgsql.dll.
But when I try to use Postgres in the application, I'm getting another exception which says that the 2 files are missing...
Since the project works fine on IIS, my question is:
how do I stop those annoying "Warning as Error" exceptions?
Thanks for any answer!

Related

'Oracle.DataAccess.Client.OracleConnection' threw an exception, WinForms Application

I have a WinForms application in a .NET Framework 4.5.2 and an Oracle 10g database. This application works perfectly fine when I debug it using VS 2017, but when I deploy it as a ClickOnce application [using ClickOnce Deployment Manifest] it does not work and I keep getting the following error.
Image of the error upon connecting
relevant error text follows:
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleCommand' threw an exception. ---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleCommand..cctor()
--- End of inner exception stack trace ---
It also runs perfectly fine when running the it from bin/Release folder, how can I make so that my deployed application runs like my local .exe in my repo.
And an additional piece of info, this WPF application is just a menu so that it runs my other WinForms applications, they work perfectly fine even when published, I have ensured that all applications are targeting an (x86) architecture and that all the ClickOnce settings are the same, to no avail.
Or can I even recreate the error when debugging so that I can fix? I tried forcing 64 - bit mode
(since that is what my machine is) in the properties of the project, but it does not even load. In the ClickOnce application it loads to the log-in page, but messes up when establishing a connection after the user has entered their credentials.
This is my first post so please fell free to request any more info and let me know if I have been unclear in anyway.
Thank you for the help in advance !
The issue has been resolved, but if anyone else come across it here is the solution, you have to find and add the appropriate DLL's manually into your project. I guess as mentioned in other answers, when the error says "...Client is not compatible..." it can also mean that the appropriate files do not exist.

system.reflection.targetinvocationexception in xamarin

I've created an android app via Xamarin. the app is supposed to connect to sql server through an asmx webservice. I've tested the asmx in my browser and it works well. but the problem is that when I try the app on my android device (not emulator), the following exception occurs:
system.reflection.targetinvocationexception: 'an exception occurred during the operation, making the result invalid. check innerexception for exception details.'.
now there is a warning that I got after I built my project and it is as follows:
warning XA0105: The $(TargetFrameworkVersion) for System.EnterpriseServices (v10.0) is greater than the $(TargetFrameworkVersion) for your project (v9.0). You need to increase the $(TargetFrameworkVersion) for your project.
so i'm guessing the exception is due to this warning. I tried increasing the target framework of my project but I got more warnings and errors because api level 29 of the new target framework doesn't seem available. so my question is, is the exception truly the result of the warning? if not what is the solution for such a warning?

VS2015 C# Localhost ASHX Error (But it works on Server?) HRESULT 0x80131401

I'm building a website in VS2015 (C# using Razor)
I see many posts where people say that they receive this error on their server, but not localhost - my issue is the opposite. I'm seeing this error in every *.ashx file preamble in this specific Website only while running Localhost on my development machine:
ASP.Net runtime error: Loading this assembly would produce a different grant set from other instances (Exception from: HRESULT 0x80131401)
This error prevents me from using Intellisense in the file - and I really need it for this next handler.
What I've Determined: - The issue is specific to this Website. I have other websites that do not produce this error, so there isn't a need to modify registry or change PC configurations.
What I've tried:
IISReset (Restart PC) [*before I realized problem was local]
Changing Registry by adding LoadingOptimizer DWORD [*before I realized problem was local]
Compared XML of a working Web.config file. (Other than assembly differences I played around with other differences and still nothing)
Any suggestions?

error cs0016 could not write to output file needlicense.cshtml access is denied

Installation of ASP.NET application goes through fine. But launching it after installation causes this error in browser.
Compiler Error Message: CS0016: Could not write to output file
'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\
d09d1fc5\8ea09859\App_Web_needlicense.cshtml.639c3968.h6teml6g.dll' -- 'Access is denied.'
I have seen many questions on this error, but this is on a different dll. Fixes provided in similar errors doesnt seem to work for me. Hence, I thought of checking this particular error here.
I am hopeful of finding a perfect answer here. Thanks.

Error while compiling asp.NET application

When I compile my asp.net application,I get the below mentioned error.This error occurs often.The language I am using C#.
Internal Compiler Error (0xc0000005 at address 03976102): likely
culprit is 'BEGIN'
I found some information about the error on the Microsoft connect site
An excerpt from the page is as follows :
I believe that this issue has been fixed post-RC. The problem is that
the C# compiler is crashing as it is tries to report an error or
warning. In several cases we have seen the warning being reported is
that the LIB environment variable contains an invalid path. To avoid
the crash, check that your LIB environment variable contains valid
paths.

Categories