Cannot open VS 2010 solution file in Xamarin Studio (MonoDevelop) - c#

I have built an ASP.NET Web Service in C# and and I need to run this on Linux. After googling, I found out that it's possible to execute ASP.NET web service on Linux using Mono Develop. But when I try to open my Solution File in Mono (Xamarin Studio) it gives me an error:
Error while trying to load the project.
What am I doing wrong? Or maybe what is the best solution to run ASP.NET Web Service on Linux?
EDIT:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation defaultLanguage="C#" debug="true">
<assemblies>
</assemblies>
</compilation>
<customErrors mode="RemoteOnly">
</customErrors>
<authentication mode="None">
</authentication>
<authorization>
<allow users="*" />
</authorization>
<httpHandlers>
</httpHandlers>
<trace enabled="false" localOnly="true" pageOutput="false" requestLimit="10" traceMode="SortByTime" />
<sessionState mode="InProc" cookieless="false" timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
<pages>
</pages>
</system.web>
</configuration>

First of all, it can fail for a lot of reasons, so add a bug report into Xamarin's Bugzilla. But try initially to start Xamarin Studio, choose create new Asp.Net solution and then replace with your files in the .vcproj file (you can use a simple xml editor like gedit or Notepad++).
Depends on your application kind, I found that simple web pages/web services work but is not using IIS, but is using XSP4 (their custom C# written IIS-like web server) which sometimes is slow.
If you need simply to make some business logic to run fast on Mono and to not have configuration hassles, I would recommend to you .Net remoting. This is a low-overhead solution and I found it working even in combination with binary serialization.

Related

.NET 4.6.1 and IIS7 - Cannot upload large files from WebAPI2 endpoints

I am trying to upload files using my .NET application. I cannot upload large files and it responds with 413 - Request Entity Too Large.
I tried solutions that suggested changing maxRequestLength and maxAllowedContentLength in web.config. Also changed the uploadReadAhead setting in IIS. I still am unable to upload the files.
The project has two web configs. Parent directory web config has the following settings:
<system.web>
...other lines
<compilation targetFramework="4.6.1" />
<httpRuntime targetFramework="4.6.1" maxRequestLength="2147483647" executionTimeout="999999" />
<customErrors mode="Off" />
</system.web>
The web config in the inner Portal directory has:
<system.web>
...other lines
<httpRuntime targetFramework="4.6.1" requestValidationMode="2.0" executionTimeout="999999" useFullyQualifiedRedirectUrl="true" maxRequestLength="2147483647" />
</system.web>
<system.webServer>
...other lines
<httpRuntime targetFramework="4.6.1" requestValidationMode="2.0" executionTimeout="999999" useFullyQualifiedRedirectUrl="true" maxRequestLength="2147483647" />
</system.webServer>
How do I fix this ?
Thanks.
Hum, that should be fine. On the other hand, seems to me that adopting some kind of nice up-loading library that up-loads in chunks would be better. This tends to "less freeze up" the user interface and also tends to not freeze up the web server either.
I mean, for a user to up-load a big file, then they are going to be stuck watching the screen - nothing occuring. With a nice up-loader library, then only small chunks are sent up, you get a progess bar, and you have un-limited up-load file sizes.
However, you could try in the main web.config,
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2048000000"/>
</requestFiltering>
</security>
</system.webServer>
So, you could try adding above under system.webServer

Runtime Error after deploy asp.net webforms app in Microsoft Azure App service

I am trying to deploy in Azure WebApp service an ASP.NET Weforms.
The app runs fine locally, without any problem.
After build ends I got the error below error in web browser after i go to myapp.azurewebsites.net i
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
Here is source of Web.config file
<?xml version="1.0"?>
<configuration>
<configSections/>
<connectionStrings>
<add name="constr" providerName="System.Data.SqlClient" connectionString="server=telendar.database.windows.net; database=TrackerDB;uid=telendar;password=*****;"/>
</connectionStrings>
<location path="Admin">
<system.web>
<customErrors mode="On"/>
<authorization>
<allow roles="Administrator"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<system.web>
<compilation debug="true" targetFramework="4.5.1"/>
<sessionState timeout="60"/>
<authentication mode="Forms">
<forms defaultUrl="~/Default.aspx" loginUrl="~/AuthUser.aspx" slidingExpiration="true" timeout="60"/>
</authentication>
<authorization/>
<pages controlRenderingCompatibilityVersion="4.0" validateRequest="true">
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
</controls>
</pages>
</system.web>
</configuration>
You misunderstand the error message, it's telling you that your code crashed an unhandled exception and it's not allowed to show it ,it suggest you modifying the web.config to enable the details of the specific error message to be viewable on remote machines.
So what you need to do is recreate the error while you browse it on the server and then solve the problem.
However my suggestion is you could try to change your FrameWork maybe this will work for you.
If you still have other questions, please let me know.

Configuration error: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level

I have developed a web application using c# and asp.net but when I am trying to publish and put it into the server using ftp then I am getting this following error:
Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application
in IIS.
Source File: \\fs8-n02\stor10wc2dfw1\555713\570520\www.gxxxxjjsxx.ssd\web\content\2way\armb
\web.config Line: 9
Here if I check on my Line 9 of the web config file then I get this:
<authentication mode="Forms">
And here is my complete web config file code:
<?xml version="1.0"?>
<configuration>
<system.web>
<customErrors mode="Off"/>
<authentication mode="Forms">
<forms loginUrl="Login.aspx" timeout="2880"/>
</authentication>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<pages validateRequest="false">
<controls>
<add tagPrefix="ajaxtoolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolKit" />
</controls>
</pages>
<globalization culture="en-GB"/>
</system.web>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>
</configuration>
I have checked whether I have multiple web config files but I could not find something like that. And also I have used this published folder into my IIS and I can browse the site from my localhost using IIS but still when ever I am trying to browse using the link:
I am getting the same error. Please help me on this. Thanks.
Here is my solution to the problem: Actually the path was not configured properly into the IIS as a virtual directory. So, that I had to create a proper virtual directory and then only I am able to access the site.

Why does setting shadowCopyBinAssemblies="false" have no effect?

I'm trying to turn off shadow copying in IIS to improve performance in production.
But adding that in my web.config has no effect. Here's my web.config
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<hostingEnvironment shadowCopyBinAssemblies="false" />
</system.web>
</configuration>
When I hit the URL it takes just as long the first time, and
files still appear in
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
so it appears to have no effect.
IIS 7.5 and Windows 7. I'm testing with a tiny Hello World ASPX page.
Any ideas why this isn't working? Is this setting overridden somewhere?

Validation of viewstate MAC failed.Application hosted by a Web Farm, ensure <machineKey> configuration [duplicate]

This question already has answers here:
Asp.net Validation of viewstate MAC failed
(17 answers)
Closed 9 years ago.
net 4.0 frame work,
I had made many website in this frame work but never get such error
"Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster."
I think so this error is caused because of use of cookies as only in this website i had made use of cookies.
Another one thing i used to get this error very rarely almost 2twice a week
I had read many solutions for this but very rarer for 4.0
solution readed such as putting
<machineKey validationKey="6628ECBFB40F6F852AB543C23C0B83C1679C5AAE35AD72FACF5B9F4FDB70AA1F648A1D5877CE1F9D69F08BAD919BFBAC0976D9119B8F32CFB80814E4E943F8EE" decryptionKey="42F45B378301126EB4CCBA16995304263754EF116E08A81003A936CC04B7537F" validation="SHA1" decryption="AES" />
in web config
OR Adding
<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never" />
in webconfig
But where should i add in my above web config
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="Conn" connectionString="Data Source=abc; Initial Catalog=alfadesi_trikon;User ID=abc;Password=abc" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<globalization culture="en-AU" uiCulture="en-AU" />
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="Windows"/>
<customErrors mode="Off"></customErrors>
</system.web>
</configuration>
you can add your machine key in system.web element.
for e.g.
<system.web>
<machineKey validationKey="1234567890123456789012345678901234567890AAAAAAAAAA"
decryptionKey="123456789012345678901234567890123456789012345678"
validation="SHA1" decryption="Auto" />
</system.web>
If you don't want to put a machinekey in the web.config for each application, you need to put it in machine level web.config for each .Net Framework version.

Categories