Textbox Mode DateTimeLocal not working when deployed to IIS - c#

Description: An error occurred during the parsing of a resource
required to service this request. Please review the following specific
parse error details and modify your source file appropriately.
Parser Error Message: Cannot create an object of type
'System.Web.UI.WebControls.TextBoxMode' from its string representation
'DateTimeLocal' for the 'TextMode' property.
Source Error:
I set my Textbox TextMode=DateTimeLocal and ran my project and it runs well. When I tried to deploy my application to IIS and visit the webpage i would get the error above. IIS has .Net 4.0.30319. Is there a reason why i get it on localhost (on my computer) and not the server (iss)? how do i fix this?

There are only three members in the TextBoxMode Enumeration for ASP.NET 4.0:
SingleLine: Represents single-line entry mode.
MultiLine: Represents multiline entry mode.
Password: Represents password entry mode.
There are a considerable amount more, including DateTimeLocal in TextBoxMode Enumeration for ASP.NET 4.5.
Your localhost is running ASP.NET 4.5, and apparently your server is not... ensure you have ASP.NET 4.5 installed on your server.
UPDATE: for people who can't upgrade to ASP.NET 4.5, you can likely just set the type="datetime-local" for the TextBox as an alternative.

Install asp.net 4.5 on server and works!

Related

MongoDB :Auth mechanism not specified Error for specific Project

We running 2 web .net project on same Pc and connecting to same Mongod server .
first and second project connect to same database.
First project with authorization connection string working fine without connection issue
but Second project with same authorization string giving Auth mechanism not specified error
if I specified any auth mechanism then it giving
Unsupported MongoAuthenticationMechanism SCRAM-SHA-1 error
This is happen only for second project , not issue with first project
I am sure that
both mongod server and shell version match
same connection string for both
but why it giving issue for second project only. what would be possible project level issue? any idea.
Please help for this
Resolved this issue, MongoDb DLL issue which is different for both projected. Used one which is working for both.

ASP.NET Core 2.1 IIS hosting error 502.5 - Unable to execute dotnet command to determine cause

So I am getting the rather common HTTP Error 502.5 - Process Failure now that I've hosted my project on a server VM running Windows Server 2016. While troubleshooting, I've attempted most of the solutions proposed for the same error:
ASP.NET Core 1.0 on IIS error 502.5.
Nothing else helped, so I'm looking at the answer that received the most upvotes. This mentions running the following command to receive a more meaningful message describing the error:
C:\fullpath\dotnet C:\fullpath\PROJECT.dll
I am honestly not sure how to execute that. What I did was navigate to the published project's containing folder on the server through the cmd, and issue the command like so:
dotnet .\My_Project Integration.dll
But the console prints this in response:
No executable found matching command "dotnet-.\My_Project"
Notice how the DLL is titled 'My_Project Integration.dll, however the word 'Integration' is absent from the console response. I do not know whether the underscore is to blame here, but any help is appreciated getting the command to run.
And of course, if you know of a solution to the actual 502.5, that is welcome as well.
You've likely got this issue: https://github.com/aspnet/Home/issues/1931. The ASP.NET Core IIS Module reads the Web.config to determine what to execute to run the app.
You said running dotnet ".\My_Project Integration.dll" worked successfully and enabling stdout showed the same issue of the path being truncated after the space.
Two options:
Remove the space from your project (this would be the easiest option)
Update your Web.config
If you do #2, your Web.config needs to have something like this for the arguments attribute:
arguments='".\My_Project Integration.dll"'

Google Speech - After Hosting getting Unauthenticated Error

I have created a web api method to Speech to text using Google Speech library. It is working fine when I execute using the visual studio. After hosting the application on IIS, I am getting below error when the api method is called
Method:Status(StatusCode=Unauthenticated, Detail="Getting metadata from plugin failed with error: Exception occurred in metadata credentials plugin.")
Error at line with code:
var speechResponse = speech.Recognize(SpeechConfig,
RecognitionAudio.FromFile(fileToProcess));*
And on another system, I have configured the GOOGLE_APPLICATION_CREDENTIALS env avariable with service account json, but I am getting below error
The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials.
Do you also have compact framework sdk installed for visual studio? if try adding
< NoStdLib > False< / NoStdLib >
in your *.csproj file. This would force VS to use the std mscorlib.dll instead of compact one.
Check if the date and time on your system are correct (should be with 60 seconds of actual time)

Unable to find requested .Net framework data provider. It may not be installed

I am using VS2010 Express and trying to create a new connection with the help of server explorer. i selected the server name and windows authentication.
After it i mentioned the name of database to be connected with and tested connection successfully but as i click on ok it shows me error
"Unable to find requested .Net framework data provider.It may not be installed"
i have all the required dll's in my reference of project such as system.data,system.data.entity but still it is giving error somebody please help me.
It's probably your config file...Check your config files for self terminating nodes.

Can not open database error from IIS

Hi I just tryed to run my application fopr the first time on IIS.
Everything worked find while developing on visual studio but when I added the app to IIS I got this error:
Cannot open user default database. Login failed.
Login failed for user 'IIS APPPOOL\forum'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database.
What should I do the site works when I run it from visual studio?
EDIT
I did a litle more digging and I managed to find out that I needed to setmy application pool identity to NetworkService I did that but now I got another error :
Unable to open the physical file "D:\Projects IDE\Visual Studio\MyWork\Websites\Forum\App_Data\ASPNETDB.MDF". Operating system error 5: "5(Access is denied.)".
An attempt to attach an auto-named database for file D:\Projects IDE\Visual Studio\MyWork\Websites\Forum\App_Data\ASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Please check two places
1 Access to folder for the NetworkService identity(default for IIS app pool) or for this one(IIS APPPOOL\forum)
2 Connection string credetial. And if there "Integrated security". Provide Specific user and passwrod there.
I received this non explicit error because I had the Application Pool set to .NET 2.0 as opposed to .NET 4.0 on a service that was responsible for authentication. Typically when the framework is incorrect a different type of error about a non-recognized framework .dll is displayed, but not in this case. If this happens, check the following:
The value after IIS APPPOOL is the name of the application pool this current process is run under. In your case there was an AppPool named forum.
Check that the app pool is using the corrected pipeline and .NET Framework required for the application being run.

Categories