I recently upgraded an old C# application to 4.6 framework so that I could consume a vital service that was moving to 4.6. After I did that my fckEditor had 102 compile errors. This did not make any sense because it had been working just fine for years. So, I upgraded to CfEditor and I still have 102 errors.
An example of one of the errors is:
'addedCount' is not declared. It may be inaccessible due to its protection level.
I have that type of error around 20 times.
All the errors are in the CFEditor code. Any advice on how to fix this?
Did you change the target framework version for the package? Try doing that and cleaning and rebuilding your solution. If you're using Visual Studio, this has caused me problems in the past after applying a dramatic change like updating framework version. Try restarting the editor as well.
I am assuming that this place you're having an issue with is resolved via a package manager. Please give more context if this isn't the case.
Thanks for replying. Last night, right before I stopped for the day. I removed the folder and the DLL and then added everything back in and Walla! Everything worked. It looked like the folder that I removed had stuff in it that didn't belong.
Related
I have a template project that uses Script# (downloaded from here: https://github.com/scottdurow/SparkleXrm). I've built and deployed this many times so not sure if this is an environmental issue or a version issue. I stripped the solution right down to 2 projects - ClientUi (which references Script#) and a CRMPackage where my HTML page is, but when I build I get the error:
The type or namespace name 'ScriptAssemblyAttribute' could not be found
...and I can't get rid of it. I'm on VS 2017, Windows 10, Project version is .net 4.0 (have tried changing it to 4.5, same problem).
Have tried reapplying Script# via NuGet, but it's just not happy with me and keeps throwing the error. Have tried clearing VS cache, cleaning the build and restarting visual studio, standing on my head, drinking wine, nothing seems to work. In fact I think the wine made it worse.
Help.
For future people hitting this, it's a Visual Studio version issue. Preview 2 broke ScriptSharp compilation. It's something to do with a mismatch in mscorlib versions.
https://developercommunity.visualstudio.com/content/problem/138986/1550-preview-2-breaks-scriptsharp-compilation.html
As per the above link, the fix is setting the following flag in the MSBuild project file:
<DisableHandlePackageFileConflicts>true</DisableHandlePackageFileConflicts>
I am having the exact same issue/error as this post from yesterday. Similar SO Post
SIDE NOTE...As you can see, I am new and therefore, only have 45 reputation. As such, I could not simply add a comment to the above existing post and had to create a whole new post even though they are the same issue....seems silly. But I digress....
I wanted to provide additional comments in the hopes to get an answer. My issue started suddenly the a few days ago. I made no major changes to references, VS updates, etc... However, when I right click my csproj in visual studio, I get the error and I have to click it five times before it goes away, at which point I finally get the menu.
Again, I have made no major changes BUT I went ahead and confirmed that:
My target version and Min version is Windows 10(10.0; Build 10586). That is the SDK version that I have installed and am using.
I verified that my NuGet updates are complete and that my Microsoft.NetCore.UniversalWindowsPlatform are installed and update to date (5.2.2 as of now).
I do have a reference also to "Universal Windows". This was created automatically when I created my project and I cannot remove this reference but it is there. When I select it, I do see that it is "UAP,Version=10.0.10586.0" so this should be good. I do notice a possible issue here. Again, this reference was created for me and I cannot remove or change it. However, it is pointed to a folder named
C:\Program Files(x86)\Windows Kits\10\References\Windows.ApplicationModel.Calls.CallsVoipContract\1.0.0.0\
Why did the Windows Universal reference default to that folder and only that folder? I am not using VoIP so I wonder why it chose this one? Also, what if I need some of the other references in the References folder?
I created a brand new Windows Universal project and the same error happens on a fresh project.
Please help, it is annoying. Project still seems to build and work fine though.
Thanks!
I found the issue in my case, it was an extension that I added on to Visual Studio provided by SyncFusion (which their installer actually creates 7 or se extensions in Visual Studio). After troubleshooting my issue and doing some of the same things to resolve (repairing .Net, SDK, Visual Studio) I then thought about the error a bit more. While it is cryptic (and has poor english "An Exception has been occured") these are all clues that it could be any of the frameworks that I have installed via extensions as well.
I also had another clue, the issue started happening a few weeks ago, around the time I updated my SyncFusion controls to the latest version.
So, I went to Tools > Extensions and Updates. I went to Installed > All and found all of the SyncFusion items (there are several) and disabled them all. After I disabled them, and restarted Visual Studio, the problem went away!!!
This is a workaround for now. In the meantime, I put in a support ticket with SyncFusion on the issue. I will certainly update this thread when I get a response from them. Also in the meantime, I then went back and re-enabled each of them again, one at a time, to see who the real culprit was. In my case it was the SyncFusion Web Conversion and Migration extension.
If any of you are not using SyncFusion but having odd Visual Studio issues such as this, I suggest doing something similar by going through your extensions and disable any that you added on, starting with the most recent add ons, especially if they were added around the same time you started having the problem until you find the culprit.
Hope this helps!
Tried to upgrade Visual Studio to 2015 Update 1 and it failed. Then started getting this error during my project build:
37>Unhandled Exception:MSB0001: Internal MSBuild Error: Already registered for build-time.
37>Error: MSB0001: Internal MSBuild Error: Already registered for build-time.
I thought it might be related to the Update 1, so I completely reinstalled Visual Studio. Nothing changed. I am able to build my solution (which has a mix of C# and F# projects) if I build the problem F# projects one at a time. But doing a rebuild on the entire solution gives me this error. Any idea where I can begin looking for answers?
thanks
So I got this problem when upgrading VS 2017 to version 15.8.0, and googled my way to a workaround. Although initially reported for VS 2015, and probably caused by another bug at that time, I have a feeling several developers will land here in the next few days.
A workaround is to set concurrent builds to 1. This can be done in VS 2017 in Tools/Options/Projects and Solutions/Build and Run, and then you see it at the top in the settings pane.
This obviously will slow down many builds, but for some of us it's probably easier (or perhaps needed) to use this workaround rather than downgrade while we wait for a fix, which I guess won't be long.
Turns out the problem was with Modeling project. Unloading this project fixed the problem. I still believe there is something wrong with the build process, but that's not something I care to troubleshoot at this point. Hope this helps someone else
I have a friend who has made some code in visual studio. But when I run his code (after getting it with git), I get Error Code CS0433. The weird thing is another guy on our team can get the exact same code and run it just fine on his computer. Here is a screen shot of the errors:
CLICK HERE FOR A BIGGER PICTURE
What is even more weird, another friend working on a different branch also gets Error CS0433 when running his code. But I can get it and run it just fine on my computer.
I have tried a couple of things to no avail.
Rebuild the solution
Clean solution
Manually deleted bin and obj folders, then do a clean/rebuild
I looked around the web for a solution. I found some people with similar problems, but theirs are in ASP.NET and not .NET. See here and here.
I have also taken a look at the documentation at MSDN on error CS0433. But I'm a beginner find MSDN's explanations very cryptic...
Is there anyone who has an idea as to what is causing this problem and/or a solution on how I can fix it?
If you need additional information feel free to write a comment. I will supply it as fast as I can.
You have references to dotnetcore50, and system.dll. This is causing (I think) most of the problems.
Try removing all the dotnetcore50 references. Start with vanilla .NET and try and migrate to the core libraries slowly. This [blog.marcgravell.com/2015/11/… might help.
My C# WinForms solution has two projects.
A DLL which is the main project I'm working on, and an executable WinForms I call "Sandbox" so that I can compile/run/debug the DLL easily in one go.
I'm working in .Net 4.0 for both projects.
Everything was working fine until I added some seemingly innocent code, and a reference to System.Web in the DLL.
Now my Sandbox project can't see the namespace of the DLL project. I didn't change anything which I believe should have affected this.
If I delete the project reference to the DLL from the Sandbox references and re-add it, then the red underlines all disappear and the colour coding comes back for all my classes etc; but as as soon as I try to build the solution, the whole thing falls apart again.
When I right-click the DLL project in the Sandbox's references and view in object browser, I can see the namespace and all the stuff in there.
I have a feeling this might be some sort of bug?
Is this some sort of VS2010 bug? I had this same issue a few months ago and I could only fix it at the time by making a whole new project and re-importing my files. This time, however, I have a bajillion files and will only do that as a last resort!
Edit:
After panickedly going through and undoing all my changes, trying to find what caused the problems, it seems to be this line:
string url = "http://maps.google.com?q=" + HttpUtility.UrlEncode(address);
If I comment out this line, then I get no namespace errors and the project builds fine. I can't see anything wrong with this line though.
I'm ready to declare this a bug in VS2010, this has bitten way too many programmers already. The fix is easy: Project + Properties, Application tab, change Target Framework to ".NET Framework 4" instead of the Client Profile that is selected by default.
System.Web is not included in the client profile. Having this option in the first place is quite silly, the client profile is only 15% smaller than the full version of .NET 4.0. Having it selected by default is even sillier. But I digress.
UPDATE: mercifully this all got fixed in VS2012. Which no longer makes the client profile the default for a new project. And the client profile got retired completely in .NET 4.5, good riddance.
Check to make sure that both projects are using the non-client profile for their target framework (go to each project's properties to do this).
One possibility is that the target .NET Framework version of the class library is higher than that of the project.
I faced this problem, and I solved it by closing visual studio, reopening visual studio, cleaning and rebuilding the solution. This worked for me. On some other posts, I have read the replies and most of users solved the problem by following this way.
Try building only the project with the Sandbox dll first independently.
Then point your executable project to the required dll and ensure copy local is set to true. in reference settings.
Tthen build the executable project.
Changing the target framework from the ".NET Framweork 4 Client Profile" to ".NET Framework 4" worked for me with a similar problem. I agree that the client profile doesn't seem to have much of an advantage to using it. I seem to get nailed with weird errors that I hunt for until I remember that Visual Studio defaults to the client profile. I guess the moral of the story when getting an error is: if "Rebuild Solution" doesn't work, check the Target framework...
If you tried already doing the Framework change, and still not worked, I hope this works for you (as it did for me): Simply add the necessary references from within your projects. Very obvious but I was doing it wrong until I found what was the issue.
I just had this issue and it turned out to be I had multiple namespaces being used that had the same object name (i.e. business objects had the same names as mvc models);
Fully qualifying the names fixed the issue for me.