I am new in C#, in Visual Studio for Mac, and I need to open a project which extension is ".sln".
When I try to do it, a message is displayed:
error NETSDK1100: Windows is required to build Windows desktop applications.
Unable to create package spec for project.
I think I can manage to open some files to modify the code and make it acceptable for Mac, but I don't know where to start searching.
Starting with net6 SDK 6.0.4xx, it will be possible to build WPF/WinForms projects on non-windows operating systems.
It requires <EnableWindowsTargeting>true</EnableWindowsTargeting> to be set in the csproj or a Directory.Build.props file.
https://github.com/dotnet/docs/issues/30076
You are opened solution which includes Windows desktop application (for example WinForms). It is not possible yet (at least in official / standard way) to handle such projects by Visual Studio for Mac OS X. You need to run Visual Studio on Microsoft Windows system.
Related
For the first time I am trying Visual Studio for Mac and I located a tutorial for writing a exe that shows a window with a simple menu.
My two questions are:
How does a user of a Mac get the Mono platform? I can't find instructions for deploying Mono. When I look in my exe folder there is no other files. Just the exe.
Maybe this should be a different question but I could not find any "WinForms" version in Visual Studio for mac. I had to use Gtk2 (I think).
If there is a better place to ask these questions please direct me. Thanks.
I know understand that the best course of action was:
Create a Xamarin.Forms multi-platform project.
Create a Cocoa Mac OS project.
Add a reference to project 1 into project 2.
Using Nuget Package Manager download Xamarin.Forms into each project.
Now it is easy to create an application with XAML (similar to WPF).
Visual Studio for Mac creates the multi-platform project (step 1 above) automatically with the Android and iOS platform builds, but not the macOS.
I also see that I don't really need to download Mono as it is all dealt with automatically.
.NET Core does support Mac and Linux. And even though .NET Core now supports Windows Forms. Windows Forms is only supported on Windows. It's unlikely this will ever change due to Windows Forms dependency on the Windows APIs.
I am trying to create a Windows setup file for my .NET project. My IDE is Rider.
Can I use ClickOnce within Rider?
I looked into Squirrel but it seems it does not provide a way to present user with prompts that are needed at the installation, but the update mechanism it has is very smooth. It also works for .NET Framework but doesn’t work for .NETCoreApp so I would need to implement the installer and updater as separate applications.
What are my other options if I wish to stay with Rider only?
I know that you can use either of these tools for creating Xamarin projects, but can I also go between using the two of them? Ex: I am on a Mac, and my co-workers is on Windows?
I used to believe it was possible, but the moment we added the Windows project, we can no longer build for iOS.
When we try to build, we receive an error about not being able to import target WIndows.
I understand this, as I'm on a Mac. Even if I exclude the UWP project from the build process, it still throws this error.
How do you write Xamarin projects on both a Mac and a Windows machine?
Yes, you can. However, XS on a Mac cannot build Windows projects (although you should be able to exclude them from the build), and VS on the PC can only build iOS projects with the aid of a Mac to act as a build server. Otherwise the solution files should be portable between the two environments.
So, I installed Visual Studio 2013 on my Windows 8.1 box. I want to experiment with it and created a new Windows Store Grid App. I want to persist data on a SQLite database, apparently the database of choice for WinRT apps.
Quickly found links to the vsix needed in order to be able to use the SDK: SQLite download page, and downloaded sqlite-winrt81-3080002.vsix.
Installed it, then in my project, added the reference to the newly installed SDK (right click references, add reference, navigate to Windows, select extensions and tick SQLite for Windows Runtime (Windows 8.1) checkbox.
Also quickly found that it won't compile on Any CPU. On Configuration Manager, selected Debug, x64 active platform, that made me able to compile the application.
Finally, while attempting to use the namespace SQLite I noticed VS 2013 isn't recognizing it. Attempted many things like adding reference to the .dll directly, exploring the component to see which namespaces were available (which doesn't show anything), and I'm quickly running out of ideas. Because it's kinda new thing, and with limited interest, google, the saviour, doesn't want to save me today.
So, how one would be able to use the SQLite SDK in their Visual Studio 2013 projects, targeting Windows Runtime 8.1?
These are the contents of my csproj file
UPDATE
Stupid me, thought there was no managed land (.net) in Metro style land. Sorry for causing any confusion.
I installed the VSIX for SQLite and noticed that it is a native DLL to be used in Windows Store 8.1 C++ apps. It is not for managed C# projects.
The current NuGet package for SQLite from what seems to be the 'official' SQLite team is only working for .NET 4.5, if you try to install it, it will error saying it does not support .NET 4.51.
There is also the NuGet package SQLite-net, which works for .NET Windows Store apps. All you need to add is the SQLite using statement.
You will need this NuGet package as it is the managed wrapper for the SQLite, without you will not be able to properly reference the right DLL for SQLite.
Here is the link to the project information from that NuGet package. SQLite Runtime Support
Here is an article on how to use SQLite with Windows Store apps in VS2012 but it should still all apply:
SQLite and Windows Store Apps
I just made my first C# application in Visual Studio 2012 and I want to export it in some way so other people could use it in they computers (including computers without Visual Studio 2012). How can I do it? I'm new at C# and I couldn't find anything that I could understand. Can someone explain or indicate some site with a good (and maybe didactic) explanation on how it works? I have only made C/C++ programs by now, and they I just needed the .exe file, but, based on what I could find, I need something else to send a C# program to others to use.
Sory for the bad English and thanks for those who help.
Right-click the project in VS 2012, and choose Publish... from the context menu. Publishing to a file lets you create an installer:
Choose a location in the file system to which you would like to save the installer
Click [Finish]
Wait for the publishing operation to complete
A Setup.exe installer file will be created at the location that you have selected in the first step of the publish wizard. Share the installer with the people to whom you would like to give your application.
After building your project, you will find an EXE file in bin\(Debug or Release)
Check also the .net framework that it is required in order for c# apps to run. You can find what framework your app is build in projext properties. If the target computer has an old os (XP) maybe the .net framework needs also to be installed
You need any computer that wants to run it to be windows, and running the correct version of the .net framework. If it's a program that's created with VS2012, that'll be .net 2.0 to 4.5.2. After that, you need to find the location of your program, and you can just copy the debug folder that you are currently running from, and your program will work.