Cannot open DataSet in Designer - XSD is Missing - c#

I have a DataSet in my C# Winforms project that I use for sending data to Crystal. This morning, VS will not allow me to open the DataSet in the designer anymore. It displays the following error message: The item 'ScribbleSoftDataSet' does not exist in the project directory. It may have been moved, renamed, or deleted. I have verified that the files are still in the project directory and my solution which makes use of the adapters in the dataset still compiles. I also tried to exclude the DataSet from the solution and then add it back again. Can anyone suggest another solution? I really don't want to have to build the dataset again since it has about 35 adapters. Below is a screenshot of what I see in VS 2008 Pro.

Okay, I think I know what is wrong. For some reason VS deleted my XSD file and corrupted the project file. I found a recent backup of the XSD for the DataSet and included it in the project after removing all the old files pertaining to the DataSet. Two Designer files were created because there was still and entry in the project file for the old designer file. This caused a bunch of compiler errors until I straightened out the project file

Related

Error 'does not support code parsing or generation...' if moving C# project with a picture for Visual Studio 2019

I can add an image to a form no problem, and it builds with no errors. Then, when I relocate the project, there is the error 'does not support code parsing or generation because it is not contained within a project that supports code' when I reopen the project from the new file location. This can be resolved by removing the form and adding it again, however this would have to be done every time the project is opened after being moved, and for anyone trying to open it from a new location.
I've tried adding the image in various ways, and I've tried adding different images. Every time, images are added with no issues in the original project location, however as soon as the project is moved this error keeps occurring.
How can I add an image to a C# project in Visual Studio 2019 while retaining the ability to move the project to a different location without resulting in errors whenever the project is reopened?
*EDIT I'm now wondering if this occurs after a certain amount of time that the project is copied, instead of because of adding an image. I have started to get the error again after I have copied the project about 10 times, which is around when I started to get the error when I was working with an image included in the project.
**EDIT I have rephrased the question here: After I have copied a C# project in Visual Studio 2019 about 10 times or so, I get an error when I reopen the project
Remove Special characters from Project folder Name.
Amend Project file paths in solution File.
Delete .vs Hidden folder or .sou file
I recently had a similar experience where i would get the error when trying to open the designer in VS after i moved my project.
to give some context i moved a project from TFS to GIT source control. I created a project in azure devops and the project name contained a space.
the clone url then escaped the space character as %20, when Cloning this repository from the command line without renaming the destination folder I ended up with a folder name containing %20 in its name, instead of a space. my solution file then had the same naming conventions containing the %20 in the project path.
This https://social.msdn.microsoft.com/Forums/en-US/cadde249-3fa9-46de-aa23-37ceae612e8c/form-not-contained-wiithin-a-project-that-supports-code?forum=winformsdesigner helped me:
Close the solution. go to the solution's file folder and delete the solution's .SUO files. Then reload the solution in Visual Studio. In the solution file explorer, right click on the targeted form source and select the "View code"(not "View Designer"). When the source file is opened, then right click over the source text and select View in designer.

VS 2012 Project Compile errors over seven missing .cs files

Looking to learn more about visual studio extensiblity specifically new languages I came across this SO question with linked project. Is there a custom language add-in for Visual Studio 2012 / VS11?
The OP question was along the lines of what I was wanting to learn and the accepted answer looked very good. At the end the answer contained a link to the "prepared solution" after the updates he recommended making. It is this "updated" project that I downloaded and upon compile get 7 errors all virtually the same. There are also 7 warnings and the warnings seem related to the errors. The problem is that my knowledge is insufficient to make the connection and implement a resolution.
The warnings all go like this:
The file 'VisualStudioIntegration\Common\Source\CSharp\RegistrationAttributes\WebSiteProjectAttribute.cs' could not be added to the project. Cannot add a link to the file ...long path...\WebSiteProjectAttribute.cs. This file is within the project directory tree.
The matching error is:
Source file 'VisualStudioIntegration\Common\Source\CSharp\RegistrationAttributes\WebSiteProjectAttribute.cs' could not be found
Trying to solve this myself I found this SO post The file could not be added to the project. This file is within the project directory tree error
and the recommend looking in the proj file which I did and found 7 entries that match the warnings and errors.
<ItemGroup>
<Compile Include="$(CommonRegAttributes)\WebSiteProjectAttribute.cs">
<Link>RegistrationAttributes\WebSiteProjectAttribute.cs</Link>
</Compile>
The so post said to delete the Link tag line but not understanding the connection I'm not sure that would be the smart thing to do.
So my question after all of this is what is the connection and what should I do / learn more about to resolve these errors.
Thank You
Further testing I saved the .proj file off and deleted the links. The warnings go away but the errors saying it can't find the files remain....
I think I found them. Bad package design. Did a global search for the files on disk and found them in the 2010 sdk folder. They were referenced to the file structure of the person who built the package...which go figure is not my structure. Change vs project to include the files and all looks good. to include files

