'Duplicate entry' error in DLL when building Desktop Bridge UWP application - desktop-bridge

I am trying to convert a Windows Forms application to UWP using the Desktop Bridge. Since I have (most of) the source code, I'm attempting the conversion using Visual Studio, as opposed to the command-line tool. My application uses some third-party DLLs whose source code I don't have.
After adding a new JavaScript UWP project to my solution, I'm placing the original application's DLLs in a project subfolder as explained in the documentation.
Some of these DLLs are causing strange errors when I build the UWP project. The errors seem to be caused by duplicate resource entries in the DLLs, but curiously enough, these DLLs are referenced without issue in my standard Windows Forms project.
The errors state:
Duplicate entry
'DevExpress.Data.PropertyNamesRes/DevExpress/XtraPrinting/XpsDocumentOptions'
or one of its parents is defined as both resource and scope, which is
not allowed
I've been digging and searching about these errors for hours but I haven't found any meaningful information. I also used ILDASM to analyze the DLL headers but found no obvious issues in them. Has anyone here faced similar issues? Thanks in advance for any information.

Without seeing the complete error is difficult to say, but I've seen similar errors processing resources. If this is the case, this could be the same as this issue
And can be solved adding this property to the jsproj:
<AppxGeneratePrisForPortableLibrariesEnabled>false</AppxGeneratePrisForPortableLibrariesEnabled>

Related

problems setting up aspnetcore-angular2-universal example seed

We are for some time now trying to find a solution for server prerendering of SPA, specifically Angular4, for the purpose of SEO.
We have come to try and use aspnetcore-angular2-universal, which seems to be the perfect solution, however, we encounter problems deploying the published build to a local IIS server.
We have posted an issue regarding the problem on the issues page at which can be found here:
https://github.com/MarkPieszak/aspnetcore-angular2-universal/issues/491
We have followed the instruction under "Getting started" & "Deploy" (which can be found here: https://github.com/MarkPieszak/aspnetcore-angular2-universal) exactly but the error still exist.
The support is unresponsive on issues and thus we are posting also here.
The problem is (as mention in the issue linked here) that we get the following error:
Which indicates a problem with the web.config file. However the webconfig file is exactly as supplied in the starter project and seems also legit.
I should mention that building and running the project using npm build:prod and dotnet run works and we can lunch an in memory application from Visual Studio Code, however when taking the published folder to an IIS folder the error occurs.
Any help will be appreciated.
Did you installed .NET Core Windows Server Hosting bundle?
Check if AspNetCoreModule listed in IIS => Modules. Sometimes it not installed properly during #1, even if there was "Succeeded" at all steps. In that case I just removing it via Program & Features, and reinstalling it then.
Once I saw that error when manually copied web.config from sources over the publish folder. Problem is that original web.config contains placeholders like %LAUNCHER_PATH% and %LAUNCHER_ARGS%, which turns to appropriate values (dotnet and .\YourApp.dll for instance) during dotnet publish
Aperantly there were incompebilities between angular5 & universal in serverside.
The https://github.com/MarkPieszak/aspnetcore-angular2-universal seed was downgraded to using angular4.3 instead of 5. When we updated seed, the problem was solved.

Cannot Build Xamarin.Forms From Source Code

I have downloaded the Xamarin.Forms solution from GitHub and I am trying to build the solution. Visual Studio does not build, generating more than 70 errors, as simple as the one below:
"The type or namespace name 'IOnClickListener' could not be found (are
you missing a using directive or an assembly reference?"in
Xamarin.Forms.Platform.Android\AppCompat\ButtonRenderer.cs
When I investigate the code, I see that there is really no reference to Android.Views.View in the using statements, so it seems fair.
Am I making a mistake somewhere?
It's not easy to get to the answer without digging into the logs but here are some steps that have helped me in the past.
Android Specific Steps:
Check the logs for any problems that stand out, look at the top most error first and work your way down. Output window -> Show output from Xamarin Diagnostic
If you find unzipping problems you might have to visit the Xamarin folders to delete the zip causing problems and Xamarin will download a new one.
C:\Users{USER}\AppData\Local\Xamarin
If you get loads of Xaml and Resource errors you might have to delete the contents of the file.
Resources\Resource.Designer.cs
After deleting the content(not the file), clean the solution, rebuild the project.
If you still have problems try to either downgrade Xamarin.Forms or upgrade it.
Change Api level to a higher one on the project properties.
Hope one of these helps.

.NET 2.0 issue with assembly not found

i have to fight against a strange issue in my company. we have 2 .net 2.0 (old, i know) apps, which start with an .asmx-file. the code-behind calls a c#-file, which includes a include abcd directive, whereby abcd originates from a 3rd-party company.
one app is in test and it works fine. the identical one is in production and fails with the error Could not load file or assembly 'abcd.dll' or one of its dependencies. The specified module could not be found.
when i look in the related web.config-files, none of them includes a pointer to abcd.dll, which i first do not understand in the context of the productive environment, where everything works. secondly when i look inside the \bin-folder, i see the related assembly/dll. again: this is identical in both systems.
the only difference of both systems is the fact that visual studio 2.0 (does this really exist?) is available on the test system.
please note: i am aware that assemblies have to be added via solution explorer in visual studio too. but i cannot do this as such an installation is not allowed here. but again: in web.config on the test server no reference can be found in the related web.config and everythings works fine.
so my question is: how to get this thing working in productive env?
thanks in advance
You may want to run Dependency Walker (depends.exe) http://www.dependencywalker.com/ and point it at to detect if any dependencies are missing.
I'd also look in the GAC (C:\Windows\assembly) to see if there are any related differences there.
Also, compare IIS setting on the two machines.

ASP.NET Web Reference Missing from DLL

I am working with a .NET 3.5 class library that was created in Visual Studio 2008, and later updated and recompiled in Visual Studio 2010. The strangest thing is happening: One of the Web References that is listed in the Solution Explorer does not actually compile into the DLL (proven by inspecting the DLL with .NET Reflector), and there are no errors or warnings respectively. I tried Googling and searching this site and I could not find any applicable information. Any advice about why this is occurring will be greatly appreciated! Hopefully the information provided is enough; otherwise I should be able to provide more.
Edit: The namespace for the Web Reference shows up in the Solution Explorer, but not in the Object Browser. Some of my colleagues are saying that this is an issue with the Web service itself. I should mention that it is an SAP Web service and during development we are interfacing with a test environment that was recently upgraded and could be acting problematically. I will confirm whether this is the cause once I am more certain, so please don't hesitate to share any relevant information meanwhile.
Edit (2): See my first response to Cyborgx37's answer for further clarification including the client-side error that is generated.
This is slightly baffling: All I did to get the Web Reference into the Object Browser - and hence into the actual DLL at compile time - was rename it to something else, and then revert it back to its old name (which was optional to keep the name the same). Gotta love strange Microsoft issues. Hopefully this helps someone else who ends up running into the same issue!
If I understand correctly, you are wondering why the referenced assembly is not compiled into your DLL.
Referenced assemblies are typically not compiled into the DLL. Your DLL will instead contain a pointer to the external resource and .NET will attempt one of several strategies for locating it (and then loading it into memory so your application can use it).
You may find this article enlightening:
How the Runtime Locates Assemblies
To successfully deploy your .NET Framework application, you must understand how the common language runtime locates and binds to the assemblies that make up your application. ...

MSBuild fails on temporary ASP.NET files

I'm trying to set up Jenkins with MSBuild plugin. I got Jenkins to check out solution from repository and run a build. But every build fails with several
error CS0433: The type 'CustomControls_WarningPopup' exists in both (...)
WarningPopup is an .ascx defined twice - once per web site project, and there are two website projects in the solution. The thing is this never rises any problems when compiling whole solution from VS2010. Should I run MSBuild with some specific parameters to make it behaving like VS?
I already tried moving Temporary ASP.NET files to custom folder (like in this answer) and it didn't help. Probably I'm missing something obvious to CI experts here...
I found the cause. There was another UserControl in second project which accidentally inherited class of the same name. Both controls were in the same directory and nor Visual Studio during compilation nor ReSharper saw anything wrong with this. Moreover MSBuild threw errors in both Web Projects despite the duplicated control was in only one of them. The funniest part is that this situation was like this for months and never rised any problems...
Anyway changing class of this control solved the issue and finally automated build succeeded!

Resources