Security Exception using MySQL and Entity Framework on godaddy - mysql

We are getting a SecurityException when using Entity framework on godaddy. The entity has been configured against a MySQL store. (v. 6.1.2) A bit of weirdness with the exception though... Looking at the exception stack it seems to imply that if we open up a connection to MySQL anywhere in the site, then we should get the same exception; however, opening up a MySQL connection directly seems to be working in another part of the site...
Here's the verification:
using (MySqlConnection connection = new MySqlConnection(ConnectionString))
{
connection.Open();
...
}
Anyone run across a similar issue?
The complete error stack trace is as follows:
[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags) +0
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +470
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
System.Resources.ResourceManager.CreateResourceSet(Stream store, Assembly assembly) +357
System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +471
System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +583
System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +583
System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +74
MySql.Data.MySqlClient.Resources.get_PerfMonCategoryName() +40
MySql.Data.MySqlClient.PerformanceMonitor..ctor(MySqlConnection connection) +43
MySql.Data.MySqlClient.MySqlConnection.Open() +434
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +173
System.Data.EntityClient.EntityConnection.Open() +96
System.Data.Objects.ObjectContext.EnsureConnection() +81
System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +46
System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +44
jet.Controllers.WorkOrder.WorkOrderView..ctor() +219
jet.Controllers.WorkOrder.WorkOrderView.get_Instance() +29
jet.Controllers.WorkItemController.Index() +11
lambda_method(ExecutionScope , ControllerBase , Object[] ) +39
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +53
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +258
System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +20
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +193
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +382
System.Web.Mvc.Controller.ExecuteCore() +123
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +23
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +144
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +54
System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Weird one. GoDaddy shared-hosting ASP.NET apps execute under Medium Trust, and perf counter creation probably requires full trust, but perf counter creation is not what's failing here. (and if it failed, it wouldn't propagate out since perf coutner creation exceptions are swallowed by mySQL client code).
Instead, it's failing trying to access a string resource, before perf counter creation. The failure is with this line of code in Resources.Designer.cs of the MySQL client:
return ResourceManager.GetString("PerfMonCategoryName", resourceCulture)
A few things to try, in increasing order of difficulty:
ensure you have the MySQL client DLLs in your app's BIN directory and you're not trying to load the client DLL out of GoDaddy's GAC. Never depend on GoDaddy-supplied binaries if you can avoid it!
switch to EN-US culture so the client doesn't have to go hunting for another resource DLL, and see if the problem goes away.
Build the .NET client from source code, instead of copying DLLs from a binary distribution into your app's BIN directory. This will make problems like this easier to debug since the mySQL code won't be a black box. And, in a pinch, will let you change the problematic resource-fetching calls (or hard-code the locale)! :-)
BTW, in case you're tempted to set "Use Performance Monitor=false" in your connection string to try to evade the problem, don't bother. The problematic code gets executed regardless of that setting:
public PerformanceMonitor(MySqlConnection connection)
{
this.connection = connection;
//// this line is where it bombs
string categoryName = Resources.PerfMonCategoryName;
//// this line is affected by connection string setting
if (connection.Settings.UsePerformanceMonitor && procedureHardQueries == null)
{
try
{
procedureHardQueries = new PerformanceCounter(categoryName,
"HardProcedureQueries", false);
procedureSoftQueries = new PerformanceCounter(categoryName,
"SoftProcedureQueries", false);
}
catch (Exception ex)
{
Logger.LogException(ex);
}
}
}

Justin was spot on. Problem was godaddy has an older version of the MySql dll in their gac and the entity framework was picking it up!
Here's the fix. (Apply this to web.config)
<configuration>
...
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d"/>
<bindingRedirect oldVersion="5.0.7.0" newVersion="6.1.2.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
...
</configuration>

I simply added trust level="Full" to my Web config file, and it worked

Related

Gettting Unable to determine the provider name for connection with MySql

