What is the list of all NGen artifacts that we should add to our UWF write filter exceptions list? - copy-protection

I know that Ngen places its assemblies in C:\windows\assembly\NativesImages_*. But I also know that it keeps track of the references for each assembly so that if B and C depends on A then uninstalling B doesn't uninstall A. This makes me conclude that there are at least another location NGen uses to keep track of the reference count and any other related metadata, am I right?
The problem is that I am getting "Ngen error because Mscorlib.dll does not have a native image" and nothing gets optimized.

So as I expected, NGen uses the Windows Registry to do its book keeping. Adding the following exceptions solved my problem:
uwfmgr registry add-exclusion "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework"
uwfmgr registry add-exclusion "HKEY_LOCAL_MACHINE\SOTWARE\Microsoft\Net Framework Setup"

Related

Xcode build error - Multiple commands produce .o, Target 'ProjectCoreData' has compile command for Swift source files listed twice

I am running xCode Version 10.1 (10B61), Mojave 10.14 (18A391)
Searching shows similar issue in Xcode 10 greater than a year ago, but no issues since then. The solution from last year seemed to be switching to legacy mode, but that doesn't work now. It appears the source code that is stored on my desktop is conflicting with code that is in 'DerivedData', I'm not sure why this would suddenly pop up so randomly.
I see this problem go away if I remove the last model added in Core Data. It seems to trigger when I add a relationship to another object. It's apparently random.
Any advice on how to fix this issue so I can develop?
Multiple commands produce '//Library/Developer/Xcode/DerivedData/ProjectCoreData-ehjvvgovpitmbcegzopwciptfafr/Build/Intermediates.noindex/ProjectCoreData.build/Debug-iphonesimulator/ProjectCoreData.build/Objects-normal/x86_64/Contact+CoreDataClass.o':
Target 'ProjectCoreData' (project 'ProjectCoreData') has compile command for Swift source files
Target 'ProjectCoreData' (project 'ProjectCoreData') has compile command for Swift source files
from the logs:
<unknown>:0: error: filename "Contact+CoreDataClass.swift" used twice: '/Users/<user>/Desktop/ProjectCoreData/Contact+CoreDataClass.swift' and '/Users/<user>/Library/Developer/Xcode/DerivedData/ProjectCoreData-ehjvvgovpitmbcegzopwciptfafr/Build/Intermediates.noindex/ProjectCoreData.build/Debug-iphonesimulator/ProjectCoreData.build/DerivedSources/CoreDataGenerated/ProjectCoreData/Contact+CoreDataClass.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
<unknown>:0: error: filename "Contact+CoreDataProperties.swift" used twice: '/Users/<user>/Desktop/ProjectCoreData/Contact+CoreDataProperties.swift' and '/Users/<user>/Library/Developer/Xcode/DerivedData/ProjectCoreData-ehjvvgovpitmbcegzopwciptfafr/Build/Intermediates.noindex/ProjectCoreData.build/Debug-iphonesimulator/ProjectCoreData.build/DerivedSources/CoreDataGenerated/ProjectCoreData/Contact+CoreDataProperties.swift'
<unknown>:0: note: filenames are used to distinguish private declarations with the same name
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
The reason you see this error is because Core Data creates these files by default, but you can't see them in Project Navigator. Then you create a duplicate (in Editor/Create NSManagedObject Subclass). As a result you have your error.
According to What's new in Core Data here is a picture with the solution:
For future users :
If you are using core data and If you copied entity using option+drag, then ensure that entity name and class name must be same.
None of the solutions mentioned over internet worked for me.
It happened to me after I dragged the coredata model and classes from another project, which generated duplicate files. If this is your case, go to TARGETS->Build Phases->Compile Sources, remove the duplicate files and it should be working again.
for me it was simple problem,
i had 2 source files of the exact same name,
just renamed one of them (only the swift file name) and the problem was gone
To fix this I've to open the .xcdatamodeld using finder/show package content
This image
and then repeat this operation with the .xcdatamodel.
This option
After this I've opened the file (I use Sublime) Sublime Text locate the duplicate class name Duplicate Class Name, change it, save the file and build again. Like this

Trying to understand why Swift code compiles but can't link due to undefined symbols

I have a issue with the link phase failing due to undefined symbols. I'm looking to understand the general issue rather than a copy/paste solution for my specific setup.
Let's say I have 2 frameworks, and 1 target. framework B is linked to framework A and the target links with framework A only. The target does not link directly with framework B.
Swift files that contain "import A" are successfully compiling even though they reference objects contained in framework B. I guessing this is because the linkage between A > B makes all of B available when I import A.
However during the link phase, I get undefined symbol errors for anything contained in framework B. Adding "import B" in my file will again compile successfully, but still fail with the same link errors. Linking only succeeds If I directly link the target framework B.
I'd like for either of two scenarios to work:
Linking with framework A and "import A" also makes the link phase see symbols from framework B
Compilation fails to find objects in framework B unless I directly link with framework B and "import B"
Can someone shed some light on which of these scenarios is the "correct" one and why?
Thanks very much!

