简体   繁体   中英

Visual Studio 2017 VB.NET Forms App - saving project files to different locations

I have an older VB.NET Windows Forms App that was on an older laptop (Win7 Pro) that crashed that I need to move to a new laptop (Win10 Home). Unfortunately when this project was created ( using Visual Studio 2017 ) it had 4 project files that were somehow saved on the desktop (Form1.vb, Form1.Designer.vb, Form1.resx, and ApplicationEvents.vb). I really want to get all of the project files together into a single folder (under "Visual Studio 2017\\Projects"). After some tinkering I was able to get the project files moved over to the new machine but I had to put the 4 files back onto the desktop to allow it to compile. I'll admit, I'm a little rusty on my VS use, so I'm not exactly sure how to move these desktop files within the project successfully. I tried just doing a Save-As to a new path but I got build errors. Can anyone provide a little help on how I can properly do this. Appreciate any help. Thanks.

Move the files into the desired folder, and then remove the file references from the project and add them back from the new location. Or, if you're adventurous, you can do this by manually editing the dot-.vbproj file (which in your case should be called NSMConvertCSV.vbproj), which is XML.

The XML structure is pretty simple:

 <ItemGroup>
   <Compile Include="Form1.vb">
     <SubType>Form</SubType>
   </Compile>
   <Compile Include="Form1.Designer.vb">
     <DependentUpon>Form1.vb</DependentUpon>
     <SubType>Form</SubType>
   </Compile>
   <Compile Include="My Project\AssemblyInfo.vb" />
   <Compile Include="My Project\Application.Designer.vb">
     <AutoGen>True</AutoGen>
     <DependentUpon>Application.myapp</DependentUpon>
   </Compile>
   <Compile Include="My Project\Resources.Designer.vb">
     <AutoGen>True</AutoGen>
     <DesignTime>True</DesignTime>
     <DependentUpon>Resources.resx</DependentUpon>
   </Compile>
   <Compile Include="My Project\Settings.Designer.vb">
     <AutoGen>True</AutoGen>
     <DependentUpon>Settings.settings</DependentUpon>
     <DesignTimeSharedInput>True</DesignTimeSharedInput>
   </Compile>
 </ItemGroup>
 <ItemGroup>
   <EmbeddedResource Include="Form1.resx">
     <DependentUpon>Form1.vb</DependentUpon>
   </EmbeddedResource>
   <EmbeddedResource Include="My Project\Resources.resx">
     <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
     <LastGenOutput>Resources.Designer.vb</LastGenOutput>
     <CustomToolNamespace>My.Resources</CustomToolNamespace>
     <SubType>Designer</SubType>
   </EmbeddedResource>
 </ItemGroup> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM