NuPeek Symbols doesn't download source in Visual Studio 2012 - visual-studio-2012

We recently installed NuPeek for our NuGet repository and NuPeek as symbols server.
NuGet works (above) fine. It was set up within an hour.
The Symbols Server on the other hand is a different story. Packages are pushed to NuPeek (normal packages and symbol packages). I see on the server that both are picked up and placed in the correct folder (source files too, .cs in this case).
I have set up Visual Studio so it can find the correct symbols server. When I create a new project, install the package (that also has a symbols package), use the code from that package and try to debug it, the following happens:
In the cache folder the "package" is downloaded
The cache folder also has a src folder. Within a source folder which has a folder with the same name as the package -> version.
The version folder is empty
The folder cache/ packagename.pdb/guid/ packagename.pdb is present
Still, Visual Studio cannot find the correct CS file to show. After some digging in the NuPeek server folders I noticed the folder symbolsPath -> temp -> PackageName -> lib -> net45 is empty, while the symbols.nupkg clearly has sources (one cs-file to be excact).
I had this working before, but we switched servers (Azure website to Azure CloudService), but I'm 99% sure this is not the problem.
Am I missing something? Does anyone has any clue?
Thanks in advance!

Does anyone has any clue?
If anyone does then the author of the project, Jérémie Chassaing, would be the most likely candidate. Don't hesitate to add an issue to the issue tracker. Not much there right now and he looks pretty responsive so worth your time.
Do run through the setup checklist first:
Tools + Options, Debugging, Symbols, add http://myserver/NuPeek/symbols to the Symbol file locations list. Ensure that you have a valid Cache symbols directory selected
Tools + Options, Debugging, General, tick the "Enable source server support" option
Untick the "Enable Just My Code" option.
Tick the "Print source server diagnostics" option. Update your question with what you see in the Output window so we'll have a better shot at figuring out the real problem

Ok, this is an old question but as i found the solution today i'll post it here.
This is probably because you instaled NuPeek too deep in your website structure.
A bug in Nupeek requires that it is installed at the root level of your site (for ex: www.domain.com, and not www.domain.com/Nupeek/).
Else you can fix the bug in SymbolTools.cs, replace the SourceBaseUri getter code by this :
private static string SourceBaseUri
{
get
{
var httpRequest = HttpContext.Current.Request;
var applicationUri = new Uri(new Uri(httpRequest.Url.GetLeftPart(UriPartial.Scheme | UriPartial.Authority)), Path.Combine(httpRequest.ApplicationPath, "source"));
return applicationUri.ToString();
}
}
Hope this helps.

Related

How to debug problems with vc_redist bootstrapper?