Remove/Add References and Compile antique VB6 application using Powershell

I've been given the task of researching whether one can use Powershell to automate the managing of References in VB6 application and then compile it's projects afterwards.
There are 3 projects. I requirement is to remove a specific reference in each project. Then, compile projects from bottom up (server > client > interface) and add reference back in along the way. (remove references, compile server.dll >add client reference to server.dll, compile client.dll > add interface reference to client.dll, compile interface.exe)
I'm thinking no, but I was still given the task of finding out for sure. Of course, where does one go to find this out? Why here of course, StackOverflow.
References are stored in the project .VBP files which are just text files. A given reference takes up exactly one line of the file.
For example, here is a reference to DAO database components:
Reference=*\G{00025E01-0000-0000-C000-000000000046}#5.0#0#C:\WINDOWS\SysWow64\dao360.dll#Microsoft DAO 3.6 Object Library
The most important info is everything to the left of the path which contains the GUID (i.e., the unique identifier of the library, more or less). The filespec and description text are unimportant as VB6 will update that to whatever it finds in the registry for the referenced DLL.
An alternate form of reference is for GUI controls, such as:
Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; tabctl32.ocx
which for whatever reason never seem to have a path anyway. Most likely you will not need to modify this type of reference, because it would almost certainly break forms in the project which rely on them.
So in your Powershell script, the key task would be to either add or remove the individual reference lines mentioned in the question. Unless you are using no form of binary compatibility, the GUID will remain stable. Therefore, you could essentially hardcode the strings you need to add/remove.
Aside from all that, its worth thinking through why you need to take this approach at all. Normally to build a VB6 solution it is totally unnecessary to add/remove references along the way. Also depending on your choice of deployment techniques, you are probably using either project or binary compatibility which tends to keep the references stable.
Lastly, I'll mention that there are existing tools such as Kinook's Visual Build Pro which already know how to build groups of VB6 projects and if using a 3rd party tool like that is an option, could save you a lot of work.

EF broken after update database. A namespace cannot contain members such as fields or methods

I have researched this topic and pulled up a couple of hits that I thought might have helped me. So far I am still pulling out my hair over here because everything was fine until I added a field to a table in Azure and then tried to update my model.
Here's a short sitrep of what the problems have been and what I have done to solve them.
Problem 1
Compiling transformation: Metadata file 'C:\Program Files\VS2013\Common7\Tools..\IDE\Microsoft.Data.Entity.Design.dll' could not be found
Compiling transformation: Metadata file 'C:\Program Files\VS2013\Common7\Tools..\IDE\EntityFramework.dll' could not be found
I solved the problem by changing my global environment variable in advanced system properties to the correct location of these files, which in my case was : F:\Program Files (x86)\Common7\IDE
This is probably due to the fact that I just installed VS 2013 ultimate on my F drive; however, I have been developing on it successfully now for a week and never had a problem until now.
After this I run into problem 2:
Problem 2
A namespace cannot directly contain members such as fields or methods C:\Users\Adrian.Campos\Documents\Visual Studio 2013\Projects\ConsoleApplication2\ConsoleApplication2\Model1.cs 1 1 ConsoleApplication2
As you can see the problem is arising from my Model1.cs class. My .edmx file is named model1 (fyi)
I found some links that weren't of help to me since my error is coming from a different source than that of the links.
VS2012: My Entity Framework model doesn´t get included to my project output using InstallShield
A namespace cannot directly contain members such as fields or methods.
A namespace cannot directly contain members... + Type or namespace definition, or end-of-file expected errors
That last link seemed the most promising; however, it did not fix my problem. What I do not understand is how in the world did everything just blow up after I updated my model?
Has anyone else experienced this and fixed it?

What happened to the Rx Switch() operator?

I am working my way through the Hands-On-Labs for reactive extensions (Rx HOL .NET.pdf) which I downloaded from the data developer center (here) a few days ago.
I added these references to my project, using NuGet:
System.Reactive 1.0.10621.0
System.Reactive.Windows.Forms 1.0.10621.0
I'm almost done with the labs, but I've hit a snag trying to implement the .Switch() example, Visual Studio can't locate the extension method:
'System.IObservable'
does not contain a definition for
'Switch' and no extension method
'Switch' accepting a first argument of
type
'System.IObservable'
could be found (are you missing a
using directive or an assembly
reference?)
Now I know this Hands On Labs document is out of date, because certain things have been renamed (FromEvent became FromEventPattern) and certain things were removed (RemoveTimeStamp) and this document does not reflect that. For the life of me I cannot guess what they renamed Switch to be, or figure out what assembly they might have moved it to, or find a comprehensive list of release notes that indicate it was removed.
Anyone know where I can find Switch and what it's current name is?
The Switch extension method doesn't extend IObservable<T> - it extends IObservable<IObservable<T>>. The full signature is:
IObservable<TSource> Switch<TSource>(this IObservable<IObservable<TSource>> sources)
Try typing Observable.Empty<IObservable<object>>(). and see if Switch appears then.
If not, check your using namespace declarations.