NppExec in Notepad++ Not Recompiling My C# Code - c#

I seem to be having an issue with the NppExec plugin for Notepad++. I'm new to coding in the Windows environment, so it's conceivable I'm missing something fairly obvious.
A few days ago, I got the NppExec plugin to work on Notepad++. In the NppExec plugin, under the "Execute" window, I have this saved:
"c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\csc.exe" /out:"$(FULL_CURRENT_PATH).exe" "$(FULL_CURRENT_PATH)"
"$(FULL_CURRENT_PATH).exe"
When I compile the C# code for the first time, everything works as it should. If I were to make a small change- something as simple as writing
Console.WriteLine("testing: 1,2,3");
in the bottom of the Main method, the Notepad++ software does not tell the compiler to recompile the file. In stead, executing the code again simply runs the past version (even despite saving my changes) of my code all over again.
Does anyone understand why this is happening, and what I can do to have Notepad++ tell the compiler to recompile the file?
Thank you in advance.

I have two approaches for you:
1. Improve your Npp Exec script to dump $(FULL_CURRENT_PATH) file somewhere before compiling.
cmd /c copy "$(FULL_CURRENT_PATH)" "$(CURRENT_DIRECTORY)\currentfile.txt"
This way you will understand what code is actually handed out from Notepad++ to the compiler.
2. You do not need to purchase Visual Studio. (Just download and use like Notepad++.)
You can download and use Visual Studio Community Edition if your company has up to 250 computers and up to 5 developers using it (see ยง1.b thereof).
You can download and use Visual Studio Code, an edition which is always free. Pretty limited functionality, but with C#, it has still impressive set of features
which Notepad++ cannot match.

Related

Visual Studio Code Won't auto complete my C# code

