# Visual Basic > Visual Basic .NET > VS 2022 [RESOLVED] App.Config

## sacramento

Hi to all,

I had made a convertion, from a project, from VS 2008 to VS 2022, and i would like to acess a app.config file in the new VS 2022, but i don't have it, in my solution explorer.
Any idea where i can find it?

Thanks
Manuel

----------


## jmcilhinney

What did you actually do? Upgrading a solution doesn't delete files.

----------


## sacramento

Hi,

I don't know if VS2008 have this "app.config" file, i don't see it, but i would like to know where i can see it in VS2022

Thanks

----------


## Peter Porter

> Hi,
> 
> I don't know if VS2008 have this "app.config" file, i don't see it, but i would like to know where i can see it in VS2022
> 
> Thanks


If you don't see app.config as part of this 2008 project, then it never had one, so you would have to add it with VS 2022.

In the Solution Explorer, right-click "_My Project_" and select "_New Item_". In the New Item window on the top right side enter "_app_" in the search box, and "_Application Configuration File_" will automatically display as a selection. Selecting and adding that you will have the app.config file as part of your project.

If you need to find app.config manually after you add it with VS 2022, it's in the _My Project_ folder of that project.

----------


## jmcilhinney

So your question was actually how to add a config file and had nothing at all to do with the conversion.

----------


## Peter Porter

> So your question was actually how to add a config file and had nothing at all to do with the conversion.


Sacramento thought the app configuration file was hidden somewhere. He/she probably tried out a test project with a higher framework in VS 2022, and seeing that it had an app.config file, assumed the old 2008 project had one hidden somewhere, and didn't understand why it didn't reveal itself when the old project was opened with VS 2022.

But if this project was recoded by hand, then Sacramento probably made the mistake of using an old framework, like 4, instead of a higher framework where VS automatically adds app.config files to.

----------


## sacramento

> If you don't see app.config as part of this 2008 project, then it never had one, so you would have to add it with VS 2022.
> 
> In the Solution Explorer, right-click "_My Project_" and select "_New Item_". In the New Item window on the top right side enter "_app_" in the search box, and "_Application Configuration File_" will automatically display as a selection. Selecting and adding that you will have the app.config file as part of your project.
> 
> If you need to find app.config manually after you add it with VS 2022, it's in the _My Project_ folder of that project.



Hi...thanks for your help, but the solution don't apear any "Application Configuration File" to add

----------


## sacramento

> So your question was actually how to add a config file and had nothing at all to do with the conversion.


Yes...add a config file

----------


## sacramento

> Sacramento thought the app configuration file was hidden somewhere. He/she probably tried out a test project with a higher framework in VS 2022, and seeing that it had an app.config file, assumed the old 2008 project had one hidden somewhere, and didn't understand why it didn't reveal itself when the old project was opened with VS 2022.
> 
> But if this project was recoded by hand, then Sacramento probably made the mistake of using an old framework, like 4, instead of a higher framework where VS automatically adds app.config files to.


HI...I see...In fact i use Framework 4 in VS 2008

----------


## jmcilhinney

Are you targeting .NET Framework or .NET Core (including .NET 5 and later)? If the former then you would add it from here:



If the latter then you don't use those XML config files any more. Instead, you should use an appsettings.json file. There's no item template dedicated to that though, so you can just add a JSON file and set the name yourself. You should read up on the expected format.

----------


## Peter Porter

> HI...I see...In fact i use Framework 4 in VS 2008


Ok, but how did you transfer your VS 2008 project to VS 2022? Did you simply reopened it in 2022, or did you recode it by hand? If you recoded it by hand, then you probably picked the wrong framework when you were creating a new project, or did you physically picked framework 4 in VS 2022?

You can see the framework in VS 2022 by clicking "My Project".

You need to provide us the exact process on how you transfered your project to VS 2022.

So far the information you provided is not enough and confusing. We shouldn't have to guess the process of how you moved your project to VS 2022.

----------


## sacramento

> Ok, but how did you transfer your VS 2008 project to VS 2022? Did you simply reopened it in 2022, or did you recode it by hand? If you recoded it by hand, then you probably picked the wrong framework when you were creating a new project, or did you physically picked framework 4 in VS 2022?
> 
> You can see the framework in VS 2022 by clicking "My Project".
> 
> You need to provide us the exact process on how you transfered your project to VS 2022.
> 
> So far the information you provided is not enough and confusing. We shouldn't have to guess the process of how you moved your project to VS 2022.


I simply reopened it in VS2022, and the app had made the conversion

----------


## sacramento

> Are you targeting .NET Framework or .NET Core (including .NET 5 and later)? If the former then you would add it from here:
> 
> 
> 
> If the latter then you don't use those XML config files any more. Instead, you should use an appsettings.json file. There's no item template dedicated to that though, so you can just add a JSON file and set the name yourself. You should read up on the expected format.


OK...I go see

----------


## sacramento

That i have in my project, concerning framework is:

----------


## Peter Porter

> That i have in my project, concerning framework is:


Your capture is unreadable. It's too small.

----------


## jmcilhinney

> Your capture is unreadable. It's too small.


Yeah, why capture your entire screen when only a small part of it is relevant? Think about this sort of thing and make an effort to make your question as readable as possible for those who you'd like to volunteer their time to help you.

Regardless, if you created the project in VS 2008 and haven't made changes, it's going to be a .NET FRamework project, so you can add a config file and should be able to do so as I showed.

----------


## sacramento

Sory, but i had try to put a picture bigger but I can't....the system redimension for the same size...Any way to put bigger pictures?

----------


## jmcilhinney

Why do you need a bigger picture? As I already said, only a very small part of that picture is relevant so only capture that part of the screen. Whether it be images or code or text or whatever, post all of what's relevant and ONLY what's relevant.

Apart from that, we don't need a picture at all. You can just tell us what framework version you're using in a couple of words.

----------


## sacramento

> Why do you need a bigger picture? As I already said, only a very small part of that picture is relevant so only capture that part of the screen. Whether it be images or code or text or whatever, post all of what's relevant and ONLY what's relevant.
> 
> Apart from that, we don't need a picture at all. You can just tell us what framework version you're using in a couple of words.


OK...that i have in the Target Framework is:
.NET Framework 2.0
.NET Framework 3.0
.NET Framework 3.5
.NET Framework 4.7.2
.NET Framework 4.8

The projet use 3.5

----------


## Shaggy Hiker

Yeah, with 2008, you couldn't have been using FW 4.0, as that was only introduced with VS2010. You might consider moving on from FW 3.5. That framework added several significant items, but FW 4.0 added more...and there's no reason to stick with 4.0 when you have 4.7.2 and 4.8 available (I don't know a good reason to choose one over the other).

----------


## jmcilhinney

The .NET Framework version is irrelevant to this issue anyway. All that matters is whether you're targeting .NET Framework or .NET Core, where .NET 5 and later are based on .NET Core. .NET Core apps don't use app.config files and .NET Framework apps do. That's all that matters. You're targeting .NET Framework so you can add an app.config file and we've told and shown you how to do that. Is there still a problem with that?

----------


## sacramento

> The .NET Framework version is irrelevant to this issue anyway. All that matters is whether you're targeting .NET Framework or .NET Core, where .NET 5 and later are based on .NET Core. .NET Core apps don't use app.config files and .NET Framework apps do. That's all that matters. You're targeting .NET Framework so you can add an app.config file and we've told and shown you how to do that. Is there still a problem with that?


Ok...no no problem...many thanks for the resolution of the question

----------

