Cannot render SSRS report when deployed to different IIS website - asp.net

I'm new to SSRS reports on my job, so really sorry if this is a dumb question, but I'll happily give you all info you need.
The reports are rendered using ASP.NET. When I run the website locally, everything works fine. However when I publish my website to C:/blablabla, it throws an error saying:
Microsoft.Reporting.WinForms.ReportServerException: An error has occurred during report processing. (rsProcessingAborted) ---> Microsoft.Reporting.WinForms.ReportServerException: Cannot create a connection to data source 'TPLite'. (rsErrorOpeningConnection) ---> Microsoft.Reporting.WinForms.ReportServerException: Login failed for user 'DESKSOLUTIONS\DESK-RD-04$'.
--- Einde van intern uitzonderingsstackpad ---
--- Einde van intern uitzonderingsstackpad ---
bij Microsoft.Reporting.WinForms.ServerReportSoapProxy.OnSoapException(SoapException e)
bij Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.ProxyMethodInvocation.Execute[TReturn](RSExecutionConnection connection, ProxyMethod`1 initialMethod, ProxyMethod`1 retryMethod)
bij Microsoft.Reporting.WinForms.Internal.Soap.ReportingServices2005.Execution.RSExecutionConnection.Render(String Format, String DeviceInfo, PageCountMode PaginationMode, String& Extension, String& MimeType, String& Encoding, Warning[]& Warnings, String[]& StreamIds)
bij Microsoft.Reporting.WinForms.ServerReport.Render(String format, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
bij Microsoft.Reporting.WinForms.Report.Render(String format)
bij SociopackWS.Datalogic.S2020Mgr.MaakStocklijst() in C:\Users\avanhoutte\Documents\Projects\Sociopack Webservice\SociopackWS\SociopackWS\Datalogic\S2020MGR.cs:regel 849
After a bit of debugging I noticed this is the line where it fails:
var bytes = rptViewer.ServerReport.Render("PDF");
The error says something about a data source TPLite, which is used in the report itself. The datasource gets the connectionstring from a parameter, which is in both scenario's passed along.

Related

Keyword not supported: 'datasource' in Abp framework startup project

Project: Abp 7.0 MVC EF Core
I am getting the following error "System.ArgumentException: 'Keyword not supported: 'datasource'.'" with the first migration and seed of the DbMigrator project by following the guide for creating the first project at the link:https://abp.io/get-started
I also attach the screenshot of the error and my connection string.
I hope someone can help me thanks.
{
"App": {
"SelfUrl": "https://localhost:44333"
},
"ConnectionStrings": {
"Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=BookStore;Trusted_Connection=True;TrustServerCertificate=True"
},
"StringEncryption": {
"DefaultPassPhrase": "WK92PI2AFTDsZUoI"
}
}
Error
System.ArgumentException
HResult=0x80070057
Messaggio=Keyword not supported: 'datasource'.
Origine=Microsoft.Data.SqlClient
Analisi dello stack:
in Microsoft.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
in Microsoft.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
in Microsoft.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
in Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
in Microsoft.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
in Microsoft.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
in Microsoft.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
in Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString)
in Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.CreateDbConnection()
in Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection()
in Microsoft.EntityFrameworkCore.Storage.RelationalConnection.<OpenAsync>d__66.MoveNext()
in Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass20_0.<<ExistsAsync>b__0>d.MoveNext()
in Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass20_0.<<ExistsAsync>b__0>d.MoveNext()
in Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.<ExecuteAsync>d__7`2.MoveNext()
in Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.<ExistsAsync>d__24.MoveNext()
in Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<MigrateAsync>d__15.MoveNext()
in Acme.BookStore.EntityFrameworkCore.EntityFrameworkCoreBookStoreDbSchemaMigrator.<MigrateAsync>d__2.MoveNext() in C:\Users\GordonGekko87\source\repos\Acme.BookStore\src\Acme.BookStore.EntityFrameworkCore\EntityFrameworkCore\EntityFrameworkCoreBookStoreDbSchemaMigrator.cs: riga 29
in Acme.BookStore.Data.BookStoreDbMigrationService.<MigrateDatabaseSchemaAsync>d__10.MoveNext() in C:\Users\GordonGekko87\source\repos\Acme.BookStore\src\Acme.BookStore.Domain\Data\BookStoreDbMigrationService.cs: riga 95
in Acme.BookStore.Data.BookStoreDbMigrationService.<MigrateAsync>d__9.MoveNext() in C:\Users\GordonGekko87\source\repos\Acme.BookStore\src\Acme.BookStore.Domain\Data\BookStoreDbMigrationService.cs: riga 52
in Acme.BookStore.DbMigrator.DbMigratorHostedService.<StartAsync>d__3.MoveNext() in C:\Users\GordonGekko87\source\repos\Acme.BookStore\src\Acme.BookStore.DbMigrator\DbMigratorHostedService.cs: riga 36
in Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>d__12.MoveNext()
in Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
in Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
in Acme.BookStore.DbMigrator.Program.<Main>d__0.MoveNext() in C:\Users\GordonGekko87\source\repos\Acme.BookStore\src\Acme.BookStore.DbMigrator\Program.cs: riga 30
I tried reinstalling Microsoft SQL Server and searching online for a solution but couldn't find it...
I tried to reproduce the issue you mentioned, but I couldn't. Can you change the connection string as I posted? "ConnectionStrings": {"Default": "Server=localhost;Database=BookStore;Trusted_Connection=True;TrustServerCertificate=true"}
If still no change, could you please follow the [documentation] (https://abp.io/get-started) again and try again?

How can I specify the ASP.NET probing path for automatic C++/CLI appdomains?

I have a C++/CLI DLL that needs to run in the context of an ASP.NET WebApi action.
The action is affected by an ActionFilter that uses log4net's LogicalThreadContext to set a property containing a request ID; this works nicely to write the request ID into the log entries.
The problem is that ASP.NET seems to be creating an appdomain when it's time to load the class from the C++/CLI dll. (I can't seem to find any documentation on how that works; I'd love to find some.) When the appdomain plumbing tries to deserialize everything, it chokes because it can't find log4net.dll (see stack trace below).
Fusion logs show that it's looking in C:\Windows\System32\inetsrv, which is incorrect... I would expect it to look in the probing path or along the %PATH% environment variable.
A few data points:
log4net.dll is available in the web app's bin directory and works fine for everything else I'm using it for.
The C++/CLI code has no dependencies on log4net.
If I comment out my calls to log4net.LogicalThreadContext.Properties[...], everything works fine.
If I copy log4net.dll from my bin folder to C:\Windows\system32\inetsrv, everything works fine.
The web.config file specifies the probing path with a <probing privatePath="bin"/> element.
My Application_Start method in global.asax.cs prepends the web app's bin directory to the %PATH% environment variable:
var currentPathEnvVar = Environment.GetEnvironmentVariable("PATH");
var binPath = Path.Combine(Server.MapPath("~") ?? String.Empty, "bin");
_log.DebugFormat("Prepending paths to PATH: [{0}]", binPath);
Environment.SetEnvironmentVariable("PATH", String.Concat(binPath, Path.PathSeparator, currentPathEnvVar));
The log shows that the %PATH% is getting prepended correctly:
2015-06-05 17:07:48,816 1 DEBUG MyNamespace.WebApiApplication (null) Prepending paths to PATH: [C:\Program Files\MyCompany\MyApp\web\bin]
So how do I get the appdomain that ASP.NET creates to look in the right place to load assemblies?
Thanks.
Here's the stack trace that gets logged when all this goes down.
2015-06-05 17:08:41,148 23 ERROR MyNamespace.MyController (null) Controller action failed
System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load while attempting to initialize the default appdomain.
---> System.Runtime.Serialization.SerializationException: Unable to find assembly 'log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
Server stack trace:
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.AppDomain.IsDefaultAppDomain()
at <CrtImplementationDetails>.GetDefaultDomain() in f:\dd\vctools\crt\crtw32\h\minternal.h:line 367
at <CrtImplementationDetails>.DoCallBackInDefaultDomain(IntPtr function, Void* cookie) in f:\dd\vctools\crt\crtw32\h\minternal.h:line 401
at <CrtImplementationDetails>.DefaultDomain.Initialize() in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 278
at <CrtImplementationDetails>.LanguageSupport.InitializeDefaultAppDomain(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 343
at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 546
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 703
--- End of inner exception stack trace ---
at <CrtImplementationDetails>.ThrowModuleLoadException(String errorMessage, Exception innerException) in f:\dd\vctools\crt\crtw32\h\minternal.h:line 194
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 713
at .cctor() in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 754
--- End of inner exception stack trace ---
at MyNamespace.MyController.MyAction(String foo, Int64 bar, String baz)
This helped me to resolve similar issue:
https://blogs.msdn.microsoft.com/jorman/2007/08/31/loading-c-assemblies-in-asp-net/
Faced option 2.a and proposed solution worked fine:
protected void Application_Start(object sender, EventArgs e){
String _path = String.Concat(System.Environment.GetEnvironmentVariable("PATH"), ";",
System.AppDomain.CurrentDomain.RelativeSearchPath);
System.Environment.SetEnvironmentVariable("PATH", _path, EnvironmentVariableTarget.Process); }

Invalid IL code in System.Drawing.ColorConverter:.ctor (): method body is empty

I am Japanese developer,so English is a strange sorry. I am deploying an asp.net web project to a Mono linux box. I had the skeleton working pretty nice, but when I started Building in , I got the error you see above.
I've set the dll to copy local and added it to the bin_System.Drawing.dll and bin_System.Drowing.Design.dll folder, with no success.
It seems like I'm missing something simple. Any guesses what it is?
Server Error in '/' Application
Invalid IL code in System.Drawing.ColorConverter:.ctor (): method body is empty.
Description: HTTP 500. Error processing request.
Stack Trace:
System.InvalidProgramException: Invalid IL code in System.Drawing.ColorConverter:.ctor (): method body is empty.
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0

Get “Padding is Invalid and cannot be removed” in ASP.NET

I'm seeing this error a lot in my log lately on my prod. I've searched over the net on this error. I saw some notes like this, this or this. The bottom line on all of them is that I should set machineKey. But I already have machineKey set!
Like that:
<machineKey decryption="AES"
validation="SHA1"
decryptionKey="64 hex key"
validationKey="other 64 hex key"/>
Also I'm on web farm server and my application is on asp.net 3.5.
I'm pretty hopeless about this problem =\ How can I solve this?
Thanks.
EDIT:
Here is a full log:
Time: 04/07/2011 19:52:25
MESSAGE: Padding is invalid and cannot be removed.
HTTP_REFERER:
SOURCE: mscorlib
FORM:
QUERYSTRING: d=iAY45pNWTDkOra20F86mL9NBCe-wjxevTFjlNNxafjqLF0Aug2JmvB-c_8JQN4XnDIU1UJTmY2MC1xuySMKscg2&t=633851453303086250
TARGETSITE: Int32 DecryptData(Byte[], Int32, Int32, Byte[] ByRef, Int32, System.Security.Cryptography.PaddingMode, Boolean)
STACKTRACE: at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo)
at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType)
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
A recent ASP.Net patch changed the encryption format.
Make sure that every server in the farm is fully updated.

Problem with ASP.NET AJAX Tabs

I get the following error intermitantly from the live website I develop (say twice a month).
From the stack trace, it seems to be internal to the AJAX control toolkit.
Error Message: Invalid object passed in, member name expected. (1): {"ActiveTabIndex":0,"TabState":[true,true,true,true]}
I have found once other person who has got the exact same error http://objectmix.com/software-testing/356582-microsoft-visual-studio-team-edition-software-tester-web-test.html
Its not a big issue but I'm interested to know what is causing it. Detailed stack trace is
Error Message: Invalid object passed in, member name expected. (1): {"ActiveTabIndex":0,"TabState":[true,true,true,true]}
Stack Trace: at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth)
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)
at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
at System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject(String input)
at AjaxControlToolkit.TabContainer.LoadClientState(String clientState) in C:\Program Files\Microsoft ASP.NET\AJAX Control Toolkit 3.0\AjaxControlToolkit\Tabs\TabContainer.cs:line 346
at AjaxControlToolkit.ScriptControlBase.LoadPostData(String postDataKey, NameValueCollection postCollection) in C:\Program Files\Microsoft ASP.NET\AJAX Control Toolkit 3.0\AjaxControlToolkit\ExtenderBase\ScriptControlBase.cs:line 314
at AjaxControlToolkit.TabContainer.LoadPostData(String postDataKey, NameValueCollection postCollection) in C:\Program Files\Microsoft ASP.NET\AJAX Control Toolkit 3.0\AjaxControlToolkit\Tabs\TabContainer.cs:line 447
at AjaxControlToolkit.ScriptControlBase.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) in C:\Program Files\Microsoft ASP.NET\AJAX Control Toolkit 3.0\AjaxControlToolkit\ExtenderBase\ScriptControlBase.cs:line 425
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Resources