I have .net 3.5 app that I built in VS 2008. App works fine on my pc and other pc's i have tried. I have also published on several other production servers.
But my app on a particular server does not work. I have checked permissions, gave them to iisusrs, network service. Tried running process mon. but no luck. Would appreciate if somebody can help me.
[NullReferenceException: Object reference not set to an instance of an
object.] Project.Global..cctor() +500
[TypeInitializationException: The type initializer for
'Product.Global' threw an exception.] Project.Global..ctor() +0
ASP.global_asax..ctor() in
c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\Project\5b298990\c958346b\App_global.asax.aqngqd-g.0.cs:0
[TargetInvocationException: Exception has been thrown by the target of
an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType
type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
fillCache) +146 System.RuntimeType.CreateInstanceImpl(Boolean
publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +298
System.Activator.CreateInstance(Type type, Boolean nonPublic) +79
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder
binder, Object[] args, CultureInfo culture, Object[]
activationAttributes) +10371979
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr
appContext, HttpContext context) +258
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr
appContext) +382
[HttpException (0x80004005): Exception has been thrown by the target
of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11411878
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +4401140
The static constructor for Product.Global is raising a NullReferenceException. This is likely due to some hard coded value that is different or unavailable on that system.
Potential candidates would be localization issues (trying to parse strings in the wrong culture) causing a value to not be initialized, a missing configuration value, or anything else that is occurring within the static initialization of that type.
Related
I was using blogengine.net and was configured to run on XML provider. But today when I opened the site, it's giving an exception.
You must reset your password using ALTER USER statement before executing this statement.
[MySqlException (0x80004005): You must reset your password using ALTER USER statement before executing this statement.]
That's weird because I'm using XML as provider and this exception is saying that I'm using SQL. I have also viewed web.config with these lines
<BlogEngine>
<blogProvider defaultProvider="DbBlogProvider" fileStoreProvider="XmlBlogProvider">
<providers>
<add description="Xml Blog Provider" name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core" />
<add connectionStringName="BlogEngine" description="Sql Database Provider" name="DbBlogProvider" type="BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core" />
</providers>
</blogProvider>
<blogFileSystemProvider defaultProvider="XmlBlogProvider">
<providers>
<add description="Xml Blog Provider" name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlFileSystemProvider, BlogEngine.Core" />
<add storageVariable="BlogEngine" description="Sql Database Provider" name="DbBlogProvider" type="BlogEngine.Core.Providers.DbFileSystemProvider, BlogEngine.Core" />
<!--<add storageVariable="\\UNCPath\BlogFiles" description="UNC Path Provider" name="UNCBlogProvider" type="BlogEngine.Core.Providers.UNCFileSystemProvider, BlogEngine.Core"/>-->
</providers>
</blogFileSystemProvider>
</BlogEngine>
Updated
[MySqlException (0x80004005): You must reset your password using ALTER USER statement before executing this statement.]
MySql.Data.MySqlClient.MySqlStream.ReadPacket() +342
MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId) +383
MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) +121
MySql.Data.MySqlClient.MySqlDataReader.NextResult() +1109
MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +2538
BlogEngine.Core.Providers.DbBlogProvider.FillBlogs() +274
BlogEngine.Core.Blog.get_Blogs() +182
BlogEngine.Core.Blog.get_CurrentInstance() +516
BlogEngine.Core.Right.EnsureBlogInstanceDataLoaded() +38
BlogEngine.Core.Right..cctor() +777
[TypeInitializationException: The type initializer for 'BlogEngine.Core.Right' threw an exception.]
BlogEngine.Core.Right..ctor() +0
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +138
System.Activator.CreateInstance(Type type, Boolean nonPublic) +105
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1481
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +191
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +27
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +82
System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +229
System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1114
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +140
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +712
How do I fix it?
Today I made a new build of my web-application (simple aspx-web-application). When I tried to load it on my server into IIS and navigated to the startpage I got following exception:
Die DLL "vsperf140.dll": Das angegebene Modul wurde nicht gefunden.
(Ausnahme von HRESULT: 0x8007007E) kann nicht geladen werden.
(means: the DLL "vsperf140.dll": the specified module could not be found.)
also the stacktrace doesn't help me a lot:
[DllNotFoundException: Die DLL "vsperf140.dll": Das angegebene Modul
wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E) kann nicht
geladen werden.] _CAP_Enter_Function_Managed(Int32 , Int32 , Int32
) +0 ASP.global_asax..ctor() +23
[TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler
verursacht.] System.RuntimeTypeHandle.CreateInstance(RuntimeType
type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly,
Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
+232 System.Activator.CreateInstance(Type type, Boolean nonPublic) +83 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes, StackCrawlMark& stackMark) +1122
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes) +128 System.Activator.CreateInstance(Type
type, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureInfo culture) +18
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[]
args) +60
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr
appContext, HttpContext context) +260
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr
appContext) +296
[HttpException (0x80004005): Ein Aufrufziel hat einen Ausnahmefehler
verursacht.] System.Web.HttpRuntime.FirstRequestInit(HttpContext
context) +9930568
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
+101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +254
any idea what the problem could be? Searched in google - but seems that nobody knows something about that vsperf140.dll...
From the OP in a comment:
Seems like this came with the performance profiler. Removing the project and pulling it from TFS again solved my issue.
Removed the references of AspNetHelper in web.config.
Rebuild the whole application and then deployed to new packages on my server.
(Removing the AspNetHelper in web config directly in server didn't solve my issue)
I am developing a web application using SiteCore 8 and uCommerce. To configure uCommerce I go through Sitecore and load the uCommerce interface. This morning I tried to load the uCommerce interface in the normal way, i.e logged into Sitecore and loaded uCommerce, but got nothing more than a white screen in Sitecore. Looking at the browser console I can see 2 different 500 errors:
Failed to load resource: the server responded with a status of 500
(Internal Server Error)
http://local.myapp.co.uk/ucommerceapi/Content/undefined/RootNode
Failed to load resource: the server responded with a status of 500
(Internal Server Error)
http://local.myapp.co.uk/ucommerceapi/Localization/TranslatedStrings
Failed to load resource: the server responded with a status of 500
(Internal Server Error)
http://local.myapp.co.uk/ucommerceapi/Content/tree/RootNode Failed to
load resource: the server responded with a status of 500 (Internal
Server Error)
If I click on the url in the error I get a page that displays:
Server Error in '/' Application.
Value cannot be null. Parameter name: EndpointHost.Config
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.ArgumentNullException: Value cannot be null.
Parameter name: EndpointHost.Config
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentNullException: Value cannot be null. Parameter name:
EndpointHost.Config]
[ConfigurationErrorsException: ServiceStack: AppHost does not exist or
has not been initialized. Make sure you have created an AppHost and
started it with 'new AppHost().Init();' in your Global.asax
Application_Start()]
ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory..cctor()
+836
[TypeInitializationException: The type initializer for
'ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory' threw
an exception.]
ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory..ctor()
+0
[TargetInvocationException: Exception has been thrown by the target of
an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType
type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly,
Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
+256 System.Activator.CreateInstance(Type type, Boolean nonPublic) +127 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture,
Object[] activationAttributes, StackCrawlMark& stackMark) +14297981
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes) +198 System.Activator.CreateInstance(Type
type, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureInfo culture) +28
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[]
args) +83 System.Web.Configuration.HandlerFactoryCache..ctor(String
type) +57 System.Web.HttpApplication.GetFactory(String type) +94
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+375 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
I have tried recreating the Global.asax, I have tried replacing all the sitecore folders:
sitecore
sitecore modules
sitecore_files
and the App_Config folder using files from a colleagues machine that is working fine but not luck. I can copy my colleagues solution to my PC and it works fine (except he has none of the work I have done)
Can anyone throw any light on what the problem might be?
In case anyone else stumbles on this problem. I deleted the website from IIS then recreated it and the problem has gone away. I have no idea why this has fixed the issue, as I have changed nothing in IIS for days.
I am getting the following error when trying to implement code from my peers:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
I see there is a posting for how to "How to retrieve the LoaderException property?" here (How to retrieve the LoaderException property?)
But, I do not understand where this try catch should go since the code to implement my peers code is in the Global.asax.cs file. (see below)
Any help would be appreciated and if you DOWN VOTE me, please explain why.
namespace IMS_STS_Example_SIT
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : StsMvcHttpApplication
{
protected override void OnApplicationStarted()
{
base.OnApplicationStarted();
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}
Here is the full error message from the UI:
[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
MyCompNameIT.Common.Utils.Installer.ConfigInstaller.Install(IWindsorContainer container, IConfigurationStore store) in C:\MyCompNameProjects\PrideLands\Common\Main\Source\MyCompNameIT.Common\MyCompNameIT.Common.Utils\Installer\ConfigInstaller.cs:80
Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers, DefaultComponentInstaller scope) +200
Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers) +144
MyCompNameIT.Common.Utils.InstallerExtension.WithMyCompNameDefaults(IWindsorContainer container) in C:\MyCompNameProjects\PrideLands\Common\Main\Source\MyCompNameIT.Common\MyCompNameIT.Common.Utils\InstallerExtension.cs:52
MyCompNameIT.Common.Web.InstallerExtension.WithMyCompNameWebMvc(IWindsorContainer container) in C:\MyCompNameProjects\PrideLands\Common\Main\Source\MyCompNameIT.Common\MyCompNameIT.Common.Web\InstallerExtension.cs:20
MyCompNameIT.Common.Web.MvcHttpApplication..cctor() in C:\MyCompNameProjects\PrideLands\Common\Main\Source\MyCompNameIT.Common\MyCompNameIT.Common.Web\IocHttpApplication.cs:30
[TypeInitializationException: The type initializer for 'MyCompNameIT.Common.Web.MvcHttpApplication' threw an exception.]
MyCompNameIT.Common.Web.MvcHttpApplication..ctor() +0
IMS_STS_Example_SIT.MvcApplication..ctor() +40
ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\ims_sts_example_sit\2c6588da\447046b5\App_global.asax.lkasnsc6.0.cs:0
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +256
System.Activator.CreateInstance(Type type, Boolean nonPublic) +127
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +14429965
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +200
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +83
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +312
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881108
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722297
replace StsMvcHttpApplication by MvcHttpApplication or make sure you are refering to StsMvcHttpApplication assemblies and all their dependencies
I'm trying to use System.Data.OracleClient instead of Oracle.DataAccess with Fluent Nhibernate . From what I understand, in order to achieve this I should change my driver from OracleDataClientDriver to OracleClientDriver. I've configured it like below, but I get an error that looks like it is still trying to use OracleDataClientDriver. What am I doing wrong?
FluentConfiguration configuration = Fluently.Configure()
.Database(
OracleDataClientConfiguration.Oracle10
.ConnectionString(x => x.FromConnectionStringWithKey(connString))
.Provider<NHibernate.Connection.DriverConnectionProvider>()
.Driver<NHibernate.Driver.OracleClientDriver>()
)
Here is the error, it is still looking for Oracle.DataAccess which I'm trying to get away from.
[NullReferenceException: Object reference not set to an instance of an object.]
NHibernate.Driver.OracleDataClientDriver..ctor() +134
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232
System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
System.Activator.CreateInstance(Type type) +6
NHibernate.Bytecode.ActivatorObjectsFactory.CreateInstance(Type type) +58
NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2 settings) +194
[HibernateException: Could not create the driver from NHibernate.Driver.OracleDataClientDriver, NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.]
NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2 settings) +334
NHibernate.Connection.ConnectionProvider.Configure(IDictionary`2 settings) +233
NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary`2 settings) +558
NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary`2 properties) +1328
NHibernate.Cfg.Configuration.BuildSettings() +85
NHibernate.Cfg.Configuration.BuildSessionFactory() +102
FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() +72
Use OracleClientConfiguration and OracleClientDriver instead of OracleDataClientConfiguration and OracleDataClientDriver
FluentConfiguration configuration = Fluently.Configure()
.Database(
OracleClientConfiguration.Oracle10
.ConnectionString(x => x.FromConnectionStringWithKey(connString))
.Provider<NHibernate.Connection.DriverConnectionProvider>()
.Driver<NHibernate.Driver.OracleClientDriver>()
)
The comments in the question solved my problem. I've posted this answer for the benefit of others, #PapaBurgundy & #Rivarolle deserve full credit for the answer.