I have checked out an existing WinForms using SDK-Style csproj file, and Visual Studio does not detect the forms as forms that can be designed. As such, the WinForms designer cannot be used.
I can also reproduce this issue by creating a new net6 WinForms project and then deleting the csproj.user file containing information about the SubType. After reading about similar bugs in previous Visual Studio versions, the forms should be automatically detected and added to csproj.user file. However, this does not appear to happen for me.
Visual Studio version: 17.4.4
csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>
After further testing and contact with Visual Studio support, I figured out that the issue is related to the "Run code analysis in separate process" setting. If this setting is disabled, Visual Studio does not detect the forms on its own. After enabling it, everything works as expected.
Related
It seems Visual Studio doesn't recognize .NET Core global.json which list src and test as the projects in the solution. Without the famous .sln file, each project in the solution can be opened individually by opening associated project.json. Is there a way to open a solution which load the two projects?
I have a solution with a project that i developed using Visual Studio 2013 and it was working as intended. I then formatted my computer to upgrade to Windows 10 and decided to install Visual Studio 2015 instead and now I'm getting a lot of missing reference errors when they are installed, does anyone know why this is happening and how to fix it?
Some of the errors:
A good example is that I have Microsoft.Net.Http package installed but it's not recognizing it where I have using System.Web.Http;
I installed Visual Studio 2015 with the same user I'm using to run it (It's a personal computer and I'm the single user) and am running it as administrator.
If you need any extra information please leave a comment and I'll edit the question.
Update-Package in Package manager console
may sort it out if it is a missing / mismatched package issue
I had the same issue a few months ago. In my case the following two steps worked:
1) Delete the hidden .vs folder from the solution folder, it's next to the .sln file (but close visual studio first)
2) From the .csproj file, remove these entries (if they exist)
<RestorePackages>true</RestorePackages>
And
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets'))" />
</Target>
I ended by creating a new project and just copying the files and only a few lines of configurations I needed from the old project and that solved it for me.
I am having this error in Visual Studio 2015 when try to create app package for the store for a windows universal applicaiton:
Manifest references file 'MyAppName.dll' which is not part of the payload.
The error is in the ...\..MyAppSourcePath..\Package.appxmanifest file.
This is somehow related Manifest references file 'Bing.Maps.dll' which is not part of the payload but in my case the error shows up only when build package for the store and is related to the MyAppName.dll (where MyAppName is the name of the name of my application).
Another related question in MSDN: https://social.msdn.microsoft.com/Forums/en-US/f137091e-f550-4eab-b7e2-418149b97d40/error-appx0703-manifest-references-file-myappnamedll-which-is-not-part-of-the-payload?forum=windowsstore
It turns out this is known issue in Windows 10 SDK (Update 1.1). Reference: https://social.msdn.microsoft.com/Forums/en-US/73f2d56d-9e8e-4b57-bcfa-0a972dfd75d7/update-11-generating-store-associated-package-fails-for-a-uwp-application-with-a-winrt-component?forum=Win10SDKToolsIssues
To workaround this issue, add the below ItemGroup in your project file and regenerate the package.
<ItemGroup>
<AppxSystemBinary Include="<Assembly Mentioned in the error>" />
</ItemGroup>
For example, if the assembly name is MyAppName.dll, include:
<ItemGroup>
<AppxSystemBinary Include="MyAppName.dll" />
</ItemGroup>
This ItemGroup can be expanded if the error still occurs for other assemblies, for example:
<ItemGroup>
<AppxSystemBinary Include="MyAppName.dll" />
<AppxSystemBinary Include="OtherAssembly.dll" />
</ItemGroup>
A bug fix for the Visual Studio Tools for Universal Windows Apps (v1.1.1) is released on 5 October 2015. This update requires that you already have the UWP tools v1.1 installed. You can determine whether you have UWP tools 1.1 installed by opening About Microsoft Visual Studio from the Help menu in Visual Studio. If you have “Visual Studio Tools for Universal Windows Apps 14.0.23309.00” installed, then you have the UWP tools 1.1.
To install this update
You must have an internet connection throughout the setup process.
For machines without Visual Studio
Install Visual Studio from https://dev.windows.com/downloads.
For machines with UWP Tools 1.1 installed
Run this installer (http://go.microsoft.com/fwlink/?LinkId=627168) to update the UWP tools to v1.1.1.
For machines without UWP Tools 1.1 installed
For Visual Studio 2015 Community, Professional, and Enterprise, you can install by
Modifying your setup to install the updated tools.
Clicking on the entry for the UWP tools in the Notifications pane.
Using the Extensions and Updates dialog to update Visual Studio.
Running the installer at https://dev.windows.com/downloads, which will add the updated tools to an existing Visual Studio installation.
For Visual Studio 2015 Express for Windows
Run this installer (http://go.microsoft.com/fwlink/?LinkId=624822) to update the UWP tools to v1.1.
To confirm that you have installed the UWP tools 1.1.1 update,
Go to Programs and Features in the Windows Control Panel, and click View installed updates.
Look for “Update for Microsoft Visual Studio 2015 (KB3073097)”, version 14.0.23315
Source: https://social.msdn.microsoft.com/Forums/en-US/73f2d56d-9e8e-4b57-bcfa-0a972dfd75d7/update-11-generating-store-associated-package-fails-for-a-uwp-application-with-a-winrt-component?forum=Win10SDKToolsIssues
I had a hell of a time trying to work this out and it's a slightly different issue to what the OP posted but hopefully this will help someone else out because I couldn't find the answer on StackOverflow and finally found it here: https://social.msdn.microsoft.com/Forums/Sharepoint/en-US/65bc5999-662c-4eda-9967-e1b3031db8c4/error-appx0703-error-manifest-references-file-assetssplashscreenpng-which-is-not-part-of-the?forum=wpdevelop after many hours of mucking around and trying different things.
My error was the same except the file was for the various store and tile image files thus: "Manifest references file 'Assets\Store\StoreLogo.png' which is not part of the payload."
All the files did exist but turned out I was running Visual Studio on a VM using Parallels and the project opened through shared folders and using a UNC path. Ran the project from a mapped drive and it builds all good.
I do realise now that referencing UNC paths using a VM in Parallels Desktop has caused a few issues for me in the past. So just need to keep in mind that things should be run via a mapped drive instead to avoid this.
I downloaded visual studio community 2015. I tried to create a Shared Project and am getting an error:
Content from Microsoft.Windows.UI.Xaml.CSharp.targets
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(TargetPlatformVersion)'==''">
<TargetPlatformVersion>8.0</TargetPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetPlatformIdentifier)' == 'UAP'">
<RedirectionTarget>8.2</RedirectionTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(RedirectionTarget)' == ''">
<RedirectionTarget>$(TargetPlatformVersion)</RedirectionTarget>
</PropertyGroup>
<!-- Direct 8.0 projects to 8.1 targets to enable retargeting -->
<PropertyGroup Condition="'$(RedirectionTarget)' == '8.0'">
<RedirectionTarget>8.1</RedirectionTarget>
</PropertyGroup>
<Import Project="$(RedirectionTarget)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
</Project>
I do not have folder with name 8.1
One workaround is to make the following edits:
Open the file %ProgramFiles(x86)%\MSBuild\Microsoft\VisualStudio\v14.0\CodeSharing\Microsoft.CodeSharing.CSharp.targets (for Visual Basic the file is Microsoft.CodeSharing.VisualBasic.targets) and look for the following entries around line 8 -
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets')"/>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" Condition="!Exists('$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets')" />
Change these lines to the following -
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" Condition="false"/>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" Condition="true" />
Basically, undo the conditional import of the Xaml based shared projects.
This is (believe it or not) the advice I received from MS for this issue. I think it's related to an unclean upgrade of the RC (or earlier) versions to RTM and the selection of different options during install.
(Insert usual caveats about editing files that don't "belong" to you, take backups, and if you're not confident to make such edits, don't)
Try to copy 8.0 and 8.1 directories from C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v12.0 to C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0 (notice version number at the end).
It seems that those are missing in 2015 installation on windows 7.
You'll need to restart Visual Studio after that.
To fix this issue install the Windows 8/8.1 Project templates.
All I did was:
Open VS 2015
Click File->New->Project
Choose the only
Project template under Windows 8
This will launch Visual Studio setup where you can install the templates that are missing.
Then you can create your Project.
This is not a hard problem. Mr. Kriper (the original asker of the question) likely installed using the "Default Install" for his version of Visual Studio 2015. Mr. Kondrasovas in Answer 2 points to needing to install more components. His approach resulted in a Visual Studio displaying a setup utility error which is no fault of Mr. Kondrasovas. Mr. Kondrasovas answer is likely correct if you do not encounter an error (I have no way to verify the answer).
The solution is to go to Control Panel | Programs | Uninstall a program. Select Visual Studio 2015 and "Modify" the installed instance of Visual Studio 2015:
[sorry I cannot show the image b/c I do not have a 10 for a reputation and StackOverflow.com is blocking me]
The previous (imaginary) screenshot is from the default install of Visual Studio 2015 Professional. You can mess around and figure out the exact feature to install or if you have the disk space, simply click on "Select All" and then "Next". Hint: the "Next" button is not enabled until a change is made to the selected components of Visual Studio 2015.
If you want to see the missing image a complete write up, I wrote a blog post on the issue: http://www.softwarepronto.com/2015/08/visual-studio-2015-error-adding-shared.html
Well I want to add support for the PAWN language to Visual Studio 2012.
But because of the lack of experience and lack of tutorials/add-ins which I can edit it's really a difficult task.
For now I only want to add the filetypes and compiler, no need for intellisense and for syntax highlighting the C syntax highlighter can be used.
I know there is the OOK Language implementation and Boo Language but those add-ins are for VS2010 and won't compile for VS2012.
How would I accomplish this?
Is there a language add-in (for VS2012) which I can edit/use as base/ use as example?
My last attempt resulted in a black window / unusable VS2012 IDE.
The official language extension sample for Visual Studio 2010 was the Iron Python Integration sample.
You can download it from here: IronPython Integration. There is a related documentation here: Visual Studio IronPython Integration Deep Dive
Unfortunately this sample was not updated for Visual Studio 2012 to my knowledge. However here are the steps to convert it to Visual Studio 2012.
install the Visual Studio 2012 SDK from here: Microsoft Visual Studio 2012 SDK
download the Iron Python integration sample, extract somewhere on your disk
open IronPython.sln, and accept all upgrade conversions
change the projects' platform target from AnyCpu to x86
some projects have incorrect (auto hinted) references to Visual Studio 11 assemblies (built against .NET 4.5), so they won't compile as is. Change them back to Visual Studio 10 assemblies. Example, Microsoft.VisualStudio.ExtensibilityHosting.dll in the IronPython.Console projet needs to point to the equivalent file in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies.
define the IronPython.Project project as the start up project, and update it's Debug parameters: the start action needs to start the C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe (VS 2012 shell) external program instead of the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe (VS 2010 shell) one that was set by default. Command line arguments should be set to /RootSuffix Exp
update all base templates to use VS 2012 directories instead of only VS 2010 ones: search for the IronPython.targets string in all .pyproj file and add the VS 2012 case, like this:
before:
<PropertyGroup>
<!-- Set the IronPythonPath property by proving in different locations where Iron Python could be installed -->
<!-- Regular LocalAppData -->
<IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(LocalAppData)\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython\1.0\IronPython.targets')">$(LocalAppData)\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython\1.0</IronPythonPath>
<!-- Experimental LocalAppData -->
<IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(LocalAppData)\Microsoft\VisualStudio\10.0Exp\Extensions\Microsoft\IronPython\1.0\IronPython.targets')">$(LocalAppData)\Microsoft\VisualStudio\10.0Exp\Extensions\Microsoft\IronPython\1.0</IronPythonPath>
<!-- Integrated Shell -->
<IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(MSBuildExtensionsPath)\Microsoft\IronPython Studio 2010\1.0\IronPython.targets')">$(MSBuildExtensionsPath)\Microsoft\IronPython Studio 2010\1.0</IronPythonPath>
</PropertyGroup>
after:
<PropertyGroup>
<!-- Set the IronPythonPath property by proving in different locations where Iron Python could be installed -->
<!-- Regular LocalAppData -->
<IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(LocalAppData)\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython\1.0\IronPython.targets')">$(LocalAppData)\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython\1.0</IronPythonPath>
<!-- Experimental LocalAppData -->
<IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(LocalAppData)\Microsoft\VisualStudio\10.0Exp\Extensions\Microsoft\IronPython\1.0\IronPython.targets')">$(LocalAppData)\Microsoft\VisualStudio\10.0Exp\Extensions\Microsoft\IronPython\1.0</IronPythonPath>
<!-- Regular LocalAppData VS10212 -->
<IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\Extensions\Microsoft\IronPython\1.0\IronPython.targets')">$(LocalAppData)\Microsoft\VisualStudio\11.0\Extensions\Microsoft\IronPython\1.0</IronPythonPath>
<!-- Experimental LocalAppData VS2012-->
<IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(LocalAppData)\Microsoft\VisualStudio\11.0Exp\Extensions\Microsoft\IronPython\1.0\IronPython.targets')">$(LocalAppData)\Microsoft\VisualStudio\11.0Exp\Extensions\Microsoft\IronPython\1.0</IronPythonPath>
<!-- Integrated Shell -->
<IronPythonPath Condition=" '$(IronPythonPath)' == '' AND Exists('$(MSBuildExtensionsPath)\Microsoft\IronPython Studio 2010\1.0\IronPython.targets')">$(MSBuildExtensionsPath)\Microsoft\IronPython Studio 2010\1.0</IronPythonPath>
</PropertyGroup>
That's it. Compile and run (both can take a while the first time due to registration mysteries).
Here is the result when starting a new Iron Python project from Visual Studio 2012:
and when building:
Take a look at this CodeProject article Developing extension packages using C# and source that appears to have been updated for Visual Studio 2012 as well as older versions of Visual Studio.
Here is an article from Microsoft on the subject of Creating an Add-in.
Here is a second CodeProject article, part of a series Extending Visual Studio Part 2 Creating Addins.