How can I get an MSDN Moles tutorial to build? - moles

I have an unusual question. I need help in understanding an original poster's own answer to his 6-month-old query on the MSDN forums.
The OP was told to ask further questions on StackOverflow, so there's no point in asking the OP to clarify his answer. I would be grateful for some help on this forum. I hope I'm not violating any forum rules or etiquette rules.
I'll just copy and paste the relevant snippets from the posts, in chronological order.
[OP]
I'm following the Unit Testing with Microsoft Moles Tutorial (http://research.microsoft.com/en-us/projects/pex/molestutorial.pdf) and getting stuck with step #5 in Task 2: Create Code Generated Stubs.
I cannot resolve SIFileSystem (compilation error as it cannot be found).
[OP]
I finally made the program to compile. But in case anybody else stumbled with this post and have the same problem, here's what I did:
- In StubsTutorialTest project, open mscorlib.moles
- Change the assembly name from "mscorlib" to "StubsTutorial"
- Rename mscorlib.moles to StubsTutorial.moles
- Build (this will add StubsTutorial.Moles in the references)
- Add "using StubsTutorial.Moles" in UnitTest.cs
The not found error in "var fs = new SIFileSystem();" is gone.
[MSDN moderator]
Next time you run into problems, Peli and the rest of the Pex and Moles Development team now tend to monitor the forums at Stack:
https://stackoverflow.com/questions/tagged/pex-and-moles
[Back to me]
So here are my questions:
In StubsTutorialTest project, open mscorlib.moles
mscorlib.moles in never mentioned in the tutorial. Anyway, how can someone open a DLL?
(There's actually a "mscorlib.moles.dll" in the Moles download.)
Change the assembly name from "mscorlib" to "StubsTutorial"
In my "StubsTutorial.csproj", there's no mention of "mscorlib". I have the line:
StubsTutorial
Rename mscorlib.moles to StubsTutorial.moles
Does he mean that I should add "mscorlib.Moles" as a reference, then rename it? Is that possible?
Thanks for any help.

I believe what OP did was manually create a .moles file for the Tutorial assembly, by modifying the content and name of the mscorlib.moles file. The problem is that OP did not perform Task 2 Step 1:
In Visual Studio, open the test project StubsTutorialTest, open the References node, right-click the StubsTutorial reference node and select Add Moles Assembly.
This is the easy way to create a .moles file.

Related

Deploying solution with mulitple windows forms projects

I apologize if this has been answered in another post, I can't seem to find it if it has. Anyway, I have built a back end utility for a fellow streamer friend of mine but I can't seem to figure out what I'm doing wrong when it comes to deploying it. This is a project that will be expanded on in the future, and possibly have more windows form projects. So here is what I am running into (With Pictures):
Here is my solution explorer with the projects:
When I go to build the deployment I've tried making all the projects "outputs" and got this error. Thinking it was there were too many Project Outputs I changed it to where the startup project would be the output and the others would be either source or content files. Still got these errors. Here is the File System Setup:
And when I go to run the build to create the deployment, here are the errors I receive:
I don't know/don't see what I am doing wrong here and would very much appreciate a point in the right direction. Thank you all so much in advance.
Check your updates. I remember there is an option to review or check the status of latest updates.
I found this article about that issue but it looks like a general error with updates or the installation
It is not too long but maybe it does not help. I hope it helps, good luck

'Parse/ParseClientConfiguration.h' file not found

I am trying to make a project using Parse. My project used to work before Swift 3.0 update. Yesterday I decided to upgrade my project code to Swift 3.0. I also updated Parse to its latest version which I used pods to do it. I get these 2 errors which I couldn't find a solution to. I deleted Parse and then reinstalled again using Pods but that didn't fix the problem.
(Can't post pictures because I don't have enough reputation :/)
(Can't post more than 2 links too :/)
Error #1:
http://i.imgur.com/oeGeU2V.png
Error #2:
http://i.imgur.com/urYEWxk.png
Proof of having the required file:
These are the 2 errors that I am encountering right now. When I remove the ParseClientConfiguration.h I also get the same error twice.
Error #1 twice:
While answering keep in mind that I am not a very experienced programmer. You may have to explain some parts more detailed. If you need more information I would gladly provide them.
Deleting "Derived Data" solved my problem.
How to delete "Derived Data":
https://stackoverflow.com/a/39495772/7188022
Most likely you ran into this, because you ignored
"From now on you’ll open the workspace file instead of the project file"
like I did.
A single line, which can easily bee overseen at the Install Guide

Accidentally published CompositeC1 with precompile on

I accidentally published Composite C1 from Visual Studio with "Precompile during publishing" when I first set it up and have now come to realize that several plugins do not work with precompile turned on. Unfortunately I have no idea how to reverse this. I've tried several things to no avail. I usually end up with a 500.0 error. If I go to the admin interface everything is working properly, and I can even preview the pages, but from the customer side all I get is a 500.0 error.
Of course I could republish from the Visual Studio project I have, but that project has the default template on it. I've tried copying what appears to be changed on the server to the original project but I end up with a 500 error. I've tried removing all the precompiled stuff on the server but I end up with a 500 error. I'm pretty lost.
At this point I'm willing to do anything. Is there a doc explaining how to copy the content to a newly downloaded copy, kind of like an upgrade doc but "side-grading"? I am using the most current version at the time of writing this 4.2 Update 1
Thank you
Solved use the PackageCreator suggested by wysocki's answer. It was not exactly straight forward to create the package. The errors can very cryptic at times. So here are some of the issues I encountered and how I got past them:
wysocki was correct to suggesting starting with a bare bones installation even though my original project was started with the Venus theme. I tried both ways.
I encountered issues with the MasterLayout and the Page Template Features which are currently not supported by the PackageCreator, although they may be supported in future versions. The solution was to add the missing elements to the fresh C1 project from the original C1 installation in the App_Data/PageTemplates and App_Data/PageTemplateFeatures folders.
A few times I ran into an issue where I added the same page or function twice to the PackageCreator. This was obviously my fault, but it should be mentioned that you can add the same site element twice which throws and error on import. Make sure you are careful to only getting one of each when creating the package to be exported.
If you are getting and error and it uses and Id like "4061397b-ee9e-4512-984d-f2b2d41eb654" I've found that it was very helpful to extract the zip file you are trying to import and then search the extracted folders for that Id. The lines with the Id usually have more information on them that will help you to identify exactly what content page or whatever the error is being generated from.
If you are using installed packages in your project like SimpleSearch for example, make sure you don't add it's functions to the PackageCreator. Install them separately.
I had an issue where I somehow had an element in the Data section that didn't have a "type". The error simply "The type cannot be empty". This was obviously tough to find so I suppose the lesson is, less is more. If you think your project might have a few elements that are unnecessary, don't add them at first and see if the project you import them into complains about missing them. It's much easier to troubleshoot missing elements than it is to figure out which element is causing the issue that you really didn't need.
Is there a doc explaining how to copy the content to a newly downloaded copy
You can try and export content / templates / anything else related to a "package" via Composite.Tools.PackageCreator.
Its latest version gives you quite a lot of flexibility in what you can export ("package") - please its user manual.
Once the package is made and downloaded, you can go on and install it on a new website. If you export / import a lot of content / templates etc, it makes sense to have a "Bare Bones" site as the new one.
All the starter sites like "Neptune", "Venus" are installed as a bunch of packages in specific order during Composite C1's initial setup.

Groovy debugger out of sync

I am having a difficulty while attempting to debug some code in grails. It is difficult to put into text, so I have posted a screencast showing exactly what the problem is here. In short, while I am debugging the debugger starts jumping from place to place and not following the program logic I have in place. The only other similar question I have found is a year old, had no solution, and can be found here.
The best guess I have so far is that the debugger is displaying the text I have typed in, but is actually executing an older version of the class file which it has cached somewhere. Therefore, I tried:
cleaning the project
manually deleting all of the class files from the target folder and from the target-eclipse folder
Searching my entire hdd for additional files with similar names
removing my project from the workspace and re-adding it
closing and reopening the IDE
grails refresh-dependencies
Importing the project into a new IDE (I was using GGTS, I switched to IntelliJ)
None of those solutions had any effect. I realized that the issue was in a .groovy file, and I was writing almost pure Java, so I deleted the .groovy file, and re-created the class in a .java file. That solved my problem. Unfortunately I am having the problem again, and this time it is in a controller that heavily relies on the grails framework, so that solution is not an option. Other than also being in a .groovy file, another similarity is that the code breaks on an if statement.
My next steps:
Verify that the application is not executing the code I see by using print functions to monitor actual execution flow.
comment out the entire function and re-add functionality one line at a time to see if I can see what breaks it.
Delete the .groovy file, and re-create it as another .groovy file.
Any help is appreciated, and since I can't find any answers online I will continue to update this question as I learn more.
See my comment on the jira issue that you raised. You have found a problem with the groovy compiler and how it calculates line numbers. This is not a problem with executing the wrong class files or using a broken debugger. The debugger is doing exactly what it is expected to do. It is the compiler that is providing erroneous line number information.
The next step, as described in the issue, is to provide a simple project that recreates the bug. I tried to do so myself, but could not. So, please supply something that we can work with. Then we can notify the groovy compiler team.

Is there a workaround for the following VSTO Word 2010 word addin click once deployment error?

When deploying a Word Add in , which publishes without error. I get the following error after the files have been copied.
I do not have much to go on. This is the stack trace.
************** Exception Text **************
System.ArgumentException: Value does not fall within the expected range.
at System.Deployment.Internal.Isolation.IActContext.ApplicationBasePath(UInt32 Flags, String& ApplicationPath)
at System.ActivationContext.get_ApplicationDirectory()
at System.AppDomainSetup..ctor(ActivationArguments activationArguments)
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.CreateAppDomainSetup(ActivationContext context, Uri deploymentManifestUri, AddInInstallationStatus installStatus)
at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()
here's an answer to what you are looking for:-
the problem:-
open Process Monitor during the failed update and see if Winword.exe is browsing the following registry key->
HKCU\Software\Classes\Software\Microsoft\Windows\CurrentVersion\Deployment\SideBySide\2.0\Marks\mmiw..vsto_510943deeecbc925_0002.0000_2055f5031035ea75\appid
in this someone managed to check the Compatibility Mode checkbox for Word, running it default under Windows XP SP2 (see if you can make the program compatibile with your system in short).
if this is not the issue
Then read further into this :- deploy a VS 2008 SP1 Word 2007
There is another post i have found on this topic HERE. it shows a possible work around that you could try to get a result? i'm not entirely sure but in this, the developer was using outlook 2008, i think he removed the instances of outlook within his code and re-implemented parts of it and left out others. Perhaps this could be a temporary fix or help you understand what the problem is?
(I'm sorry my answers aren't so clear, i don't have much time for stack overflow at the moment, i will clean up the answer when i have more time(it will flow)) ++ this is all i can find regarding this error, but there are people with the same issue on the Microsoft forums, maybe you could find an answer faster on there? if you follow the links I've posted you should be able to find some information that might be able to give you a decent fix.
PS. if this doesn't work, reply asap and i will search asap, i think I've found something else which might be of use, just have to understand it myself before i post.
I recently came across this problem too after messing with some dependencies. None of the noted solutions worked (either on MSDN or here).
How I fixed it:
Find an old published version that worked.
Find the .dll.manifest file.
Diff that manifest with the one that is erroring.
In my case, I saw that a .dll was incorrectly referenced there (I thus had a v2 of it and a v4). I removed this reference and, thank god, it works.