Supress Merge/Conflict for a few files in a project on Get Latest Version, or, have in Project but not in TFS

I would like to Supress the Merge/Conflict checking for a few source files in a project on Get Latest Version. This is because these source files are autogenerated by a pre-build step. I just want them to be either left with 'local copy' or overwritten by the server version, because they're replace before building anyway and it doesn't matter.
When somebody on my team does a Get Latest Version, of course, these they get merge conflict errors, which isn't a big deal, but since the team changes from time to time, I get emails for a few weeks from new team members saying 'Am I going to lose my changes if I overwrite', until they finally remember to look at the filename.
Which of course caused a dev to get lazy once and ignore a merge warning, on a real source file ... and lose his changes!
Is there any way to tell TFS not to worry about this ... or, better yet, since the pre-build step always creates new versions of these files, just have them in the project (they're needed for building) but not in TFS?
You can always remove the binding of that file, so that it's not added to SourceControl.
Select the file in your solution.
In Visual Studio, File -> Source Control -> Exclude file from source control
The file will be part of your project but wont be under sourcecontrol. Basically it adds an entry to the ".vspscc" file to ignore the particular file.
Example from Vs2008 solution file.
Edit by O.P.
Note, as stated, this is not on the right-click of the file in project explorer!
Visual Studio 2012 has it hidden a bit better then vs 2008:

Check In: Operation not performed Could not find file *.csproj.vspscc

I am having issues with check in my code files because of some changes I have made to the project and solution. I have renamed project files, added different project files in the solution and added many files in the existing project.
Now I am getting an error while checking in the code.
The error details are:
Check In: Operation not performed Could not find file
'....Console.csproj.vspscc'.
How do I create a vspscc file if it does not get created on its own?
Any help would be great and thanks in advance.
This looks pretty stupid on my part. I restarted my Visual Studio and I could perform the check in because Visual Studio created the vspscc file when it opened the projects and solution.
Answering my own question as fast as possible so nobody else prints my own negligence before me.
And for anybody who needs an answer as how to create a vspscc file, restart the visual studio IDE
I have also seen this in another situation (VS2012) where a simple restart didn't do the trick.
I had a number of new projects which I had added to an existing solution but in the wrong place. Undoing and re-adding seemed to be fine until check-in, where it complained that the newly added projects and related .vspscc files could not be found. It was looking for them in the original location rather than where they are now.
Resolution was to go to the Source Control Explorer, which still had check-in items against these files in their original (but non-existing) locations, as well as the files in their correct locations. Selecting these errant references and "Undo pending Changes" for these files did resolve the issue.
I'd try using File/SourceControl/ChangeSourceControl dialog and unbind (if necessary) then rebind the project to TFS to recreate the .csproj.vspscc.
I removed projects and have same issue, so my solution was to re-create the same projects with same name, then remove them cleanly :-) I hope this helps
I had a similar problem, but in my case I Visual Studio/TFS couldn't fine the .csproj file. Anyway, with the help of a colleague I was able to determine that the issue was within TFS itself. TFS may have a different view of your source code than Visual Studio does. I had created the wrong type of project (I'll call it Proj1) and deleted it from within VS. Then created the correct project type, which I'll call Proj2. When I when to check it into TFS it complained about Prog1.csproj, which confused me because I couldn't see it within VS. What I learned was that you have to go into TFS's Source Control Explorer. From there you'll see how TFS sees things. Sure enough, there was Proj1.csproj (and some other related files to Proj1). What I had to do within Source Control Explorer was undo the pending check-in's of those files and folders which I didn't want to check in and no longer existed anyway. Then TFS was happy and I could perform the check-in.

C# VS 2010 Find All References not finding everything

Using VS 2010 C#.
I went to use Find All References and noticed it was only searching and listing files that were open in VS. I'm positive what i am looking for is used in may places.
I know its working incorrectly, cause I'll open another .aspx file that uses it and it will then show up in the list.
I read some older posts on deleting the .ncb file, but the only on my computer is in a completely separate project and solution and folder.
Any suggestions?
Try deleting your bin and obj folders and then recompiling and see if it works after that point.

Categories