SOLVED
Just to clarify this is about VS code not just VS
I've had the worst 3 hours looking for anything that could possibly fix my Visual studio code. I'm using the program to develop a game on unity but I can't seem to get the auto complete thing (I think its Intellisense) to auto complete my code causing spelling mistakes and making coding 10x longer than it needs to take.
Heres a list of things I have tried:
Install .Net Framework v4.7.1 (which is what the console says to do)
Fix the Assembly file made by unity multiple time
Reinstall Visual studio, C# plugin and .Netframework
Change the OmniSharp to the latest version
I will add that when ever I type anything it comes up with "[info]: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService Could not find document for file c:\Users\Bruhman\Grinder\Assets\Scripts\PlayerMovement.cs"
and when I open visual studios and write anything in the script it'll come up with an error that states "Some Projects have trouble loading. "Source: C# (Extension)" "
Below is a screen shot of what comes up in the console (It's the same every time)
Console
Never Mind I found out the issue, apparently I need to install Visual Studios Community version and then the .Net developer packs from visual studios and not just online, I'm assuming that it doesn't get detected or something when installed through the exe file...
I don't really know much, but I use it every day : have you tried the unity tools extension ?
It features a lot and also the c# auto completion.
If it still bugs, have you installed the .Net for the EXACT version. I also struggled because I had the upper version and not the exact.
Finally is it linked with unity (I don't know if it could interfere if not done)
Sorry I don't know anything else if this don't work.

Having problems editing a dll in visual studio

I have a file called Asembly-CSharp.dll i want to edit in C#. I decompile it with .NET reflector's FileGenerator (also tried file disassembler and dotPeek) plugin, thus creating a visual studio project, i open it in visual studio, but it fails to build, i didn't change anything, yet i get lots of errors (like unexpected characters etc), the dll refers to lots of other dlls but even if i put all of them in one solution it fails. Why does it fail if i didn't change anything in the source code (.NET framewrok version is the same as it was before decompilation). Any help appreciated.
I tried both visual studio 2012 and 2013 (win7 but i know that shouldn't be the problem)
I'm not professional, forgive me if i made some silly mistake.
Reverse engineering needs a bit of effort. Nothing comes for free. You need to manually fix those errors.
Mostly these errors occur because either Reflector decompiles the code with compiler-generated variable names that are valid in IL but not in C#, or because that particular assembly was written in some other language that supports features that cannot be directly translated to C#.

Visual Studio 2013 C# Interactive Window

Is there C# interactive window for VS 2013, or any other similar way, without installing VS 2012.
I tried C# Repel, C# Snippet Compiler and Mono Command Prompt, but, all of them don't provide the features of C# interactive window packed with Roslyn for VS 2012.
UPDATE: Found a total better alternative!!! Try CShell, it is free and open source! "A simple, yet powerful, C# scripting IDE" as they promote it.
Check my tweet which was also favorited by Scott Hanselman :)
My old recommendation was: LINQPad
Best way is to install VS 2012 and use C# interactive window provided with its Roslyn. While doing that, wait Microsoft to release C# interactive to VS 2013.
This is taken from one of the links above:
http://social.msdn.microsoft.com/forums/vstudio/en-US/0da45fe7-fbe2-4074-b52f-dc8d7c4b2ba3/c-interactive-in-vs-2013
It worked for me, so hopefully this will help the next person :)
Hi SpencerGR,
I just got upgraded to VS 2013 and wanted C# Interactive, and this is
the first hit when I searched for it, so I figured I would place my
answer here...
Didn't make sense to me that the extension from VS 2012 wouldn't work;
so I hunted down the Roslyn keys in my registry for VS 2012 and was
able to kinda figure out what was going on. After a bit of futzing
around, I finally got it working, so here's the instructions for
whoever might care to try [be warned, I'm sure this isn't supported by
MS, I take no responsibility if something happens to mess up your
computer, and so forth ;)].
Basically it was a matter of
copying some registry keys with slight modification copying some files
and this one is annoying but oh, well] there's a file you have to
change the datestamp on (I did it by opening the file in Notepad++ and
saving it out.) If you don't already have VS 2012 or you don't have
the Roslyn CTP installed you'll need to get the files somehow, and I'm
not sure if there are other registry settings needed or not, but I
imagine if you just manage to get the files out of the CTP distro it
would be enough... No guarantees of course.
Not-Instructions-Just-An-Explanation-Of-What-I-Did-I-Am-A-Trained-Professional-...-Or-Something
;)
copying some registry keys with slight modification; I replaced '11.0' with '12.0' in the keys and values, you might need to change
the paths too if you didn't install Visual Studio in it's default
location. (also posted to pastebin.com/XeP5ai8F )
Save this as a .reg file and open it to import the new keys easily:
Windows Registry Editor Version 5.00.
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\InteractiveWindows\0] "ContentType"="Roslyn C#"
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\InstalledProducts\Roslyn] ""="Microsoft Roslyn CTP" "ProductDetails"="Microsoft Roslyn CTP"
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\Packages\{c5edd1ee-c43b-4360-9ce4-6b993ca12897}] "Class"="Roslyn.VisualStudio.CSharp.Repl.CSharpReplPackage" "CodeBase"="C:\\Program Files (x86)\\Microsoft Visual Studio
12.0\\Common7\\IDE\\Extensions\\Microsoft\\Roslyn C# Interactive Window\\1.2.20906.1\\Roslyn.VisualStudio.CSharp.Repl.dll"
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\Packages\{f5199a4e-6a60-4f79-82e9-fc92a41c4610}] "Class"="Roslyn.VisualStudio.InteractiveWindow.InteractiveWindowPackage" "CodeBase"="C:\\Program Files (x86)\\Microsoft Visual Studio
12.0\\Common7\\IDE\\Extensions\\Microsoft\\Roslyn Components\\1.2.20906.1\\Roslyn.VisualStudio.InteractiveWindow.dll"
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\ToolWindows\{2d0a56aa-9527-4b78-b6e6-ebe6e05da749}] "Name"="Roslyn.VisualStudio.InteractiveWindow.VsInteractiveWindow"
copying some files; basically just need to copy the files mentioned above to the locations mentioned above; I just copied the
'Common7\IDE\Extensions\Microsoft\Roslyn C# Interactive Window' and
'Common7\IDE\Extensions\Microsoft\Roslyn Components' folders from my
11.0 install to my 12.0 install. easy peasy.
and yeah... there's a file in the aforementioned 'Common7\IDE\Extensions' directory called
'extensions.configurationchanged'; I couldn't get things to take, then
I noticed that file. so, as mentioned, I just opened in Notepad++ and
saved back out; I think I had to make a change to the file, so I added
a space. kinda felt kludgy, but I guess it beats VS taking longer to
load due to having to scan the Extensions every time you open it up.
So, that's it! Worked for me, I hope someone else may find this
useful, as it probably took longer to post this than it did to
actually get it working in the first place. ;) It's possible I missed
a step in here somewhere, since I had made a few other attempts before
I found the 'changed' file, so I could have possibly twiddled another
bit somewhere that was necessary that I don't remember. Should be a
good start tho.
I haven't tested it out fully by any means but it shows up in the
'View > Other Windows' list, it opens up just find, and it looks like
Intellisense is working too. Good luck and great code to all! :)
--- Chelle L.
You could also use LinqPad. You can use it to test C# code. It has built in support for loading DLLs and Nuget Packages. Its what I use personally and I love it.
It has a free version, but the paid version has intellisense and debugger
C# interactive finally arrived to VS 2015... You may need to install vs2015.1 to get it..
http://blogs.msdn.com/b/visualstudio/archive/2015/10/08/visual-studio-2015-update-1-ctp.aspx
Good luck... and happy interactive coding!
IWIH describes how to install it and which prerequisites you need.
Let me give you some
Additional information:
After you have installed VS 2015 and its updates (update 3 KB3165756 patch has just arrived) you can bring C# interactive to your screen as follows:
Either via the menu
View -> Other Windows -> C# Interactive
Or press Ctrl + Q and type into the quick launch box:
C# interactive
which allows you to click on View -> Other Windows -> C# Interactive with the mouse.
Afterwards, you have the C# Interactive beneath the error list. Here is an example how you can use it:
Quickstart:
To get help in this window, type #help and press enter.
To execute a statement, simply press ENTER. To type in multiple lines, press SHIFT+ENTER for each line, and for the last line press ENTER to execute the entire statement.
To print the values of a variable, type its name and press enter (in the screen shot, I have done this for variable q)