I am working with ASP.NET MVC4 and I am trying to move my data access layer to a separate project. Each user on my site gets their own database so I need to specify a different database in the connection string for each user. The way I am currently doing this is:
public TableDbContext GetTableDbContextForUser(string userName)
{
MySqlConnection connection = new MySqlConnection(getUserConnectionString(userName));
return new MySqlTableDbContext(connection);
}
private string getUserConnectionString(string userName)
{
ConnectionStringSettings csSettings = ConfigurationManager.ConnectionStrings["MySqlConnection"];
MySqlConnectionStringBuilder csBuilder = new MySqlConnectionStringBuilder(csSettings.ConnectionString);
csBuilder.Database += "_" + userName;
return csBuilder.GetConnectionString(true);
}
And my constructor:
public MySqlTableDbContext(MySqlConnection connection)
: base(connection, false) //Inherits from DbContext
{ }
And finally my connection string (this is in Web.config in my main project and App.config in my database project):
<connectionStrings>
<add name="MySqlConnection" providerName="MySql.Data.MySqlClient" connectionString="server=localhost;User Id=root;Persist Security Info=True;database=cybercomm;password=*;DefaultCommandTimeout=0;" />
</connectionStrings>
MySqlTableDbContext is in my Database project and I am trying to use it in my main project. It gets created just fine however when I call any method through it I get the following error:
System.NotSupportedException was unhandled by user code
HResult=-2146233067
Message=Unable to determine the provider name for connection of type 'MySql.Data.MySqlClient.MySqlConnection'.
Source=EntityFramework
StackTrace:
at System.Data.Entity.ModelConfiguration.Utilities.DbConnectionExtensions.GetProviderInvariantName(DbConnection connection)
at System.Data.Entity.Internal.InternalConnection.get_ProviderName()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.InternalContext.ExecuteSqlCommand(String sql, Object[] parameters)
at System.Data.Entity.Database.ExecuteSqlCommand(String sql, Object[] parameters)
at EPSCoR.Web.Database.Context.MySqlTableDbContext.DropTable(String table) in c:\Users\Devin\Documents\Visual Studio 2012\Projects\EPSCoR\Web\Database\Context\MySqlTableDbContext.cs:line 110
at EPSCoR.Web.App.Repositories.Basic.BasicTableRepo.Drop(String tableName) in c:\Users\Devin\Documents\Visual Studio 2012\Projects\EPSCoR\Web\App\Repositories\Basic\BasicTableRepo.cs:line 71
at EPSCoR.Web.App.Controllers.TableIndexController.Delete(Int32 id) in c:\Users\Devin\Documents\Visual Studio 2012\Projects\EPSCoR\Web\App\Controllers\ModelController.cs:line 172
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()
I know that my connection string works because when I pass DbContext the connection name ("MySqlConnection") in the constructor I can update and create models. Its only when I try to change the database parameter in the string that it breaks. Also this worked when everything was in one project, so I know that this should work somehow.
Is there anything I am missing here?
In case it might help I have MySql.Data v6.7.4.0 and EF v5 installed through nuget.
I do not know why this worked but I reinstalled both the EntityFramework and MySql.Data packages and then everything started working again.

T4MVC ArgumentOutOfRangeException in View

