Reading assembly attribute from other file [closed] - c#

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have a project in which
[assembly: AssemblyProduct("Meteor Viewer")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
exist not in assembly.info, but in xyz.cs file. how can I get assembly attribute from xyz.cs at any other page of product?

The attributes you mentioned are valid at any code file as long as it is part of your project and is compiled. If you have multiple projects in a solution that should share e.g. the version information for all assemblies you can even use one file and link it in all projects instead of copying the infos.
Right click on the project --> Add Existing Item --> Select your File --> Add as Link
When you included the file in your project(s) you can see this answer for how to get the values out of it:
https://stackoverflow.com/a/909583/254797

Related

I get tons of errors when I clone a repo from github (error CS0246) [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 months ago.
Improve this question
I have a problem. Every time that I clone a repo from GitHub I get all these errors. It's like VS doesn't recognize the system; and that is the cause of the problem, I think.
Image with errors.
I don't have this problem when I download the repo as a .zip file.
Does your system contain the SDK that matches the project.
For example, if it is a .NET 4.8 project, is this installed on your system?
You can inspect the project properties (.csproj file) for any hints:
Project Sdk
TargetFramework
Missing SDK's can be installed via https://dotnet.microsoft.com/en-us/download/visual-studio-sdks

Visual Studio find in *.cs files but not in *.aspx.cs and *.ascx.cs [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
What I want is to search in all *.cs files but not in *.aspx.cs and *.ascx.cs files. So all files found must be Something.cs, not Something.aspx.cs etc.
Couldnt find an answer for this when I searched stackoverflow. Is it possible to do this?
Go to Visual Studio Menu -> Edit -> Find and Replace -> Find in Files
The this form will pop up:
Then you can custom on "File Types" field.

What to do after files when creating c# in visual studio code [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have been searching for an answer to this question. When I make a python in vsc, I add .py after the file name. When I make a java file I add .java after file name. For c# I don't know what to add. I tried .exe, it gives me this symbol "*". I tried .cs, and it gives me the same symbol.
.Java is to Java files as .CS is to C# files.
Additionally you can install the C# extension from VSCode
Go to Extensions (Ctrl+Shift+X)
Search for #id:ms-vscode.csharp and install

How can I compile a C# code if my project is split into several source files? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I wrote a simple two-class project in C# and as I would do in Java I split the classes into two separate source files. When I try to run the source file with main, the compiler does not find the other file. What should I include to make it work?
I have one file with the class main and another file with a class Foo.cs.
They are in the same namespace
A good start would be to use an IDE like Visual Studio (The community edition is free) and it can be downloaded from Microsoft.
Create a new solution and project
Import the files (for VS, right click --> Add --> Existing item.
Compile the solution with the IDE

VB.NET set the assembly-version in one file for all projects in solution (VS2013)? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I want to store the assembly-version in one file for all projects in my solution.
This way it's easier to maintain the configuration.
In C# i can add links to the AssemblyInfo.cs in the project and Drag & Drop the file-link to the Properties.
This way the version is displayed correctly in Properties => Application => Assembly Information.
In VB.Net this is not possible. I can't Drop files into My Project. But this is the place where the AssemblyInfo.vb has to be placed. If it is stored in an other position, Visual Studio doesn't show it in My Project => Application => Assembly Information.
Create the link(file) in the project itself by right click Add existing item... and cut & paste the new link into the MyProject-Folder.

Categories