I've been working on converting a Silverlight project from Silverlight 2 to Silverlight 3. Note that I've never had SL 2 binaries or development components installed on my machine (it's only a month old).
This has been going fine and the app was running until I started getting a build error with ValidateXaml raising a FileNotFoundException in System.Core. I don't know why this suddenly started happening but from some searching around the answer seemed to be putting various Silverlight DLLs in the GAC. This did indeed solve the build errors. I didn't try testing to check if the app ran correctly after that.
Some time later I'm trying to run the app again. Now I'm getting yet another FileNotFoundException, this time in System.Windows.Controls. I've tried removing all Silverlight DLLs from the GAC and adding them back in again without any success. Here's the stack trace:
Message: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at MyNamespace.Page.InitializeComponent()
at MyNamespace.Page..ctor()
at MyNamespace.App.Application_Startup(Object sender, StartupEventArgs e)
at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
This entire experience has been very frustrating and I'd love to know what is causing these problems and how to fix them?
Have you tried the fusion log viewer? In a VS command shell, fuslogvw.exe, set it to show bind errors in options, clear out the log, run your app. Afterwards it will give you a detailed explanation why it could not load the assembly. fuslogvw has helped me here many times.
Do note the or one of its dependencies. That is key, it's rare that it's the assembly the exception is complaining about, it's often a dependency issue.
I have reinstalled the Silverlight runtime and all of the development components and the problem has now gone away.
I'm leaving this unanswered for now in case someone has some ideas on what caused this.
Related
I have created a WPF application in VS 2017 that installs with ClickOnce. After deploying the solution to a network location, I am able to install on my 64-bit Windows 10 computer by visiting the .application link.
However, the application does not run on my machine after it is installed. When I attempt to use the .appref-ms shortcut from the Start menu, nothing happens. I have added code to launch a debugger when the application starts, but it doesn't get hit. I see nothing getting logged in the clickonce log when running the application from here. I have set the logging to Verbose in the registry.
If I attempt to run the application from the %userprofile%\AppData\Local\Apps\2.0\ install location, it runs fine and launches the debugger. However, I can't use this location because it will then use the config file from this location rather than the config stored in %userprofile%\AppData\Local\, which allows new versions to continue using the same configuration. It's also inconvenient for users.
If I go back to the .application link on the server, I am able to install new versions when they are deployed, but it still does not launch the application or log any issues with running the application.
The .appref-ms looks like this, and Launcher.manifest does exist in the install location, along with the file listed in the manifest:
file://192.168.10.11/Projects/Launcher.application#Launcher.application, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil
How do I track down the problem with my ClickOnce shortcut?
Edit: Someone mentioned looking in the Event Viewer, and I found a SecurityException, which only occurs when running from the shortcut. Debugger.Launch() is the first line in the MainWindow Constructor on the partial class, but it is not getting hit. Here is the exception from Event Viewer:
Application: applaunch.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Security.SecurityException
at System.Security.CodeAccessSecurityEngine.Check(System.Object, System.Threading.StackCrawlMark ByRef, Boolean)
at System.Security.CodeAccessPermission.Demand()
at MS.Internal.SecurityHelper.DemandUnmanagedCode()
at System.Windows.Window..ctor()
at Launcher.MainWindow..ctor()
This helps in my case (had the same problem):
Project -> Properties
Security: Change from partial trust to full trust
Changes marked yellow:
When we are using Xamarin and MvvmCross to build a project for Phone. In this project we have added a SQLite db using SQLite plugin from MvvmCross, we have also added the SQLite3 dll to our debug folder. When we build everything is fine, but when we run the application we get the following exception:
Exception {Cirrious.CrossCore.Exceptions.MvxIoCResolveException: Failed to construct LocalPersistDataService ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Unable to load DLL 'sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
From the output: A first chance exception of type 'System.DllNotFoundException' occurred in Cirrious.MvvmCross.Plugins.Sqlite.WindowsCommon.DLL
Using Visual Studio 2013 and Windows Phone 8.1 RT
We solved it with adding an package from sqlite.org and then got (out of nothing day 2) a reference in our add Reference on Windows Phone, this link might be of help to others with the same problem. (Down on the page there is a section on WPF)
http://developer.xamarin.com/guides/cross-platform/xamarin-forms/working-with/databases/
I had an error during an in place upgrade of DNN 7. the error occured during the installation of the new providers from the install/providers folder. SPecifically i think it was during the rad editor provider upgrade.
here is the error:
2013-08-27 17:40:54,149 [WS048][Thread:6][FATAL]
DotNetNuke.Web.Common.Internal.DotNetNukeHttpApplication -
System.Web.HttpUnhandledException (0x80004005): Exception of type
'System.Web.HttpUnhandledException' was thrown. --->
ICSharpCode.SharpZipLib.ZipException: System.ApplicationException:
Unknown block type 7 at
ICSharpCode.SharpZipLib.Zip.Compression.Inflater.Decode() at
ICSharpCode.SharpZipLib.Zip.Compression.Inflater.Inflate(Byte[] buf,
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously) 2013-08-27 17:42:59,589
[WS048][Thread:6][ERROR]
DotNetNuke.Common.Internal.ServicesRoutingManager - Unable to register
service routes System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
System.BadImageFormatException: Could not load file or assembly
'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral,
PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The
module was expected to contain an assembly manifest.
Server stack trace: at
System.Net.Http.Formatting.JsonMediaTypeFormatter..ctor() at
System.Net.Http.Formatting.MediaTypeFormatterCollection.CreateDefaultFormatters()
at System.Web.Http.HttpConfiguration..ctor(HttpRouteCollection routes)
at System.Web.Http.GlobalConfiguration.<.cctor>b__0() at
System.Lazy`1.CreateValue()
This makes me think it was a blocked zip file, but I double checked to make sure the zip file was unblocked
Question: Does someone know where this error comes from? Or how can I figure out more specifically where it is comming from
thanks
EDIT #1
So I restored from a backup and tried again, I got the same error but at a different install/provider zip file. I am not sure what is causing this. This error seems to indicate the zip files are corrupted and are not downloaded/uploaded correctly.
EDIT #2
is there a chance that my ftp client is corrupting the zip files during upload? This has been going on for three days with well over a dozen different attempts to upgrade to various versions. I've never had this difficulty with a dnn upgrade ever and I've been using it for years.
It is definitely possible that you're getting corruption issues somewhere.
I would start by downloading the UPGRADE package again, extracting them using 7zip instead of Windows Compression, then try the upload. Maybe try a new FTP client, or see if you can RDP into the machine instead of FTP
Every time I open existing or creating a new Windows Presentation Foundation project I get this error:
Could not load file or assembly 'Microsoft.Windows.Design.Extensibility, Version = 4.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.'
Cannot find file.
Tried to resolve using different guides or examples. But I am totally lost...
Hope you can help me!
Thanks, Big D!
I am using the Microsoft.Build.BuildEngine to build a number of projects. Projects that do not use Silverlight are building correctly while projects that do use Silverlight are not building. All of these projects (Silverlight and non-Silverlight) all build fine through Visual Studio 2008. I get the error message:
error CS0234: The type or namespace name 'SilverlightControls' does not exist in the
namespace 'System.Web.UI' (are you missing an assembly reference?)
I've added System.Web.Silverlight to the project that is doing the build using Microsoft.Build.BuildEngine. I am able to see that namespace in the project doing the build also (so it appears that the project doing the build does have access to System.Web.UI).
Any ideas on how I can avoid that error?
Turned up the verbosity on the build through VS2008 and compared to the log created from the Microsoft.Build.BuildEngine. It looks like the Microsoft.Build.BuildEngine is producing lines like:
Considered "c:\Program Files\Reference Assemblies\Microsoft\Framework
\v3.5\System.Web.Silverlight.dll", but it didn't exist.
It doesn't exist in that location, should it? There are actually a number of locations that it looks for that dll and doesn't find it. I added the reference by right clicking, add reference, .Net, add. There doesn't appear to be a System.Web.Silverlight.dll on my machine (which is odd because the project does compile using VS2008).
Comparing the possibly relevant sections of the two logs:
Microsoft.Build.BuildEngine
For SearchPath "{GAC}".
Considered "System.Web.Silverlight, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL", which was not found in
the GAC.
Visual Studio 2008
System.Web.Silverlight, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
Manually added System.Web.Silverlight to the path that the Microsoft.Build.BuildEngine was looking for it (coppied it from the output directory when I build the project via VS2008). This solved that problem, but I now get the following errors on the Silverlight components of the solution:
C:\Program Files\MSBuild\Microsoft\Silverlight
\v2.0\Microsoft.Silverlight.Common.targets(95,9): error : The Silverlight 2 SDK is not
installed.
Any ideas?
In the application that is running the Microsoft.Build.BuildEngine I changed the type of build from Any CPU to x86. This has now made the application be able to build the target as expected.
So you're programmatically building using the MSBuild APIs?
It may be useful to add an ILogger (e.g. that just prints to the console) to engine.Loggers, and compare the output with the output window in VS (after setting e.g. 'tools\options\project & solutions\build & run\msbuild output verbosity' to verbose)... seems like somehow the environment is causing assemblies to resolve differently?
Set build type of project to Any. This helps. Happy coding...