VS2017 15.4 Preview "Windows Application Packaging Project" tool failed to generate a working app - wpf

I added the new "Windows Application Packaging Project" that comes with vs2017 15.4 preview.
When adding my project to the "Applications" and debugging the packaging project I have the following error:
System.IO.FileNotFoundException: 'Could not load file or assembly
'System.Runtime, Version=4.1.2.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The
system cannot find the file specified.'
InnerException: FileNotFoundException: Could not load file or assembly
'System.Runtime, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The
system cannot find the file specified.
My project is running perfectly if I debug it directly or run it directly using the EXE.
If I extract the files from the .appxbundle and try to start the EXE, it doesn't work either. (XXXXXX.appxbundle\XXXXXX.appx\*.*)
I noticed that in the extracted .appxbundle folder, all System.XXX DLLs are not there. They should be (94 dlls are missing).
Is there a problem with the packaging tool ?
UPDATE:
Link to dev portal: https://developercommunity.visualstudio.com/content/problem/122252/windows-application-packaging-project-tool-failed.html

This is very likely a bug in the way the packaging project is collecting files. Looks like we're already tracking this bug in the Developer Community. Also, we're tracking another related issue for ClickOnce.

Related

Log errors for 2sxc in DNN

Recently I have installed last version of DNN (9.10.2) and last LTS version of 2sxc (12.8.1)
Everything is working as expected but after check DNN logs I found this error
DotNetNuke.Web.Mvc.Extensions.StartupExtensions - Unable to configure services for ToSic.Sxc, Version=12.8.1.26412, Culture=neutral, PublicKeyToken=null, see exception for details
- LoaderException: Could not load file or assembly 'Microsoft.AspNetCore.Http.Features, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified.
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at DotNetNuke.DependencyInjection.Extensions.TypeExtensions.SafeGetTypes(Assembly assembly, ILog logger)
As I said 2sxc is working without any problem but is generating in back those logs.
Maybe is needed to add or install some framework or component in server ?
ANY idea

Microsoft.Bcl.AsyncInterfaces error (in CSVHelper method) when running the application installed by Visual Studio Setup project

I have a WPF application that reads a CSV file using CSVHelper which I installed using NuGet. Here's the project, system, etc version info.
Microsoft Windows 7 Professional Version 6.1.7601 Service Pack 1 Build
7601
Microsoft Visual Studio Community 2019 Version 16.4.5
NuGet Package Manager 5.4.0
WPF Project Target Framework: .NET Framework 4.7.2
CSVHelper Version: 15.0.5
CSV reader method is straightforward; read a file and put it in a list. Nothing fancy. I'll link the entire project at the bottom so you can download and try it out if you want.
When I run the executable made in either Release or Debug builds, they work fine. They read the file, put contents in a list, and display on a DataGrid just fine. As a next step, I created a standard Visual Studio Setup project, and created an msi installer, which I used to install the app in my PC.
When I run that executable (which is in my Program Files directory), however, the application throws an exception. Here's the exception message and Stack Trace.
Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)
at ReadCSVTest.MainWindow.ReadPeopleList(String path, List`1& people, String& msg)
at ReadCSVTest.MainWindow..ctor()
Since the error says couldn't load the assembly Microsoft.Bcl.AsyncInterfaces, I added that from NuGet and ran everything again, and I still get the error. What's the problem here? What does it mean that Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context.? And why do I only get this exception when I run the executable installed by the Setup project?
Please download the entire project from HERE.
Just so anyone runs into the same issue in the future; as Jones suggested in the comments, downgrading each of the two libraries to following versions fixed the issue for me.
CsvHelper ==> 12.3.2
And
Microsoft.Bcl.AsyncInterfaces ==> 1.0.0

Server Error in '/' Application. Windows Serrver 2012 IIS 8

I received a webpage from a developer and when I try to install it on my fresh installation of Windows Server 2012 with IIS 8 I get the following error:
Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
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.IO.FileNotFoundException: Could not load file or assembly 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I tried to download Windows SDK on my laptop and then copy the gacutil.exe onto the server and run:
C:\tmp>gacutil.exe /I C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages.Razor.dll
But I still get the same error. Anyone familiar with this?
I am no .NET-developer what so ever. I have no idea what to do. Do I need to install something else on my Windows Server?
You are missing the System.Web.WebPges.Razor file from the bin directory of the web application. Unless that version is installed in the GAC, try putting a copy of it in the bin directory so the application can access it.

WCF RIA services and System.ServiceModel.DomainServices.Hosting

I am developing my first project using WCF RIA services. I was able to build a small application and ran it successfuly on localhost. When tried to upload on a server, I got the following error when browsing it :
"Could not load file or assembly
'System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The system cannot find the file specified"
I looked for this reference on my project and did not find it. I tried to add it from C:\Program Files (x86)\Microsoft SDKs\RIA Services\v1.0\Libraries\Server, but Visual Studio warns me:
You cant add a reference to
System.ServiceModel.DomainServices.Hosting.dll as it was not built
against the silverlight runtime.silverlight projects will only work
with silverlight assemblies
What should I do?
Thanks
Found the problem: on my .Web under references, found the needed dll.On properties, changed copy local to True

How do I use Microsoft.Build.BuildEngine to Build a Silverlight project?

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...

Resources