Showing posts with label iis. Show all posts
Showing posts with label iis. Show all posts

Saturday, March 31, 2012

system.enterpriseservices.dll error

I am running a web app on w2k3/IIS 6.0/ASP.net 2.0. This app runs fine on a different server. The error message I get is

Compiler Error Message:CS0006: Metadata file 'C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll' could not be found

I have seen solutions to remove the "<identity impersonate="true" />" setting from the web.config file. That has not been helpful. Another solution was to delete the system.enterpriseservices.dll from C:\Windows\assembly. I have deleted the file, copied a new .dll, and that did not work. I have reinstalled IIS and ASP.Net 2.0 as well. So far, no dice. Any other ideas are greatly welcomed!


AJ

Hello AJ,

This may be a dumb question, but is the assembly in the GAC on the deployment server? If it isn't, you should be able to add it by running "gacutil /if System.EnterpriseServices.dll" using the 2.0 version of gacutil.exe.

HTH,
Clay


Clay,

Thanks for the response. I just got the problem figured out today.

The file permissions were screwed up. Users did not have read and execute permissions to this folder:
C:\WINDOWS\WinSxS\x86_System.EnterpriseServices_b03f5f7f11d50a3a_2.0.0.0_x-ww_7d5f3790

After I fixed that I got a similar error message as before but it mentioned a system.enterpriseServices.Wrapper.dll and found out that this file was missing
C:\WINDOWS\WinSxS\x86_System.EnterpriseServices_b03f5f7f11d50a3a_2.0.0.0_x-ww_7d5f3790\System.EnterpriseServices.Wrapper.dll

Now it is running like a champ!

AJ

Wednesday, March 28, 2012

System.IO.StreamWriter -- Access to path is denied

Hi, I am trying to use the System.IO.StreamWriter to write to a file, and am getting an error that I have to set permissions for doing this in IIS -- I don't remember how to do this. Does anyone know how?

(Win XP Pro)


System.IO.StreamWriter writer = new System.IO.StreamWriter(@dotnet.itags.org."C:\NetApplicationTest",true);
Hi, u need to add aspNet User to the folder u trying to accessing and give the account have the permission to write/read it in the folder or file.

If u cant see any security tab on ur folder option, do tis below in any folder:
Tools>Folder Options>View>uncheck this "use simple file sharing(Recommended)"

then go to ur file's folder , note: folder
right click then properties> Security>Add > Advance> Find now>
Then u select ASPNET and add it, and set ASPNET to full control.

Hope tis help
life's Ng
beauty, thanks very much! -- I guess that I should study some XP Admin stuff... thanks 'gain ..

Thursday, March 22, 2012

System.OutOfMemoryException in asp.net web application

Hi,

We are getting System.OutOfMemoryException exception in an asp.net
application hosted on IIS.
The problem is popping up randomly once every few days.The web server needs
to be restarted as users keep on getting 'Server Application Unavailable'
otherwise.

Could anyone please tell abt the possible causes and solution for this.

Cheers,
JitenOhboy... it could be due to any number of things, without knowing more about
your app it would be very hard to tell what is wrong.
You can wire up your app to capture more info on unhandled exceptions, and
you can also use AdPlus in "hang" mode to take a dump of the W3WP.exe or
ASP_NET.EXE process.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
"jiten" wrote:

Quote:

Originally Posted by

Hi,
>
We are getting System.OutOfMemoryException exception in an asp.net
application hosted on IIS.
The problem is popping up randomly once every few days.The web server needs
to be restarted as users keep on getting 'Server Application Unavailable'
otherwise.
>
Could anyone please tell abt the possible causes and solution for this.
>
Cheers,
Jiten
>
>
>


One of the most common culprits is inproc session management. If you store a
lot of data in session variables, consider switching to outproc sessions.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"jiten" <jiten@.discussions.microsoft.comwrote in message
news:398C0A44-231F-40DC-AF02-E8F6965C655A@.microsoft.com...

Quote:

Originally Posted by

Hi,
>
We are getting System.OutOfMemoryException exception in an asp.net
application hosted on IIS.
The problem is popping up randomly once every few days.The web server
needs
to be restarted as users keep on getting 'Server Application Unavailable'
otherwise.
>
Could anyone please tell abt the possible causes and solution for this.
>
Cheers,
Jiten
>
>
>


there are a couple causes:

1) too large session
2) memory "leak" of unmanaged resources. common if you use com object or
don't manage sql connections
3) faulty caching.

start here: http://msdn2.microsoft.com/en-us/library/ms954591.aspx
-- bruce (sqlwork.com)

jiten wrote:

Quote:

Originally Posted by

Hi,
>
We are getting System.OutOfMemoryException exception in an asp.net
application hosted on IIS.
The problem is popping up randomly once every few days.The web server needs
to be restarted as users keep on getting 'Server Application Unavailable'
otherwise.
>
Could anyone please tell abt the possible causes and solution for this.
>
Cheers,
Jiten
>
>
>

Tuesday, March 13, 2012

System.Security.SecurityException: That assembly does not allow partially trusted callers.

I developed a web site using .net 2.0, mysql 4.0 and IIS 5.0. The server is hosted by a third party.

I am using the MySql.Data.dll library version 5.0.7.0 to connect to the database. I did not create any custom assembly and I am using the MySqlData objects directly from the code:

using MySql.Data.MySqlClient;


MySqlConnection conn;
MySqlDataAdapter data_retriever;
DataTable TextDataTable;

TextDataTable = new DataTable();

data_retriever = new MySqlDataAdapter(last_query_executed.Value.ToString(), conn);

data_retriever.Fill(TextDataTable);

This is the error I get:

System.Security.SecurityException: That assembly does not allow partially trusted callers.

[SecurityException: That assembly does not allow partially trusted callers.]
search_search.BindData() +0
search_search.Page_Load(Object sender, EventArgs e) +30
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6978
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.search_search_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

My level of knowledge of .NET and Visual Studio is not advanced.

Do you have any suggestions?

Thanks,

Christian

Here is a post on the issue. It seems the current server configuration does not allow partial trusted callers.

http://bloggingabout.net/blogs/rick/archive/2006/04/07/11929.aspx -- this may not really apply becaus eyour site is hosted by a 3rd party

http://forums.mysql.com/read.php?38,95478,96748#msg-96748 -- has a link to download a new version of MySql assembly allowing partial trust. Not sure it will work, mixed results

http://forums.asp.net/t/999456.aspx -- has some other solutions. One of which is using a ODBC connection to MySql instead.

http://dev.mysql.com/tech-resources/articles/dotnet/ --see for ODBC driver details


I tried to recompile the library. However, I get a compilation error after I add the following line in the Assemplyinfo.cs:

[assembly: AllowPartialllyTrustedCallers]

Any ideas?

Christian


What error did you get? Also post your AssemblyInfo.cs file.


I fixed this problem, I was missing the following line:

using

System.Security;

however, now i am getting the error:

Unable to connect to any of the specified MySQL hosts.