Edit build definition - path over 259 characters - visual-studio

I need to edit my solution's build definition to include some new projects. Unfortunately, I can't do that because I keep getting the "path contains more than the allowed 259 characters" error. I've tried to rename the file to make it shorter - the total path character number is now 257. But I keep getting the same error message and the filename in the message is still the old, long one.
I'm really confused now. The file is located within:
C:\Users\USER\AppData\Local\Temp\VSTFSBuild...
Does anyone know why the filename remains unchanged in the error message or knows of any other way to fix the problem?

Surprisingly, I managed to overcome the problem this way:
go to Process and click OK to the error message when it appears
click "Show more details" next to my build process template
click the Refresh button
(I'm using Visual Studio 2012)

For this kind of long path issue, the common workarounds are to shorten the build path on the server.
For example: instead of \xx\Build\Drop\ProjectName, just use \xx\Build\Drop (or \xx\Builds) since the project name is also in the build name.
For the long path issue in TFS, there had been a related uservoice and now completed.
Fix 260 character file name length limitation
We’ve removed the limitation from the BCL for the basic file
manipulation functionality (CRUD). You can find more details here:
https://blogs.msdn.microsoft.com/dotnet/2016/08/02/announcing-net-framework-4-6-2/
Immo Landwerth Program Manager .NET
If you are using XAML build definition, by default the build control specifies a path for the build to access any custom assemblies your custom build process requires. If you don't have custom assemblies, you don't need this value.
Open Team Foundation Administration Console on your Build Server, and click Properties on the build controller. Remove the path and try to edit the build definition again.

Related

Invalid or unspecified target for shortcut in Setup Project

Pretty much every time I go to build the setup project in my solution, I get the following error: "Invalid or unspecified target for shortcut". MSDN provides the following useless help. When I go to the dialog to (re-)select the target for the shortcut:
My primary output (for my main application) is not present, even though it is definitely listed in the File System view:
The setup project was deleted and completely re-created, and checked in. When it was checked back out, I got the exact same error.
I assume that whatever reason is causing the item to not show up in the "select target" dialog, is the same reason that the build is failing in the first place. What gives?
I just solved this by changing my build mode from Debug to Release.
Primary Output for ... (Release x86) - It is looking for a release build of x86.
If you look at your Errors List you should see the error listed. Right click on it and choose the Properties Window.
Find the "Target" property and simply set it to the correct value.
This goes for the Icon problem as well.
In my case, I was building and packaging a Net.Core project using a Publish Profile.
The publish was failing with no visible error during the Msi build.
I ran the publish profile manually and saw the error that I had 2 copies of appsettings.json being installed at the same location.
I excluded one of the files and both the Publish and Package completed successfully and the shortcuts became valid again.

Share a link to a location in code (source file / line number) in Visual Studio

I'm looking for a plugin (may be a TFS plugin) for Visual Studio 2010 that add a 'Copy uri' context menu entry in code editor and would make possible to copy paste a file/line number into an IM conversation (skype) or an email, and of course clicking the link would open the project/file at the correct line number (in an existing instance if VS if possible).
I'm working from home and that would be nice to be able to share easily a code location with team via skype (and sometimes email).
I googled and found nothing, but it's perhaps available in a big plugin like Resharper and not advertised.
I wrote an extension for this. It's called CodeLink:
https://marketplace.visualstudio.com/items?itemName=AuriRahimzadeh.CodeLinktm
I'm looking for testers and feedback. I only have so many solutions with which to test it :)
There's no such extension that exist from what I know.
However it wouldn't that hard to create a VSX that adds an entry in the Source Code context menu that will get the Source Control path from the Local Path using the TFS Api then putting the result in the clipboard.
In the meantime there's no easy way to come up with a workaround as I'm not aware of a way to get the Source Control path from the Local path in Visual Studio.
Its not a plugin, but you can now add a line parameter (eg &line=1234) to a TFS file browser url, and then email that link to a colleague, it will open the file in a browser with the specified line highlighted.

Xap packaging failed. Object reference not set to an instance of an object

I'm getting this error message on my PC when I try to build my Windows Phone app:
Xap packaging failed. Object reference not set to an instance of an object
I'm using Dropbox. On my laptop, It works perfectly fine and I can debug etc...On my PC however, I can't.
I tried many things such as:
Delete obj/Debug Folder
Check for files which are missing on the Solution Explorer
So far, nothing has helped.
Any idea how I can fix this?
You should check, in every folder of your project, for missing files or wrong references.
You can get this problem just with a single missing image, if its Build Action property is set to Content or similar...
Check your files and then Rebuild your project!
This can happen if a file is removed from the disk itself, but not from the Solution through Visual Studio. Delete the file through Visual Studio (it should be marked with a little yellow hazard icon) and Rebuild.
Credit to Andreas Hammar via http://blog.jayway.com/2011/06/03/wp7-build-error-xap-packaging-failed/ - his solution worked for me.
I am adding this reply because although the problem with app icons is covered in brief in some of the answers above, I wanted to give exact steps since it just happened to me. I got this error and then found this web page:
Xap Packaging Error
It turned out that my App icon file name was wrong due to a rename. I double-clicked on WMAppManifest.xml, found in the Properties folder, to open the editor for that file. I simply used the button to update the App Icon, re-found the file and selected it, and the error went away after rebuilding the project.
The problem lies in your startup object in your Application. I have met this error to many times.
It usually happens when I change the name of my class/namespace Application class. Or it might even be conflicting with your dropbox locations.
To Fix this.
Right click your main project or Alt+Enter
Go to the silverlight tab and set your startup object
Try the following:
Have Visual Studio closed
Download all your files to your computer
Delete Bin and obj folders completely.
Open the .sln
Rebuild
If if fails expand the References in te Solution explorer and make sure all your dll's are found. If a dll have a yellow exclamation point that means its not found. I'm thinking that one of your references are set to an absolute path on your laptop and that's missing on your PC.
If someone comes across this post and still has the issue I had where XAP packaging failed and that VS2012 can not find the file then check for spaces in the file name.
I had the issue where my tiles were "tilename 99.png" and it keep giving me the XAP packaging failed message. So I finally changed the file name to "tilename_99.png" and it worked.
Hope this helps someone in the same predicament.
In my case, I'd accidentally moved Background.png to a resource folder. Moved it back and it worked!
In my case, this error didn't go away even after trying all the above methods. Actually I had renamed the ApplicationIcon.png to "xyz.png". And reverting this, fixed the issue.
One more possibility is that you have a wrong path to an image in the project/options/Application dialog (icon, bg image, etc).
I had this error message, after some frustration I look in the obj folder, is was no part of the solution(but visual studio need it) but I had some conflicts files with dropbox. I deleted the obj folder rebuild, visual studio recreates the folder and the content of it and problem solved.
Ahh finally found my problem.
I'm using Visual Studio 2012, which doesn't always point out the "missing" file and makes it a little harder to fix.
MY SHORT SOLUTION
Relink the "linked" configuration file in the main project. It is a linked file because the original file remains in a referenced assembly, not in the current assembly. The file wasn't marked YELLOW so it wasn't obvious that it would be the problem, but when I double clicked on it, it failed to open, so I knew this was the problem file.
The silverlight application itself had a "linked" file called "ServiceReferences.ClientConfig" which contains information needed by a referenced project to make a web service call.
So the main project didn't have the web service reference itself, but it referenced a project which did, which is why it linked the "ServiceReferences.ClientConfig" file.
MY LONG SOLUTION
Keep rebuilding the main project file, and commenting out, and excluding project by project, file by file, until you CAN build the main project again. At that point it should be clear(er) which part of the solution is causing the problem.

"application has failed to start ... configuration is incorrect" after upgrading?

I have a project in windows application than was in VS2008. Now I convert it to VS2010. When I want to run my project, I get this message:
"This application has failed to start because the application configuration is incorrect. Review the manifest file for possible error."
How to I can run my application?
Thanks.
I had the same problem where my entire C# solution was created in previous version and it did not work in new VS.Net version giving the same error. Here are a few things that will help you resolve the problem
Expand the References Item and check if any item has a warning symbol attached to it.
If (1) , click on References->Add Reference and try to add the reference which has the warning. Now the warning sign has to go away.
If the references displayed in 'Add reference' dialog box is grayed, you should probably get the reason by hovering next to the reference.
For me it was grayed and it clearly mentioned that the component is not compatible with the current .NET Target runtime. Right click on Project -> 'Properties' and try to change the .NET Runtime and give a shot by compiling the entire solution and try to execute it.
If it still fails , try looking at eventviewer logs by going to Start->Run->Eventvwr
This should be a good way to debug this problem.
Honestly...I deleted the App.config file and Re-build. And started working.
Without understanding what was going on, I was able to fix this issue for a Windows Forms project I had just converted from VS.Net 2008 to 2010.
After conversion the Target Framework was still .Net Framework 2. When I changed it to 4.0, my application could be started and debugged.
In then noticed a new line in app.config:
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
So, just for the sake of interest, I changed the Target Framework back to 2.0 and the line changed to:
<startup><supportedRuntime version="v2.0.50727"/></startup>
The application would still run.
Then, I removed the new line altogether and the application would still run!
Finally, I undid all my changes and started the conversion again. Now, the application would run immediately!
So, if you run into this issue, just try these steps and see if it helps you.
Check discussion here:
http://social.msdn.microsoft.com/forums/en-US/vbgeneral/thread/e60dcbf9-c6a0-47a6-bc37-68d4edc45276
In my case the reason for this error was an invalid app.config. R# renamed the root element from <configuration> to something else (probably because there was another variable that I renamed with the same name).
I found this by following Gopalakrishnan SA'S advice to look in the Event Viewer where I found:
Activation context generation failed for "my.exe".Error in manifest or policy file "my.exe.Config" on line 3. The application config file root element must be configuration.
In my case, I forgot just a simple note,
in the requestedPrivileges you should place one requestedExecutionLevel, NOT MORE
I checked the event viewer to find the error "The application config file root element must be configuration".
It turns out it was the namespace referenced in the app.config.
I had opened it in VS 2015 after it being created in VS 2008

generation of designer file failed

Every few days VS2008 decides to get mad at me and fails to generate a designer file claiming it cannot find the file specified and that it's missing an assembly. Here's the scenario:
The aspx page has a reference to a custom user control (inheriting UserControl) which references another assembly in the backend. There are many other references to this "missing" assembly in other places in code which don't throw errors. rebuilding, updating the source to the clean copy, shouting at the computer, punching the screen, etc all fail to work.
Any suggestions? This is quite annoying.
We've had similar problems before, unfortunately I don't remember the exact solution.
If your using a "Web Site" project (no project file) then start by checking that both your page and your control both set the ClassName property in the first line of your aspx/ascx file and that you specify the full name of the class including the namespace.
Example:
<#Control Language="VB" AutoEventWireup="false"
ClassName="YourProjectName.YourUserControl"
Inherits="YourProjectName.YourUserControl"
CodeFile="YourUserControl.ascx.vb"
%>
Many times not setting all of these will still work but you will get odd compiler errors and behavior in VS.
If you using a Web Site Application project try deleting the designer file manually and then right click on your project and choose "Convert from Web Application." This will should recreate the designer file for you.
My only other suggestion would be to recreate the page and/or the user control from scratch.
Jared, you've hit it. Using "Convert to Web Application" to manually generate the designer file solves my problem. I'm glad you posted this before i started reinstalling. Thanks.
You might try archiving a template of a new file with its designer equivalent. If VS coughs then you can do an "Add Existing" option with the file you already have.
It seems, however, to be an issue with your installation of VS2008 so you might try reinstalling it.
I found that using a custom control, you would need to add a reference to the .dll. This fixed it for me after migrating from a web site to web app.

Resources