I've got a Visual Studio installer project (a vdproj) that won't install the VC redistributables as a pre-requisite. I can't figure out why.
I'm using the latest updates to Visual Studio 2019, with the Installer Projects extension. Here are my prerequisite settings:
At install time I get an error that says vc_redist.x64.exe has changed since it was initially published. I checked bootstrap at C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64 and discovered that the URL found there (https://aka.ms/vs/16/release/14.26.55555/vc_redist.x64.exe) redirects to the main microsoft home page and downloads HTML rather than an executable. So I changed the URL, first to https://aka.ms/vs/16/release/vc_redist.x64.exe, then to https://aka.ms/vs/16/release/14.27.29016/vc_redist.x64.exe. Both of these URLs download a copy of VC_redist.x64.exe when you visit them with a web browser, but neither of them fixes the installer.
The only difference I see after changing the URL is that with the original URL I get a file named vcredist_x64\vc_redist.x64.exe in the temp install folder (but it's invalid, full of HTML), but with the two new URLs the vcredist_x64 folder is empty.
Any idea what I need to do to get this working?
I found the solution. I needed change the URL and the public key. Here are the steps you would follow to resolve an issue like this in the future:
Find the URL to a version that is still available. The latest version is currently available from here: https://aka.ms/vs/16/release/vc_redist.x64.exe. The version-specific URL to that same file is currently http://aka.ms/vs/16/release/14.27.29016/vc_redist.x64.exe.
Note the version number. If you don't already know it, you can get it by simply hovering over the downloaded file in file explorer.
Find the public key. I learned how to do that from an answer in this question. You find the key by right-clicking on vc_redist.x64.exe, selecting properties, Digital Signatures, then double-click on the sha1 entry. Click View Certificate, then Details, then Public key. Copy the value that shows up in the text box.
Remove all the spaces from the public key you copied. The public key for v14.27.29016 of vc_redist.x64.exe is:
3082010a02820101009208daf213e09ec32da6e2dfdaef8c19ec2f584f0bf53f20b806f33f91258f36cf27d114def85bd87d4f84f6e7f4b7b9d8940cc78cafa99627f60610fe36076121443cb15c163b7f6d8ef4111e33f6fffbd2bc87e69a446830bd488678ecf64422650cd8443618469f71490626470423939865f3f53b4603a24038ad547694ec14f5308f7695f651b882030d805dbd7b5b7256093153b0a99b6fd0ef73402adeb7a47e7d148668335f104a5c20b2fe0fb455dcce2e6891384dae8a00e76f57e315689a7561715364f2ada631cee9df691d03d9886ecd742e906e74469ac6b8f2e350adbe807e62ca0c8d4ba77d56328813697e6d65ff82653f4f4aebe33822cd0203010001
Open C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64\product.xml in a text editor, as administrator.
Replace the value of the PublicKey with the key you prepared in step 4.
In the BypassIf element, replace the Value with the version you noted in step 2. Save and close the file.
Open C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64\en\package.xml in a text editor, as admin.
Replace VCRedistExe with the URL from step 1. You can use either the generic or the version-specific URL. They both have drawbacks. Save and close the file.
Rebuild your installer.
You may need to make adjustments for your environment.
Regarding the choice of URL, I suspect neither will work forever. If you use a version-specific URL, that version might go away (which is the whole reason we're needing to mess with this in the first place). If you use the version-agnostic URL, then when a new version comes out the product key probably won't match.
It's really unfortunate that Microsoft makes existing installers break by taking old redist packages down, and doesn't provide the updates required for new installers to work out of the box.

Android Studio does not remember configured modules

Everytime I restart Android Studio it forgets the configured modules despite them shown as configured in the ProjectStructure>Dependencies menu and I manually have to remove them from ProjectStructure>Dependencies and then add them again.
I also tried invalidating the chache, cleaning and rebuilding but the only thing that works is to manually remove the dependencies and to add them again.
What is causing this behavior?
I never faced this problem, but i would check this points:
Do you have other software like git accessing the project folder and maybe overriding some important project files?
Does your user have the rights to write data into the project folder and the configuration files?
Does the Event Log shows something interesting?
Does the log shows something? Help > Show Log in Files > idea.log
i recommend using Ctrl+F to find any occurrence of Error
If you are on linux you can use find -cmin -30 to get a list of all files that were changed in the last 30 minutes. That might be useful to spot the problem.
It might help if you give us your operating system (and version) and android-studio version.

Change default gitignore file when creating a new project

Is there a way to change the default file .gitignore that Android Studio creates when creating a new android project? I searched for it in the Settings but could not find anything.
Unfortunately, there is no way to do that automatically, besides the one Ted has mentioned.
However, personally, I don't see this as a big downside, because you can thus safely add your specific templates that fit best to your project.
To be able to do this, do the following:
Go to File -> Settings and from there highlight Plugins. Click on Browse repositories... and you should be able to find the plugin entitled .ignore. Install it.
Now to configure a .gitignore for any project, in case you have no project opened, click on Configure -> Settings. In case you have an open project, go to File -> Other Settings -> Default Settings…. Now expand Version Control and click on Ignore Files Support. You should be able to add a custom user template of your .gitignore-file there.
To use any template you've added there, just right click on your .gitignore and click on Add template…. There you'll be able to add your custom specifications, however, many others are given by default, so you don't need to do a google search for an OS or language specific .gitignore configuration.
Good question. I tried manually modifying the project_ignore template in the Android Studio installation (located at C:\Program Files\Android\Android Studio\plugins\android\lib\templates\gradle-projects\NewAndroidProject\root in my Windows installation). That works, but it causes any future updates to Android Studio to fail unless you restore the original template first.
I'm posting this as an answer because it works. But it has such a bad down-side that I'm also starting a bounty in the hopes that someone can come up with a better solution.
On Mac, Applications->Android Studio.app(right click -> show package contents) -> contents-> plugins\android\lib\templates\gradle-projects\NewAndroidProject\root\ , i tried modifying, project_ignore file. i dont see error every time while looking for updates. instead of replacing, i appended at the end.

How to I get rid of Nuget

I am coming to the conclusion that nuget is not worth all of the issues it has with source control and deployment. So how do I get rid of it? I want to go the old route of putting the referenced dlls in the bin folder and doing the configuration changes as normal.
We have a similar issue, and I can to some degree see your point - the packages folder that NuGet creates at my solution level is good in that it collates the required dependencies into a single folder for use by projects in that solution - BUT it does become a problem when our developers try to push the solution code into source control, as I don't want to store an EntityFramework.dll folder with each solution, and particularly with all of the gumph that comes with it. (Incidentally, I personally don't think that .dlls should even be committed to source control!)
But in terms of your question about getting rid of it, I'm not entirely sure how much it's woven into Visual Studio now, but here's a change you could try out:
Inside Visual Studio, go to the Tools > Options > Package Manager > Package Sources. Un-check the box that makes the 'NuGet official package source' available. This, in theory, should make the NuGet API unavailable to your IDE.
Hope this helps.
My team opted to use NuGet for discovery (we love it for that), separately from our active projects, and to manage our references through another means to achieve control and minimalism. This is how we removed NuGet from those projects:
First, uninstall the NuGet packages in your projects (optionally re-add your references without NuGet at this point, or at the end)
In the same folder as your solution file (.sln) there may be a .nuget folder, which you should delete if no other solutions in that folder rely on NuGet.
In each project folder, delete the packages.config file. If this wasn't checked in to source control, every developer needs to delete packages.config from every project in every branch that is affected.
In each project file (.csproj), there are two lines in the PropertyGroup section that should be deleted:
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == 'Undefined'">...</SolutionDir>
<RestorePackages>true</RestorePackages>
There is also a section at the bottom of each project file (I've seen multiple incarnations at this location, so this is just an example)
<Import Project="$(SolutionDir).nuget\nuget.targets" Condition="Exists('$(SolutionDir).nuget\NuGet.targets')" />
You have to coordinate this with your team. If anyone opens a solution that includes projects with packages.config files in their directories, NuGet will undo the manual edits from above; especially if you have Auto-check turned on.

Missing dll when deploying ClickOnce

When I publish a ClickOnce application, one of the references that is included in one of my projects is missing.
If I go to my project's Properties -> Application Files, this missing reference is not even listed here.
My bin/Release folder has an .exe.manifest file, and I noticed it that it is also missing from here.
However, when I build the project, the DLL is in fact copied to my bin/Release folder.
How can I ensure it also deploys this required dependency?
I finally found a solution for this problem and I hope it will solve your problem to.
In my case, I'm editing an old application at work which have multiple projects, but the main project and it's back end project are the most important here.
The back end is added in the References section of the main project.
In the back end, a third party dll was imported, but this dll requires 2 other dlls.
So those 3 dlls were added in the References section of the back end project.
At that point, one of the 2 other dlls was not showing in the Application Files section for ClickOnce.
I've come up with a couple of ways of fixing it, but the most elegant one was to add this dll in the Reference section of the main project.
As stated in How to: Specify Which Files Are Published by ClickOnce, change the Copy Local property value on the reference to True.
References to assemblies (.dll files) are designated as follows when you add the reference: If Copy Local is False, it is marked by default as a prerequisite assembly (Prerequisite (Auto)) that must be present in the GAC before the application is installed. If Copy Local is True, the assembly is marked by default as an application assembly (Include (Auto)) and will be copied into the application folder at installation. A COM reference will appear in the Application Files dialog box (as an .ocx file) only if its Isolated property is set to True. By default, it will be included.
I know is this an old question, but for anybody having similar issues. I think this is a cleaner way around the problem.
I had a similar issue and everything I did to get ClickOnce to deploy with the offending .dll failed.
Eventually, I had to deploy manually.
See walk-through here.
That worked for perfectly for me. But, for the life of me, I still wonder why that process can't be added to VS (I'm using 2017 community).

Resources