Anybody else using MonoDevelop?

I'm starting a new project in MonoDevelop, and I want to see how other projects are using it.
I tried searching through SourceForge, code.google.com, etc., but mostly I was just finding things like add ins or something related to MonoDevelop itself.
So is there anyone else using MonoDevelop, especially open source?
Basically, MonoDevelop is designed to function very similar to Visual Studio, including using all the same sln/proj file types. You can take a VS solution, open it in MD, and hit F5 to run it, and vice versa.
Because of this, I don't know that many people are going to write about "how they use MD as part of their project" any more than someone is going to write about how they use Notepad.
Any project that is using sln/proj files on Linux/Mac is likely using MD.
MonoDevelop is multiplatform IDE, especially for Linux. Works with Visual Studio solution and project files (100% both direction compatibility). So you can't find project using it. Any C#/VB.NET project can be developed in MD.
Three years ago me and a friend started work a new mono project and tried to use MonoDevelop for it. However - this was an impossible mission - we got ridden with all kinds of bugs and crashes and in the end I said - go to hell MonoDevelop - I'll use my tried and true Emacs.
To tell you the truth with no features other than formatting and font locking Emacs turned out to be 10 times more productive environment for me. My friend somehow endured using MonoDevelop for the whole run of the project, but afterwards he said he was done with Linux for good if it offered such low quality dev tools.
Times were different back then, I've been following mono's development and monodevelop's as well - they seem to be turning out quite well. I think that the actual cause of your problem - not finding anything - lies in the fact that most Linux devs openly shun Mono as a development platform because of it's Microsoft roots. This is sad - because it's a solid alternative of Java - especially at the desktop applications front(GTK# is seriously cool).
Banshee seems to be using MonoDevelop. Probably most of the prominent mono projects with a GUI use it as well to some extent.
I've found MonoDevelop to be excellent so far. I've only been using it for about a month, but once I got it set-up the way I want it, I wouldn't go back to any other editor or IDE on Linux. It took me a while to figure out how to set the debugger up and configure the editor to how I like it.
It's almost like having Visual C# Express on Linux.
Try searching for MonoTouch projects. Mac + MonoDevelop + .NET iPhone apps.
I just tried compiling my project, 2 problems:
couldn't load Setup projects
couldn't load SQL Server Library projects
There is a way around this of course, just have to consider that not all project types can be built in mono and must design solution the way it doesn't stop you from building what you want.

