I just randomly got that warning. That file exists on my hard drive, but VS refuses to understand it. I have no idea how to fix it, there are no solutions available online.
In the worst case scenario I will create project from scratch, but that will require moving a lot of code.
Edit
I have cloned older repository, now all references are missing. I thought that only Java has so many issues, but it appears C# is not better.
Edit 2
Rebuilding fixed all errors beside System.Runtime.
Related
I've started programming on a c# compiler a while ago, and since then switched from azure devops to github in my normal programming routine.
So when I picked up work again, I started committing to azure again, and found it really inconvenient to just have one project to another devops soulution so I decided to import this repo to github as well.
This was a day ago.
The previous days I've worked a lot in code and intellisense was working nicely, just until I imported the program to github, deleted the project folder on my pc and pulled the repo off of Github. I now this probably is not the most convenient way of doing this, but that's what I did.
Now intellisense completely stopped working.
Normaly ctrl+. should give me a huge list of things I could do, but it always says that there are no code actions available. Even the red squiggles don't appear until I try to run the project which makes it very hard to write code effectively as I often have loose ands I thought I fixed already.
So far I have tried reinstalling intellisense, the C# language extension and "re-pulling" the entire project, if that is an adequate term.
Of course I tried turning on and off my computer as well, but this mysteriously did not solve my problem.
My question now is how I can fix this, if there is a way to reset intellisense in a way or if it's even possible to "destroy Intellisense for a project" as this seems pretty dumb. The solution probaly is easy and right in front of my eyes but I'm not able to see it.
Of course I looked at similar questions on Stack overflow but the suggested tips did not work either.
Our team has been working on some UWP apps for some time now, recently after updating some nugget packages on any Rebuild of the project we get errors similar to this:
File=MakePri: Processing Resources failed with error: Duplicate Entry.
File=MakePri: Conflicting values for resource 'ExceptionStringTable/NameScopeNameNotFound'
There are similar questions on SO that are caused either by user created/managed resources or that are simply fixed by cleaning the project outputs and/or rebuilding.
This is different to other questions around MakePri and resource duplicate entries on SO because these resources that have conflicts are not provided or managed by any of my application code. Therefor I cannot simply remove the duplicate entry in my code.
The problem is that there are two resource files in the output that have duplicate entries. Mind you it's not a duplicate file, just a small handful of entries exist in both of these files:
\obj\ARM\Debug\System.Xaml\en-US\ExceptionStringTable.resw
\obj\ARM\Debug\WindowsBase\en-US\ExceptionStringTable.resw
My Question, is there a way in VS ALM to smartly either ignore these errors, or fix the duplicate entries before/during compilation? Further, has anyone else noticed this issue and is there a better way to resolve it? I suspect messing around with NuGet package versions might help but I'm keen to see what the rest of the community has to say before I spend much more time on this.
Turns out, you cannot simply delete these files, if you do so the next build will put them back, but what you can do is edit the files to remove the entries. Then the file will remain until the project outputs are cleared.
I'm not going to list the conflicts, we found them through trial and error and then after a while got lazy and removed whole chunks from these resources.
The consequences of this action is that now if an exception is raised and it's message string was one of those resources we carelessly removed, I have to google the exception code if I'm not already familiar with it. That took some getting used to :)
As I said, I suspect versions of NuGet packages could be to blame. But I'm not sure where System.Xaml.dll comes from. Surely the good guys as MS on the WindowsBase and XAML teams must be aware of this conflict and I'm hoping that it gets resolved in the future. Which is why I'm looking for a low effort solution
WindowsBase: \.NETFramework\v4.6.1\WindowsBase.dll
PM> Install-Package Microsoft.NETCore.UniversalWindowsPlatform (v5.3.1)
Our current solution is to replace the XAML version of the ExceptionStringTable.resw file with one that we previously edited and saved back to the solution root. It's an annoying process that I often forget.
Has anyone else experienced this and found a better solution?
For a project I am working on, I need to solve a mathematical model. I chose to do this using Microsoft.Solver.Foundation and the SolverFoundation.Plugin.LpSolve plugin. Both associated .dll files for these extension seem to work fine, as VS2015 recognizes and references them without a problem and compiles and runs my program without errors.
This is however up untill I try to actually solve my optimization, which needs "lpsolve55.dll" to work. I have downloaded this dll and put it in my project's bin/Debug folder, but for some kind of reason VS2015 just doesn't recognize it. I.e.
I can't reference it by simply browsing to it from my "Add Reference" tab.
It's impossible to (un-)register it via the regsvr32 cmd-prompt application, as it doesn't have any DLL (Un-)registry entry points.
The TlbImp.exe cmd-prompt application can't handle it.
So basically, after discovering the above (after trying the most-common internet solutions), I still feel quite dissatisfied to get the error message while I try to solve the optimization -
Unable to load DLL 'lpsolve55.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
The wierd part is also that I have another project in which I solve a similar problem, where there are absolutely no problems at all using lpsolve55.dll....
Some quick facts:
I reference .NET framwork 4.5.2. I have changed it to 4.5 as well as 4.0, but this didn't change anyting.
For as far as I can tell, the bin/debug folder of my projects are identical.
I am working on a fully updated windows 10 OS, 64 bits, while using visual studio 2015.
My question would thus be whether or not some of you have encountered a similar problem and if you were able to solve it in some way.
Highly appreciated!
After some careful analysis, I have found the answer to the problem. To be honest, as most things are, it was quite simple in the end. The lpsolve55.dll wasn't recognized because I didn't have my new bin-folder in the Path, which I did have with my old project. I simply forgot.
On a further note however, after the lpsolve55.dll directory was added to the path, I still got an error telling me there was no model to be found that could solve my directive. Since the error occured when I was calling the LPSolverDirective(), some research landed me on the following page:
http://lpsolve.sourceforge.net/5.5/MSF.htm
Above page gives a complete and stable way of how to acces lpsolve55.dll using the LPSolverPlugin straight out of Microsoft.Solver.Foundation.dll. After following the method in the link that involves editing my projects' bin/Debug and bin/Release folders, I got the LP model up and running within no-time.
Morale of the story - read the documentation. I am a bit of a beginner in programming entire multi-project solutions and using customly-added dlls, but hopefully this helps someone else experiencing the same. In the end, I learned a lot by simply trying different methods of getting it to work, so no time was wasted.
I have somewhat a bizarre problem here. I have a Solution developed with VS2012 in C#. I have 6 Projects in the solution. My problem is, with some of the projects in the solution, no code change has any affect on Solution Build. It's not just new code, not even Breakpoints are getting hit!!
I have done a thorough research in the net, couldn't find anything helpful.
And of course, I have tried
re-compiling
deleting all the binaries and compiling again
checked solution properties numerous times
etc...So, I think I have tried all the basics, but couldn't find a way out.
I gathered some screenshots, but I noticed I need at least 10 reps so I can't post them yet :(.
Any help at all will be greatly appreciated
Cihan Esen
EDIT: After the responses, I see that I have add, two other guys in my team is working on the same code, same build environment. They are not having this problem. I cross-checked every single configuration in their system which could remotely relate with this, we definitely have the same settings in VS.
And yes, I build the solution in DEBUG mode, not RELEASE.
I have tried seperate clean + build for the problematic projects -> no difference.
EDIT 2: I have to add; I have modified the code in the problematic project, so that I would see completely different output, but it didn't work. I mean that project/class of the solution, is still producing the same result, as if the code has not been changed at all. And yes, I have deleted all the binaries, saw them being built again.
This sounds really stupid to me but VS is acting as if it has a version of my source code of this problematic Project/Class, and it always compiles that version.
Make sure you are running in dubug mode and try this:
Go to your solution folder.
Show hidden files
Close your solution Delete .sou file for solution.
Add your break points, build your soltion and try.
throw away the obj and bin folders
throw away your .suo files
perform IIS reset for webapplications
rebuild everything.
should do the trick :)
I've just come across a pretty strange problem with VS2010 and Script#, which most of the time I am able to re-create.
In my simple scenario I have 2 projects in my solution; a standard Asp.Net MVC2 Web Application, and a Script# jQuery Class Library. I created a static class (attributed with [Imported]) with a static method on it, the intention being that I can map this class in code to an external Javascript library, as described in the documentation.
However, it seems that whenever I decorate such a class with [IgnoreNamespace] to achieve this goal, the project stops successfully compiling but doesn't give me any feedback as to why it's failing (no errors in the error window, for example). It's not easy to get rid of either, as Visual Studio seems to get into a permanent state of not build failure; removing the classes and project files doesn't solve it, nor restarting visual studio. The only way I can get VS to build the project successfully is to delete the project entirely, create a new one then add the files back in, which is annoying to say the least.
With a verbose build output setting, I get the following:
Target "AfterCompile" in file "C:\Program Files (x86)\ScriptSharp\v1.0\ScriptSharp.targets" from project "e:\project\local\ScriptSharpDemo\Scripts\Scripts.csproj" (target "Compile" depends on it):
Task "ScriptCompilerTask"
Done executing task "ScriptCompilerTask" -- FAILED.
Done building target "AfterCompile" in project "Scripts.csproj" -- FAILED.
.. which doesn't tell me whole lot.
There have been a couple of times where I have managed to create this type of class and then successfully build, but mostly I can reproduce this problem pretty reliably.
At this point I'm inclined to think that the bug lies with Script#, but would just like to have that confirmed, and to find a possible work around if there is one.
Just in case anyone is having a similar issue, I've found the cause of the problem.
When adding a class using this method, or copying in a file from another project for use within Script#, this causes a reference to System.dll to be added to the project. This (understandably) causes the project to stop compiling without error.
It would be nice to have a warning about this or for Script# to somehow detect when this situation occurs and/or create a new template for when I use 'Add class' or import a file, but it is just a convenience issue and at least now I can painlessly get my project compiling again just by removing this reference.
When trying to make my project build again, I came across the following, possible solutions:
The "Home\HomePage.cs" and "Shared\Utility.cs" must not be deleted and remain where they wre initially created
The "Home\HomePage.cs" and "Shared\Utility.cs" must be the last entries in the "*.csproj"-file. After them, no "Compile" tag should follow
Problematic calls to "Script.Literal" might cause silent fails - especially be careful when having parameters (like Script.Literal("{0}.doFoo()", variable))
The same seems to be true for "String.Format" when the format parameters are invalid
Namespaces and folders seem to cause many problems, putting all classes into the same namespace and all classes into the same folder might help
I tried all of the suggestions that have been given here, but continued to see the issue. Eventually, I determined that the cause in my situation was that I had added an [IntrinsicProperty] attribute to one of my properties. Removing it solved the issue. Don't ask me why this was causing a problem, but I thought I would share this solution in case others run into it.