So far i only wrote c# code in visual studio and for unity. However i decide to work on my C# fundamentals a bit instead of coding only for Unity, hoping to improve my understanding about OOP and designing my objects.
I started to follow pluralsight c# path where dotnet core used with visual studio code instead of regular visual studio. Next 18 hours i actively tried to run Hello World application. After i tried everything google has to offer yet failing, tens of times uninstalling and installing stuff yet failing.I somehow managed to do trick by creating an empty folder at "C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback" by following the tail of error messages.
You may comment something like, "you have learned a valuable lesson" etc. which may be true but i don't want to. I don't want to be an expert at making compilers run, i don't want to learn how they function. I just want to make my code better.
Now i could run Hello World app by using dotnet run from command line where i felt nice, finally i can move on to improve my OOP stuff. But wait VS Code didnt want to proceed.
After couple hours of tweaking i could finally run the code but i am not happy with it. The reasons why, and what i am asking is below.
VS Code build .json files with this lines..
tasks.json had "/property:GenerateFullPaths=true",
which i had to replace with "${workspaceFolder}/src/GradeBook",
and launch.json had
"program": "${workspaceFolder}/bin/Debug/<target-framework>/<project-name.dll>",
i had to replace it with
"program": "${workspaceFolder}/src/GradeBook/bin/Debug/netcoreapp3.1/GradeBook.exe",
What i don't mind is adding "/src/GradeBook" only if i have to do that when i use subfolders for project. I don't know if the problem with tasks.json was related to this. But do i have to fully replace tags like <target-framework> when .csproj file has a definition of target framework <TargetFramework>netcoreapp3.1</TargetFramework> .
I really do not understand how these .json files work, why auto-generated files do not do their job and how i can live interacting minimally with those. What are the minimal steps i "have" to take care of myself. Can somebody please explain me and please treat me like i am 3 years old with 5 IQ because i fell like one when i am dealing with these stuff.
After struggling a bit more i somehow found this.
https://www.reddit.com/r/vscode/comments/6ozrwj/is_there_really_no_other_way_of_adding_required/
There was a reply
Adding assets can be done with dotnet.generateAssets command. You can
invoke the command using the command palette (Ctrl-Shift-p), search
for .NET: Generate Assets for Build and Debug.
Which was looking exactly like the thing but unfortunately i got error message :
"OmniSharp server is not running" / "server has been stopped or not
started"
I somehow reached https://github.com/OmniSharp/omnisharp-vscode/issues/32 where was this comment
BedmanGit commented on 10 Jan 2019 Add path to environment works
http://reddyinfosoft.blogspot.com/2017/07/cannot-start-omnisharp-error-error.html
I added Windows/System32 to PATH. VS Code asked me if i want to generate necessary assets. I clicked yes. My project worked without me having to manually editing .json files.
Related
No code, since it's not a code problem, rather a visual studio one.
I've searched this problem up a bit and found people saying they had this problem, not really specifying how they got it, and most people answering "you should set AndroidManifest.xml's build actions to none" without any explanation of why this would work, which, well won't work for me since it's already what I have and I'm getting the error anyway.
How I came to have this problem:
I made a few files, file1, file2, file3, in my assets directory.
I would then read them with a streamreader. This worked.
Fast forward a few weeks, I decide to rename them, through visual studio, to file1.txt, file2.txt ... etc.
When I compiled/launched it on my device, it did not work. An exception on streamreader told me the file wasn't found. And before that I had 3 errors "#(Content)build action is not supported" for each of my files.
I assume the problem lies in the build actions or possibly the way android behaves with some specific files? Either way how could this have changed by changing the file format? I made them .txt files for clarity purposes, I didn't expect everything to break down after that.
Ontop of that, I could not revert it. I removed the file extensions, and I still have the same problem now.
What should I do to have my files in the assets folder properly deployed on my machine just like they used to ? Is it related to the build options?
Thanks in advance.
As highlighted by Jason in the comments above, the build actions for android assets should be AndroidAsset, which got changed after I renamed them. This menu can be found on the properties of the file.
https://learn.microsoft.com/en-us/xamarin/android/app-fundamentals/resources-in-android/android-assets?tabs=windows
It was a long WTF moment and I could not find any information on the issue, so I decided I put it here.
Setup: Windows 7 x86_64, sonarqube-4.3, sonar-runner-2.4, jre 1.7.0_55-b14
I followed quick start guide to configure Sonar.
I copied sonar-project.properties from a sample to my solution, put it in the directory with .sln, and made necessary adjustments:
sonar.projectKey=org.whatever.project
sonar.projectName=Project
sonar.projectVersion=2.0
sonar.sourceEncoding=UTF-8
sonar.sources=.
sonar.visualstudio.enable=true
Problem: Analysis ran without any exceptions but only C# files were analyzed.
Long story short, following line in config was causing the issue:
sonar.sources=.
After moving sonar-project.properties one level up and changing it accordingly, the problem was resolved.
sonar.sources=src
I think it actually relates to the usage of the Visual Studio Bootstrapper. Can you try the same without it?
Here is what happens: The Visual Studio bootstrapper reads all the <Compile> tags from the *.csproj files to determine which files must be imported. Javascript files are not referenced by <Compile> (as they do not need to be compiled), and will therefore not be imported in SonarQube.
See this related Jira ticket: https://jira.codehaus.org/browse/SONARVS-27
Recently we have been having problems with TFS and our code base. We have a section of tests that use Webdriver, and a section that use Coded UI. Lately, we've been having problems merging our code after a new build has been pushed out. Some folders show up as a white outline of a folder, which we can right click and select "include in project". We also notice some files missing, and we can't "get latest" to grab them. We have to go some round about way to do it (shelve code, delete local files, get latest, merge code). Even when we do that we still have some issues.
But the main issue we are having is that our Coded UI maps are breaking. Instead of being the normal structure such as:
.uitest
----.cs
----.designer.cs
When we merge in the new code, the UI maps break out like:
.cs
----.designer.cs
.uitest
I opened the .csproj in notepad++ and noticed that both the .cs and .designer.cs files no longer have a dependancy of the .uitest file. Now the .cs file has no dependancy, and the .designer is dependant on the .cs file. We can fix it with relative ease, but it keeps breaking in every build and we have several maps we need to fix. What exactly could the problem be here? Also, referring to my frist problems of files not being included in the project, what could the issue be there?
I asked the same question on the MSDN forums, but the suggestions I have received I have already tried, like creating a new workspace since the other might be corrupt. Still didn't work.
Thanks in advance
Edit: Had a suggestion on the MSDN forums to run VS as administrator. That didn't work either. Not really sure what could be causing this issue. It doesn't seem to be causing problems for everybody because some new builds cause issues for some people but not others. Some more info would be I run on Windows 7 64bit and Visual Studio Ultimate 2010.
In the past I've had issues with TFS that sound similar, 2 of our developers seemed to periodically create problems when merging files into the data store, folders and files would show as not included while the project file would make it in (breaking everything after get latest). Eventually the problem went away but we never truly found the source. I believe it had something to do with our network - maybe a switch issue in combo with the way we mapped working folders to network drives pointing to a shared dev server. Also one of the workstations seemed to have a problem with windows explorer not seeing file updates on the dev server share... developer would have to hit \servername\C$\sharefolder then hit his mapped network drive again before updates would refresh. (And his check in's created the most problems) ... we ran VS2008, TFS2010
Just some ideas...
Firstly, thank you for bothering to look at my question as 5 days of Googling has left me dreary to say the least.
I would like to know of a way that I can compile and then deploy without the use of Visual Studio. I am able to compile and then use MetaDataProcessor.exe to generate my PE (Portable Executable) files with the -minimize option. However, this seems to be where I get a little stuck. I believe that I am supposed to generate a database file including all of the PE files referenced in my application, and from there I am supposed to convert this into a Motorola SRecord file, however when I take these steps I am getting this result:
1) My .hex file is somewhere around 3.5x larger than the .hex file I pull off of my board after using Visual Studio to deploy (65kb from VS and 305kb with my steps)
2) When attempting to deploy and run my .NETMF application, I receive an error from the board itself saying that at least one of my assemblies has a null checksum (it aborts after the first null checksum received)
What is the secret step that I am missing, or what step am I using incorrectly here? Any help here would be greatly appreciated.
Thank you,
James.
I'm currently working on an application that will generate actual .cs and .xaml code files and add them to a project. I've managed to do this by manually editing an existing .csproj file and thats working well.
However I would like to be able to create the project files from my application as well, to cut out the extra step of creating the project first then running the application after.
Does anyone know how to create a C# project (class library, or WPF Application) from an application? I've looked into DTE, but I've hit a wall
I can't give a complete answer, but maybe I can point you in the right direction.
One avenue to explore in your own searching is MSBuild. C# and VB.net project files follow the msbuild format, and so the first step in building a valid project file is building a valid msbuild file.
Also, it sounds like you're doing something a little different, but have you looked at the T4 system for code generation?