Visual Studio 2008 crashes when opening solutions in a TortiseSVN directory? How do I fix this?

I'm using TortiseSVN for my subversion client on a Windows Server 2008 box and I've got a folder with code checked out into it.
When I go to open the solution file that's under source control Visual Studio 2008 starts and before it can even finish loading the solution from what I can tell Visual Studio crashes. I'm trying to open a solution that has VB code in it. It gives no error messages or warnings. It's just gone.
I have checked the files and they all seem fine. The solution file seems fine when I look at it with a text editor.
This is also Visual Studio 2008 SP1 and I've got all the latest .NET service packs installed.
Has anyone else seen this before and know how to fix it?
Edit: I just did an SVN export to a new directory and it still crashes in the exported directory where there is no longer any SVN attached to it.
Additionally, it crashes EVERY time I try to open the project that came from SVN.
You should be looking at the solution file with an xml editor, at least then you will get some help for subtile flaw's in the formatting or something like that.
You can also submit feedback to Microsoft on the VIsual Studio Connect site, if the bug turns out to be real.
Some commonsense things todo however would be, goto your visual studio command prompt, start off with "devenv /ResetSettings", that often helps isolate any weirdo add-on or something lke that.
Also, try to build clean with msbuild or vcbuild, then build fully with either one (i.e. if vcbuild can not build your solution, use msbuild). That can help by laying out the symbols and such and maybe clear out some corrupted file or something.
You also may have .suo files from your subversion, those are binary files that do contain some settings, it's common for people to accidentially check them in, but they are usually better off being kept on a per-developer basis (not in the source tree). The /resetsettings will likely clear these out also, but you may want to make sure.
You can also double check the path's to all of the assemblies referenced, that your not going from a 32/64 bit host, and the CLR DLL's are in different path's now etc...
One last thing, if your really stuck, you can get a stack trace and debug the crash a bit ;), see where the fault is occuring and search that module online, your'll often find that somebody may have a specific solution.
Oh yeah, also, hooker's can be trickey. Don't trust them for a minute. Make sure you set tsvn's "only load in windows exlporer" option and configure it specifically for what folders on your system have local-svn working directories, this will greatly reduce the working set for their shell extension. On most any system, over time, one program or another (apple irw.exe or adobe pdf-preloader.exe sort's of ad-ware) will try to work it's way into your shell. You should try to make sure your dev box is rather clean from anything hook's, simular to what VladV was saying...
I had a similar problem and I fixed it and afterwards I wasn't quite sure how I managed it.
It basically involved going to the tools/options menu and setting the source control plugin to none. However, I obviously had to have had the solution open in Visual Studio if doing this was to fix the solution, but yet I thought the problem was I could not open the solution.
The only possible scenario would be if I was able to open the solution, but not open any of the projects inside it, hence able to change the source control settings immediately after opening the solution.
Does that make sense?
Try opening your solution and projects files in a text editor, and looking for anything strange.
I once heard of a similar problem: a solution contained SVN bindings created by AnkhSVN, but Visual Studio had no AnkhSVN installed, and failed to open the solution without giving any meaningful error information.

Categories

Resources