I just installed T4MVC on my project and I run into some problem.
In my controller i can call redirect to action without problem:
return RedirectToAction(Actions.Index());
If i do call it from my view, i get an ArgumentOutOfRangeException.
#Html.ActionLink("Delete Dinner", MVC.Home.Index())
To make sure I did it correctly, i created a new MVC solution and that line works.
I removed from my HomeController my 'baseController' inheritance and resintalled T4MVC to be sure it wouldn't interfere.
I've no more idea where even start to look for this, debug doesn't help me as it seems to explose in the extention method:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.ThrowHelper.ThrowArgumentOutOfRangeException() +72
System.Collections.ObjectModel.Collection`1.set_Item(Int32 index, T value) +10419142
System.Web.Mvc.ControllerContext.get_RequestContext() +25
System.Web.Mvc.Html.LinkExtensions.RouteLink(HtmlHelper htmlHelper, String linkText, String routeName, String protocol, String hostName, String fragment, RouteValueDictionary routeValues, IDictionary`2 htmlAttributes) +47
System.Web.Mvc.T4Extensions.ActionLink(HtmlHelper htmlHelper, String linkText, ActionResult result, IDictionary`2 htmlAttributes, String protocol, String hostName, String fragment) +196
System.Web.Mvc.T4Extensions.ActionLink(HtmlHelper htmlHelper, String linkText, ActionResult result) +72
ASP._Page_Views_Home_Index_cshtml.Execute() in c:\Thva\Misc\DropBox\Work\MyProjects\Wims\Wims.Website\Views\Home\Index.cshtml:53
Any idea?
Thanks in advance
Edit: I just tried this and it still doesn't work:
Create a new controller:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Wims.Website.Controllers
{
public partial class MyTestController : Controller
{
//
// GET: /MyTest/
public virtual ActionResult Index()
{
return View();
}
}
}
Run AutoT4MVC,
View :
#{
ViewBag.Title = "Index";
}
#Html.ActionLink("aiaieiae", MVC.MyTest.Index())
<h2>Index</h2>
To make sure i have no depedency, and it still doesn't work if i call my page:
http://localhost:2303/MyTest/index
I had the same issue. Then I found the following warnings in build log:
> Consider app.config remapping of assembly "System.Web.Mvc, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "3.0.0.0" [C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll] to Version "4.0.0.0" to solve conflict and get rid of warning.
...and same warnings for System.Web.WebPages, System.Web.Razor, System.Web.WebPages.Deployment, System.Web.WebPages.Razor
> C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
I did what the warning message suggested by adding the following lines to web.config:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
...the same for the other assemblies
</runtime>
</configuration>
And that was it - T4MVC works fine. Sometimes, NuGet adds these lines automatically, I don't know why it didn't so this time.
This solution also explains why creating a new web project and copying source codes might solve this issue.
Based on the stack, it looks like it has trouble accessing the request context, which is not related to T4MVC. To isolate, can you remove the T4MVC line and simply try to write:
#ViewContext.RequestContext
in your view? You can also try #Html.ViewContext.RequestContext. I'm guessing you'll see the same exception. If so, I'm not sure what causes it, but at least it gets you a step closer.
Another thing to try: does the regular MVC ActionLink work, or is it only T4MVC ActionLink that fails?
I've looked into this with David Ebbo (thanks a lot to him for his time), and could not find why it's not working.
After copy pasting T4MVC code in my project with my own name space and use those methods it was working..
So, i just recreated a new MVC Website and reimported everything.. not fun but i believe T4MVC worths the trouble :)
Ok, so I know my answer is rather late but it may help others. In my case everything went well until all of the sudden I had this error:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.Collections.ObjectModel.Collection`1.set_Item(Int32 index, T value) +14406551
System.Web.Mvc.Html.LinkExtensions.RouteLink(HtmlHelper htmlHelper, String linkText, String routeName, String protocol, String hostName, String fragment, RouteValueDictionary routeValues, IDictionary`2 htmlAttributes) +89
System.Web.Mvc.T4Extensions.ActionLink(HtmlHelper htmlHelper, String linkText, ActionResult result, Object htmlAttributes, String protocol, String hostName, String fragment) +338
System.Web.Mvc.T4Extensions.ActionLink(HtmlHelper htmlHelper, String linkText, ActionResult result, Object htmlAttributes) +107
ASP._Page_Views_Shared__Layout_cshtml.Execute() in c:\work\[...]\Views\Shared\_Layout.cshtml:29
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +126
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +196
System.Web.WebPages.WebPageBase.Write(HelperResult result) +89
System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +233
System.Web.WebPages.WebPageBase.PopContext() +291
Castle.DynamicProxy.AbstractInvocation.Proceed() +116
Glimpse.Core.Extensibility.ExecutionTimer.Time(Action action) +85
Glimpse.Core.Extensibility.AlternateMethod.NewImplementation(IAlternateMethodContext context) +186
Castle.DynamicProxy.AbstractInvocation.Proceed() +604
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +378
Castle.Proxies.AsyncControllerActionInvokerProxy.InvokeActionResult_callback(ControllerContext controllerContext, ActionResult actionResult) +21
Castle.DynamicProxy.AbstractInvocation.Proceed() +116
Glimpse.Core.Extensibility.ExecutionTimer.Time(Action action) +85
Glimpse.Core.Extensibility.AlternateMethod.NewImplementation(IAlternateMethodContext context) +186
Castle.DynamicProxy.AbstractInvocation.Proceed() +604
System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +33
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +853420
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +265
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +837892
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +28
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +65
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +51
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +51
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
In my case the problem was that inside web.config I have added an xmlns attribute to the configuration element:
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
Originally it was just
<configuration>
By deleting the xmlns I got my web.config warnings back but my site is working again and I can continue my work.
[Update]
I wanted to add what I think is the real solution to this problem but I saw that gius bellow already wrote it. So yeah, the issue is a missing <bindingRedirect> in web config:
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>

IronPython Microsoft.Scripting Exception

I am trying to run IronPython code with c#.
I created a simple console application (.net 4) and added IronPython.dll , IronPython.Modules.dll and Microsoft.Scripting and wrote the next code -
using Microsoft.Scripting.Hosting;
namespace app
{
class Program
{
static void Main(string[] args)
{
ScriptRuntime runtime = IronPython.Hosting.Python.CreateRuntime();
ScriptEngine engine = runtime.GetEngine("py");
engine.Execute("print 'hello!'");
}
}
}
While trying to run this , I get an exception -
Unhandled Exception:
System.Reflection.TargetInvocationException:
Exception has been thrown by the
target of an invocation. --->
System.IO.FileNotFoundException :
Could not load file or assembly
'Microsoft.Scripting, Version=1.0.0.0,
Culture
=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The syste m
cannot find the file specified. at
Core.LanguageProvider.Python..ctor(Stream
stream) --- End of inner exception
stack trace --- at
System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo
method, O bject[] args,
SignatureStruct& signature,
RuntimeType declaringType) at
System.RuntimeMethodHandle.InvokeConstructor(IRuntimeMethodInfo
method, Ob ject[] args,
SignatureStruct signature, RuntimeType
declaringType) at
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags
invokeAttr, B inder binder, Object[]
parameters, CultureInfo culture) at
System.RuntimeType.CreateInstanceImpl(BindingFlags
bindingAttr, Binder bin der, Object[]
args, CultureInfo culture, Object[]
activationAttributes) at
System.Activator.CreateInstance(Type
type, BindingFlags bindingAttr, Binde
r binder, Object[] args, CultureInfo
culture, Object[]
activationAttributes) at
System.Activator.CreateInstance(Type
type, Object[] args) at
Core.LanguageRuntime.RegisterLanguageProvider(Type
providerType) in D:\cod
e\CodeRunner\Core\LanguageRuntime.cs:line
30 at Test.Program.Main(String[]
args) in
D:\code\CodeRunner\Test\Program.cs:lin
e 19 Press any key to continue . . .
I really , dont know what to do , searched at google and dont find a solution.
I will be glad to get help.
Whic version of iron python are you using ? The syntax you show seems belong to an older version, now you should have something like:
var ipy = Python.CreateRuntime();
anyway this blog post seems to be really accurate on pointing the correct reference to use. Anyway, ensure you have the latest IronPython version.

Com SSIS Err on Schdeule ON 64 Bit Server

I am using this in Script Component In SSIS-->
Microsoft.Office.Interop.Excel.Application objXL = new Microsoft.Office.Interop.Excel.Application();
objXL.DisplayAlerts = false;
objXL.Visible = false;
Workbook objWorkbook = objXL.Workbooks.Open(strFileNameWithFolderName, false, true, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
Worksheet objSheet;
//Get SheetName of the Workbook which contains exact the same columns
for (int i = 1; i <= objWorkbook.Worksheets.Count && strMatchedorNot==false; i++)
{
& so on
when i execute this directly, it runs without problem, but when i try to schedule this it shows this errr
escription: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot access the file '\10.177.189.12\C$\inetpub\WWW_TEST\Abc\Mapping Rules Upload\1000000023_elizafox_Jan-05-2010_113731.xlsx'. There are several possible reasons: ? The file name or path does not exist. ? The file is being used by another program. ? The workbook you are trying to save has the same name as a currently open workbook. at Microsoft.Office.Interop.Excel.Workbooks.Open(String Filename, Object UpdateLinks, Object ReadOnly, Object Format, Object Password, Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin, Object Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru, Object Local, Object CorruptLoad) at ST_a8f4e90e3d884d578f79a2269c50080c.csproj.ScriptMain.Main() --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture) at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript() End Error Warning: 2010-01-07 08:47:22.58 Code: 0x80019002 Source: LOOP Through Each Input File(Request Not Completed) Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. End Warning Warning: 2010-01-07 08:47:22.58 Code: 0x80019002 Source: SABRE_SVR Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. End Warning DTExec: The package execution returned
when i disable this step and schdeules this,Pkg run successfully.
i am running it thru 64-bit server.
Please help me.
Regards,
Manish
I suspect this is an security issue since you try to access the admin share c$.
Did you already try to schedule under a different account?

Getting an exception when site is pushed to production

This is probably a shot in the dark but here goes nothing...
I have a Sitecore 6 site that I am developing locallty. When I pushed it to the production server, I now get an exception when trying to access the site. I had done an upgrade of the Sitecore version, and added the Forms module, among some other minor edits. So I moved everything to production, changed the connection strings, and changed the directory references in the web.config, but I still get this error.
My local machine still works fine, and even my staging server (hooked up via SVN and Cruise Control) works fine, but I can't fix this error on production.
At the bottom of the stack trace (below), it looks like it is trying to instantiate the search manager. Maybe that has something to do with it?
Or maybe I missed a setting when I moved everything? What settings need to be changed when the environment changes?
Here is what I've tried so far:
Re-copied all of the files and databases.
Gave full control permissions to the worker process, ASPNET, and Network Service users.
Double checked the directory paths in the web.config that needed to be configured.
Double checked the connection string in the connectionstring.config.
Recycled the App Pool
Stopped and started the site
Cleared my local browser cache (as they instruct you to do in the upgrade docs)
This is the exception that is being thrown when I try and access any page:
Thread information:
Thread ID: 1
Thread account name: 180716WEB1\testcom_web
Is impersonating: False
Stack trace: at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at Sitecore.Reflection.ReflectionUtil.SetProperty(Object obj, PropertyInfo property, Object value)
at Sitecore.Reflection.ReflectionUtil.SetProperty(Object obj, String name, Object value)
at Sitecore.Configuration.Factory.AssignProperties(Object obj, Object[] properties)
at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)
at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)
at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert)
at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert)
at Sitecore.Configuration.Factory.CreateObject(String configPath, Boolean assert)
at Sitecore.Search.SearchManager..cctor()
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
It seems that there's something wrong with rights.
Make sure that you run the right identity(NETWORK SERVICES) in your AppPool and that you follow the Sitecore Installation instructions which can be found on SDN:
Kind regards,
Alex de Groot
Sitecore Solution Architect
It turned out to be that when I restored the database to production, it didn't re-associate the database user with it!!! Stupid me! For whatever reason, that causes this error to occur. I'm guessing that the SearchManager is setup as some sort of external service or something, to abstract things.
I got this error after moving a site between environments. The cause was the path for the sc.variable named dataFolder was incorrect. The value was a full file path and the site was in a different location on the new server.
<sc.variable name="dataFolder" value="c:\www\website\data\" />
Updating the web.config with the correct path fixed the problem.